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

Download and debug application using SES in the presence of bootloader

Hello, guys!

We are using SDK 15.0.0 and nRF52840 SoC device.

Our goal is to debug the application with SES in the presence of bootloader. This thread explains that we need to:

  1. merge bootloader and bootloader settings .hex files into a single .hex file
  2. flash that single .hex into nRF52840 device by the help of nrfjprog tool
  3. Apply Debug->Go from SES to debug the application.

We were able to successfully finish steps 1 and 2. However, here is what we get after flashing merged .hex file into nRF52840 device:

What is flashed seems not to be equal to merged .hex file. Consequently, we are unable to debug application from SES.

Do you have any idea what we are missing here?

Here is the set of commands we apply:

## To generate bootloader settings:
nrfutil settings generate --family NRF52840 --application application.hex --application-version 1 --bootloader-version 1 --bl-settings-version 1 bootloader_settings.hex

## To merge .hex files:
mergehex --merge bootloader.hex bootloader_settings.hex --output bootloader_with_settings.hex

## To flash merged .hex file:
nrfjprog --program bootloader_with_settings.hex -f nrf52 --sectoranduicrerase 
nrfjprog --reset -f nrf52	

Thanks in advance for your time and efforts!

Sincerely,

Bojan

Parents Reply Children
  • Hello SK.

    Thanks for the useful link. It is now clear about Flash and RAM. However, I still don't know how can I adjust the bootloader, MBR, bootloader settings parameters in secure_bootloader_gcc_nrf52.ld file that comes with dfu example.

    For example, when I compile secure_bootloader_ble_s140_pca10056 example and load the .hex file nto nRF Programmer tool here is what I get:

    Bootloader is not seen as a bootloader but as application. This is the appropriate content of secure_bootloader_gcc_nrf52.ld file

    MEMORY
    {
      FLASH (rx) : ORIGIN = 0xf8000, LENGTH = 0x6000
      RAM (rwx) :  ORIGIN = 0x20002a98, LENGTH = 0x3d568
      uicr_bootloader_start_address (r) : ORIGIN = 0x00000FF8, LENGTH = 0x4
      bootloader_settings_page (r) : ORIGIN = 0x000FF000, LENGTH = 0x1000
      uicr_mbr_params_page (r) : ORIGIN = 0x00000FFC, LENGTH = 0x4
      mbr_params_page (r) : ORIGIN = 0x000FE000, LENGTH = 0x1000
    }

    Should I adjust some more parameter in order to properly load bootloader?

    Thanks in advance.

    Bojan.

  • Hi Bojan,

    The fact that nRF Connect Programmer shows the bootloader as "Application" in this case, is just an issue in how it presents it. This is not a problem and there is nothing you can do about it.

    What is the real problem, and what is it you want to achieve?

  • Hey, Einar.

    Indeed, it seems it is not a problem. I respected the steps suggested by SK and now everything is OK. I will close this topic not.

    Thanks for your readiness to help though!

    Regards,

    Bojan.

Related