Closed farrenv closed 4 years ago
@flit @trowbridgec @AGlass0fMilk @maclobdell
While attempting to get Jlink to work I added a printf to the code. I was running arm-none-eabi-gdb manually when I set a breakpoint at line 19 as before. The debugger became trapped at line 21 where I had added the printf. I went back and tried pyocd and it was happy to set and find the breakpoint on line 21. I believe this issue can be closed. Thanks!
Use a container
I am developing in a virtual machine passing through DAPlink running on K20DX as debugger connected to an nRF52840 on the Agora target. I am able to flash binaries to the Agora, and I am able to start and run a debugging session. However, I am unable to set a breakpoint anywhere other than the first line in main().
Here is the debug output that is generated starting a debugging session until it reaches main()
Here is the output generated when I attempt to add a breakpoint to line 19:
I've searched for why gdb would report "No line x in file". I tried adding -ggdb to the list of compiler flags but that had no effect. I reduced the compiler optimization from -Og to -O0. This actually allowed me to set breakpoints, but mbed crashes after one pass through the while loop. I think there may be an issue with sleep and the 0 optimization.
Host OS: Linux KDE Plasma Virtual Machine Embedded OS: mbed-os-6.2.0 IDE: vscode (1.47.3) Debugger: DAPLink on Flidor development board Target: Agora pyocd: 0.27.2