Hi,
The “Signal 0” error means that OpenOCD has lost connection to the target. It typically happens when the target program disables some functionality needed by JTAG/SWD (e.g. remaps the SWD pins to GPIO). The best way to troubleshoot it is as follows:
- Set a breakpoint very early in main() or use F10 instead of F5 to start debugging. Make sure it works.
- Set a breakpoint in some other code that is supposed to run slightly later and press F5 to continue
- If the second breakpoint worked, set another one even later. If not, restart the program and set a breakpoint between the ones in steps 1 and 2.
If you see that a breakpoint at the beginning of a long function works, and another one at the end doesn’t, you can step that function with F10 until the debugging stops working.
This should help quickly locate the code responsible for breaking the debugging, and comment it out (or check if it’s #ifdef-ed against some macro that you can define).