I'm compiling a custom application using the CMake scripts in the nRF mesh SDK. The first time I flash to the nRF52832 a SIGTRAP occurs on sd_softdevice_enable. I cannot continue from this. If I flash again, it does not occur. Any idea what might be happening, or how I can prevent this?
See also related issue https://devzone.nordicsemi.com/f/nordic-q-a/50709/breakpoints-not-being-hit
I'm wondering if when this SIGTRAP occurs, it is because the softdevice is missing, but breakpoints work because the breakpoint address is being set relative to flash start. When the softdevice is present the SIGTRAP does not occur but breakpoints do not work because they are still relative to flash start not to application start, so land somewhere in the softdevice.
So if I'm correct, that leads to two questions: Why is the softdevice not being written on first flash, and how do I offset breakpoints by the softdevice length?