GithubHelp home page GithubHelp logo

numaru / hello-cortex-m Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 1.0 5.66 MB

Compile C code for an ARM Cortex-M micro-controller and run it in Renode

License: MIT License

CMake 0.04% Assembly 0.86% C 97.52% C++ 1.58%
embedded cortex-m arm cmake stm32f103 renode micro-controller cortex

hello-cortex-m's Introduction

Hello Cortex-M

This example project show how to compile C code for an ARM Cortex-M micro-controller and run it in Renode.

The targeted MCU is a stm32f103rb.

The projet use uart to printf() in the terminal. The libc_nano and nosys_nano standard libraries are used to achieve this.

Getting started

Development environment

  • CMake (3.14.0)
  • Manjaro Linux (18.0.2)
  • Renode (1.9.0)
  • GNU Arm Embedded Toolchain (8.3.0)
  • VSCode (1.32.3) with the following extension:
    • C/C++ (0.22.1)
    • CMake (0.0.17)
    • LinkerScript (1.0.0)
    • ARM (0.3.0)

I belong to the TUI gang

Configure

cmake -S . -B build -G Ninja -DCMAKE_TOOLCHAIN_FILE=toolchain-files/gnu-cm3.cmake -DCMAKE_BUILD_TYPE=Debug

Build

cmake --build build

Run

# Run this command in a terminal
cmake --build build --target renode

# This one in another
arm-none-eabi-gdb build/HelloWorld.elf -ex "target extended-remote :3333"

Known issues

  • The SysTick handler trigger breakpoints during debug and it makes it harder.

hello-cortex-m's People

Contributors

numaru avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

azwdski

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.