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

Open bootloader to Secure bootloader DFU origin address change

Hi NRF team,

I was attempting an update from the open USB serial bootloader to a secure USB bootloader when I hit this issue.

from Open bootloader linker script:

MEMORY
{
FLASH (rx) : ORIGIN = 0xe0000, LENGTH = 0x1e000
RAM (rwx) : ORIGIN = 0x20000008, LENGTH = 0x3fff8
uicr_bootloader_start_address (r) : ORIGIN = 0x10001014, LENGTH = 0x4
mbr_params_page (r) : ORIGIN = 0x000FE000, LENGTH = 0x1000
bootloader_settings_page (r) : ORIGIN = 0x000FF000, LENGTH = 0x1000
uicr_mbr_params_page (r) : ORIGIN = 0x10001018, LENGTH = 0x4
}

from Secure bootloader linker script:

MEMORY
{
FLASH (rx) : ORIGIN = 0xf4000, LENGTH = 0xa000
RAM (rwx) : ORIGIN = 0x20000008, LENGTH = 0x3fff8
uicr_bootloader_start_address (r) : ORIGIN = 0x10001014, LENGTH = 0x4
mbr_params_page (r) : ORIGIN = 0x000FE000, LENGTH = 0x1000
bootloader_settings_page (r) : ORIGIN = 0x000FF000, LENGTH = 0x1000
uicr_mbr_params_page (r) : ORIGIN = 0x10001018, LENGTH = 0x4
}

I see that this update completes successfully. However the updated bootloader doesn't boot correctly (While no application is programmed, device doesn't enter DFU mode).

When I match the origin address for the secure bootloader with 0xe0000 (origin address in the already programmed open bootloader), this works and the device enters DFU mode as expected. Could anyone help me understand what could be wrong with the relocation of the DFU bootloader.

I think this is in some sense imitating our planned manufacturing process where the default open bootloader will be replaced with a secure bootloader with a potentially different start address and size.

Please note that I'm using SDK v 15.2.0 in my experiments.

Warm regards,

Ananth

Parents
  • Could anyone help me understand what could be wrong with the relocation of the DFU bootloader.

    The bootloader update process won't touch UICR. This means you cannot update to a bootloader with a different start address (FLASH ORIGIN in the linker script).

    Trying to erase UICR during  OTA bootloader updates could potentially brick the device unless your customers have an SWD programmer.

    Changing the bootloader start address should be done via SWD only, and may require a full chip erase (on NRF51xxx IIRC).

Reply
  • Could anyone help me understand what could be wrong with the relocation of the DFU bootloader.

    The bootloader update process won't touch UICR. This means you cannot update to a bootloader with a different start address (FLASH ORIGIN in the linker script).

    Trying to erase UICR during  OTA bootloader updates could potentially brick the device unless your customers have an SWD programmer.

    Changing the bootloader start address should be done via SWD only, and may require a full chip erase (on NRF51xxx IIRC).

Children
Related