-
There is a wdt_off GDB macro at https://github.com/espruino/Espruino/blob/master/.gdbinit#L31-L33 that you can call the very first time you break execution after the softdevice is started
Well that is useful if one has watchdog started but is not so much related to softdevice
https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/wdt.html?cp=5_2_0_39_3_6#register.CONFIG - there is a bit that pauses watchdog when being debugged. EDIT: however I am not sure what writing value 1 done bywdt_off
there can fix, from description clearing both bits 0 and 3 could help?Found the PRIMASK stuff, discussed here https://devzone.nordicsemi.com/f/nordic-q-a/477/can-i-debug-ble-program/2498 with some gdb hooks EDIT: oh i see now that it is already there in
.gdbinit
I'm surprised you hit issues with
--overlap=replace
- my understanding was that's only really needed if the hex files overlap - and if they're overlapping generally that's probably going to cause you some problems as something is too big?On the debug front, it's a nightmare with nRF52 because the softdevice tries to restart if it realises the CPU is halted for much time. There is a
wdt_off
GDB macro at https://github.com/espruino/Espruino/blob/master/.gdbinit#L31-L33 that you can call the very first time you break execution after the softdevice is started and I believe that will stop the reboot, but bluetooth connections will still completely break as soon as you start breakpointing stuff.