This is how you do it on Linux, I will try to figure out how to do it on other Mac and Windows later:
- get an ST-link V2
- hook SWDIO, SWDCLK and GND to the corresponding pads on the proffieboard
- Start openocd, which is a bridge server between gdb and the st-link.
cd $HOME/.arduino15/packages/proffieboard/hardware/stm32l4/*.*.*/ sudo ./tools/linux/openocd/bin/openocd -s tools/share/openocd/scripts/ -f ./variants/STM32L433CC-Proffieboard/openocd_scripts/stm32l433cc_butterfly.cfg
- Compile and upload ProffieOS (or some other program) to your Proffieboard
- In the compilation output, find the generated elf file, also make sure to remember your source dirctory.
- Run gdb-multiarch
gdb-multiarch -d /path/to/ProffieOS /tmp/arduino_build_250572/ProffieOS.ino.elf -ex 'target remote localhost:3333'
- When you first connect, the state will be kind of weird and the program will still be running. Type
contand then press ctrl-c to stop the program. Now you can inspect variables and generally use gdb as you would normally.
One day this might all become easier, but right now, not a lot of people actually use this, so it’s not been a high priority for me.