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

Segmentation fault when debugging nRF52840-DK

Hello, I am developping on a nrf52840-DK board and try to debug using a Black Magic probe. Software is based on softdevice, GCC build chain and Visual Studio Code with Cortex-debug extension. For now, we advertise on BLE and send the battery voltage when connected, we go to sleep when the voltage is too low. All this works well as long as we don't try debugging. The execution is stopped at the beginning of main() until the button 4 is pressed, in order to have enough time to start the debugger (the code is downloaded using USB, I did not manage yet to do this through the Black Magic probe). Then most of the routines do not return when skipping them (F10) and some even don't allow entering them (F11). I can go (F5) and stop later if still at the beginning. But if the system is fully initialized when I debug, I get a segmentation fault. Extract:

Program
 received signal SIGINT, Interrupt.
debug_wait_loop () at ./main.c:1116
1116            if((drop & 0x02000000) == 0)

Program
 received signal SIGSEGV, Segmentation fault.
0x00015522 in ?? ()

Did I miss something obvious?
My background: I am new to ARM and particularly Nordic but 40 years of low level development, embedded, Windows device drivers and several years of BIOS, including debugger development.

Parents Reply
  • Fredcoach said:
    What do you mean by "mon reset"? 

    a debugger issued reset. 

    Fredcoach said:
    Yes, I can probably ignore the assert (do I have to intercept it to see it?), but I don't know what to do after a segmentation fault.

    Given that it stops in the address space of the softdevice, I suspect that the seg fault is actually the softdevice asserting.

    I haven't used a BMP myself, but address-wise (0x00015522); it's the SoftDevice.

     

    Kind regards,

    Håkon

Children
Related