debugging

Black Magic

The ds-D6 smartwatch has a serial port.


The blackmagicprobe can lauch a debugger : west debug --runnerblackmagicprobe.
The probe has a serial port /dev/ttyACM1 (linux : minicom -b 115200 -D /dev/ttyACM1)

STM32 - Raspberry - OpenOCD

If you do not have a Segger debug probe nor a serial port, you can put a value in memory at a fixed location.
With openocd you can peek at this memory location.
If you own a raspberry pi or an orange pi, you can use the GPIO header.
Another cheap option is an stm32 debug probe.

Note

#define MY_REGISTER (*(volatile uint8_t*)0x2000F000)

in the program you can set values: MY_REGISTER=1; MY_REGISTER=8;

this way you know till where the code executes

#telnet 127.0.0.1 4444

programming

once your telnet sessions started:
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Open On-Chip Debugger
>mdw 0x2000F000 0x1

the last byte shows the value of your program trace value