nRF52820 bootloader linker settings

Hi!

I have tried to get the secure_bootloader working on the nRF52820, but I think the linker settings are not correct yet. Maybe someone here has already written a bootloader for the nRF52820 and can help me.

These are my settings for the secure_bootloader so far:

MEMORY
{
  FLASH (rx) : ORIGIN = 0x38000, LENGTH = 0x6000
  RAM (rwx) :  ORIGIN = 0x20002a38, LENGTH = 0x55c8
  uicr_bootloader_start_address (r) : ORIGIN = 0x10001014, LENGTH = 0x4
  uicr_mbr_params_page (r) : ORIGIN = 0x10001018, LENGTH = 0x4
  mbr_params_page (r) : ORIGIN = 0x0003E000, LENGTH = 0x1000
  bootloader_settings_page (r) : ORIGIN = 0x0003F000, LENGTH = 0x1000
}

My application (uses the soft device s140_7.2.0) has the following settings:

MEMORY
{
  FLASH (rx) : ORIGIN = 0x27000, LENGTH = 0x19000
  RAM (rwx) :  ORIGIN = 0x20002a38, LENGTH = 0x55c8
}

When I try to debug the bootloader I don't end up in the main.c and get an error, so I think the settings of my bootloader are not correct.

Thanks in advance

Parents
  • Hi Louis, 

    I don't see much issue with what you have in the linker script.

    Could you describe what exactly you flash to the device when testing, step by step . 
    I would suggest to test only with the softdevice + bootloader first, before you move to anything else. 
    I have made a blog here that might be useful for you to follow.

    Regarding your second question, you only generate bootloader_settings.hex if you want to flash your application together with the bootloader and the softdevice. I would not recommend doing this before you have made sure that the bootloader + softdevice is working properly (can do DFU update). Please try follow my blog. 

  • Hi Hung Bui,

    I found out why in the SoC did not jump to the right address and now I can debug the bootloader code (with softdevice S140 in flash memory).
    In your blog you do a firmware update via BLE. However, I have written firmware for a DFU over UART. Is there a similar blog?

    Since the bootloader code seems to work... can you tell me how to generate the bootloader_settings if I want to flash the application directly to the SoC using the softdevice and bootloader?

  • Hi Louis, 

    DFU over UART is very similar to DFU over BLE. It uses different bootloader and the DFU master to do DFU update. You can follow the documentation here.

    Regarding generating bootloader setting, it's also covered in my blog at this section. The documentation for it is here.

  • Hi Hung Bui,

    thank you for your reply, I'll have a look on that.

    I would like to update the firmware via a second microcontroller (STM32), is there any example code for this? I have seen unofficial code for a DFU from one nRF to a second nRF in your blog. However, I am looking for code to perform the DFU with an STM as DFU master.

Reply Children
Related