Converting an STM32F103 board to a Black Magic Probe

Using the $2 (Blue Pill) STM32 board we can have a debugger that supports breakpoints. No need of OpenOCD server, as it runs a GDB server on chip directly.

A generic $2 STM32F103 board on AliExpress (aka Blue Pill)
(source)
  1. Clone this repo. git clone git@github.com:blacksphere/blackmagic.git
  2. Run make, to get the right git submodules. Ignore any errors that might occur. Remove the -Werror flag from this line, if you get a warning that is thrown as an error.
  3. Go into cd src and run make clean && make PROBE_HOST=stlink.
  4. You should get two files in the src directory — blackmagic_dfu.bin and blackmagic.bin.
python ./stm32loader -p /dev/tty.SLAB_USBtoUART -e -w -v src/blackmagic_dfu.bin
TARGET          DEBUGGER
GND GND
SWDIO PB14
SWCLK PA5
POWER 3.3V
TARGET          DEBUGGER
RXD PA3
TXD PA2

--

--

Software guy. When you try to tell computers what to do, you eventually learn about human nature as well. (http://paramaggarwal.com)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Param Aggarwal

Software guy. When you try to tell computers what to do, you eventually learn about human nature as well. (http://paramaggarwal.com)