In this video, I cover hardware and software configuration for debugging Arduino code running on STM32F103 MCU.
Hardware
STM32F103C8T6 Blue Pill Board
CH custom board
ST-Link V2
Software
Arduino IDE 1.8.10 on Ubuntu 16.04, https://www.arduino.cc/en/Main/Software
STM32duino Roger Clark, https://github.com/rogerclarkmelbourn...
STlink, https://github.com/texane/stlink
gdbgui, https://www.gdbgui.com/
Sketch
blink.ino
Command Line
arduino
edit blink.ino
set board and upload method
turn on verbose
get path to arm-none-eabi-gdb
get path to build directory
modify PATH
export PATH=$PATH:/home/holla/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/:/home/holla/stlink/build/Release/src/gdbserver
start ARM gdbserver
st-util -p 1234
start ARM gdb
cd build dir
arm-none-eabi-gdb blink.ino.elf
arm-none-eabi-gdb -tui blink.ino.elf
start ARM gdbgui
cd build dir
gdbgui -g /mnt/ramdisk/arduino/arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-gdb blink.ino.elf