This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Reattaching gdb to a running nRF51822

I have a board built which is a tracking device with a GPS and GSM modem. I'm beginning field testing and have been flashing it with a Segger then disconnecting the Segger and wandering around outside with the device, using some debug LEDs to see a bit of what's going on in my code. I now want to be able to reattach the Segger and connect gdb to see the state of some variables without resetting the Nordic.

Is this possible? My current .gdbinit looks like this:

target remote localhost:2331 load mon reset break main set print elements 0

Obviously I don't want 'mon reset' anymore. But even after 'load' I seem to be in the reset handler and all previous state is lost. Without load, I can't print any variables.

Related