Skip to content

Instantly share code, notes, and snippets.

What would you like to do?

How to flash the STM32 "blue pill" on macOS Mojave (arm64)

Valid as of March 27th 2022

OpenOCD debugger

Install the latest openocd version (the official version produces a segmentation fault)

brew install openocd --head

and append set CPUTAPID 0 to /opt/homebrew/share/openocd/scripts/board/stm32f103c8_blue_pill.cfg.

Run OpenOCD server

openocd -f interface/stlink.cfg -f board/stm32f103c8_blue_pill.cfg


Install the cross-compilation toolchan:

brew install gcc-arm-embedded

Install rustup (the homebrew version is from 2021)

curl --proto '=https' --tlsv1.2 -sSf | sh

and add cross-compilation target

rustup target add thumbv7m-none-eabi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment