I'm building a software for the nrf5822 using pc10028. I'm using CMake and after following both morf.lv/modules.php and devzone.nordicsemi.com/.../ I successfully made the debugger to work... except I'm not having breakpoints.
I'm pretty sure I'm using the wrong compile flags here. Is there a place I can check them? Else, can you tell me which ones I should be using?
This is normal. You cannot use breakpoints with Softdevice.
In order to debug you need to add the -g3 flag and remove compiler optimization (to get expected debug results). So you need to change the CFLAGS += -Wall -Werror -O3 line to CFLAGS += -Wall -Werror -O0 -g3.
CFLAGS += -Wall -Werror -O3
CFLAGS += -Wall -Werror -O0 -g3
Note that the BLE link will get disconnected when hitting a breakpoint, because the radio will be halted, and the radio will therefore not be able to transmit the necessary packets to keep the connection. The link will disconnected after a timeout given in the connect request (or a connection parameter update).
Excellent! That did my day! Thanks a lot!
What debugger program did you use ? Segger OZone ?? Or something else ??
gdb trough JLinkGDBServer.