• Stars
    star
    201
  • Rank 193,283 (Top 4 %)
  • Language
    C
  • Created almost 8 years ago
  • Updated almost 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Bootstrap C code on a Cortex-M MCU

Bootstrapping C (and rust) applications on Cortex-M MCUs

Quick explorations of different ways to bootstrap a GNU C (or rust) application on a cortex-M based MCU.

While the concepts apply broadly, these examples run on an Arduino M0 Pro (they should work fine on an Arduino Zero as well).

I chose the M0 Pro because:

  1. It was available at my local electronics shop
  2. It comes with an integrated SWD debugger (Atmel EDBG)
  3. It sports a cortex-M mcu (cortex-M0+)
  4. It is reasonably cheap ($40)

An STM32-based Nucleo or an mbed board would do just as well.

In my experience, many of the techniques highlighted here are often glossed over, poorly documented, and rarely understood. Most people rely on startup files and linker scripts bundled with their vendor's BSP that they tweak haphazardly as their needs evolve.

The following scenarios are currently covered:

  • default: simple LED blink using the default startup file & linker script from the BSP
  • minimal: a bare minimum LED blink app with a pared down script, startup, and no libc
  • with-libc: builds on minimal to add newlib support, including printf
  • reloc: builds on with-libc to add functions relocated to RAM as well as ROM
  • bootload: splits the code into two applications, a bootloader and an application. The bootloader simply starts the applications
  • bootload-reloc: builds on bootload but runs the applications entirely in RAM. The bootloader thus needs to copy it over first.
  • rust: barebones rust app

More to come, and blog posts will follow.

Dependencies

Building

make builds all apps, the resulting elfs and bins are in their respective folders under build

make <app-name> builds a specific app. E.g. make bootload-reloc

Flashing

make flash-<app-name> flashes a specific app (it needs to have been built first)

Credits

More Repositories

1

interrupt

A community for embedded software makers.
C
445
star
2

memfault-firmware-sdk

Memfault SDK for embedded systems. Observability, logging, crash reporting, and OTA all in one service. More information at https://docs.memfault.com.
C
143
star
3

awesome-embedded

A curated list of awesome embedded software frameworks, libraries, resources, and shiny things.
97
star
4

gdbundle

Minimalist plugin manager for GDB and LLDB
Python
80
star
5

memfault-linux-sdk

Memfault SDK for embedded Linux systems. Observability, logging, crash reporting, and updating all in one service. More information at https://docs.memfault.com.
Rust
22
star
6

bort

Memfault SDK for AOSP
Kotlin
17
star
7

conda-recipes

Conda recipes that the greater firmware community may enjoy
Shell
13
star
8

interrupt-renode-test-automation

C
9
star
9

memfault-docs

Memfault Docs
JavaScript
4
star
10

gdbundle-PyCortexMDebug

gdbundle plugin for bnahill/PyCortexMDebug
Python
3
star
11

mcuxpresso-rt1060-example

C
2
star
12

web-ble-example

JavaScript
2
star
13

nrf5-segger-embedded-studio-example

example project for nRF5 SDK + SES
C
2
star
14

esp32-standalone-example

C
2
star
15

nrf-connect-nrf52840

quick and dirty sample nrf-connect app for the nrf52840
C
2
star
16

bort-lite

Bort Lite Preview is an APK for users to try out Memfault's Android observability and management offering
2
star
17

memfault-yocto

This repository contains Memfault-specific Yocto layers and example configurations. Read documentation on Memfault support for Linux: https://docs.memfault.com/docs/linux/introduction
BitBake
2
star
18

nrf7002-memfault-example

C
1
star
19

gdbundle-example

gdbundle example plugin
Python
1
star
20

memfault-asset-tracker

Memfault's version of the asset-tracker-cloud-firmware-aws repo
C
1
star
21

gdbundle-voltron

gdbundle plugin for snare/voltron
Python
1
star
22

memfault-arduino-library

C
1
star