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

SES Debugging the bootloader

I need to know how to set up the SES debugger to continue debugging when the program jumps from application into the bootloader.

nRF52832 SDK v15.3

Using the following code to jump to the bootloader:

    // Write to the register and reset the device
    NRF_POWER->GPREGRET = BOOTLOADER_DFU_START;
    nrf_delay_ms(500);
    NVIC_SystemReset();

Currently once it reaches the reset, the debugger crashes.

Parents
  • Hello,

    I don't think you can debug both the bootloader and the application at the same time, since they are two projects, with two different output files.

    However it is possible to debug the bootloader. In SES, just click "Target"->"Attach Debugger", and it will start when the nRF hits the bootloader. However, as mentioned, you can't have a separate SES window debugging the application at the same time. You need to choose. But only the bootloader or the application will be running at one point in time, so it should be perfectly possible to debug the bootloader project using this approach.

    NB: When you are dealing with bootloaders, don't use "build and run" or "build and debug", because this will upload a slightly different hex file to the nRF, which will generate a different CRC for the application and bootloader. Hence, just use "Attach debugger", and it should work.

    Best regards,

    Edvin

  • Hello Edvin,

      I tried what you suggested - just 'Target'->"Attach Debugger" in the bootloader.

    It seems to reach the bootloader but immediately crashes in the debug window.

Reply Children
Related