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

NRF_ERROR_NO_MEM with SD_MBR_COMMAND_COPY_BL

Hello,

I'm having an issue when trying to update the bootloader itself: NRF_UICR->NRFFW[1] returns 0xFFFFFFFF, which means I can't use the MBR command to swap bootloaders (see doc).

So I have a few questions: Why is this address not set by the bootloader provided in the SDK (at least the BLE one, I found some stuff done for the ANT bootloader)?

I guess I can reproduce the method used to set NRF_UICR->NRFFW[0] (bootloader address) to set this value when programming the MCU. But can I set NRF_UICR->NRFFW[1] from the bootloader or application code?

Thanks in advance

EDIT: I found some documentation to write UICR registers here. I'll start to work on it and write about a solution here.

EDIT 2: the BOOTLOADER_MBR_PARAMS_PAGE_ADDRESS is actually defined and used in bootloader_settings.c. Two sections called mbrParamsPage and uicrMbrParamsPageAddress are used to link some space to the right address. Then my issue comes from the link script...

  • These lines were not in the linker script:

    MEMORY
    {
      [...]
    
      /** Location of mbr params page in flash. */
      MBR_PARAMS_PAGE (rw) : ORIGIN = 0x0007E000, LENGTH = 0x1000
      
      /** Location in UICR where mbr params page address is stored. */
      UICR_MBR_PARAM_PAGE(r) : ORIGIN = 0x10001018, LENGTH = 0x04
    }
    
    SECTIONS
    {
      [...]
       
      /* Place the mbr params page in flash. */
        .mbrParamsPage(NOLOAD) :
      {
        
      } > MBR_PARAMS_PAGE
      
      /* Write the bootloader address in UICR. */
      .uicrMbrParamsPageAddress :
      {
        KEEP(*(.uicrMbrParamsPageAddress))
      } > UICR_MBR_PARAM_PAGE
    }
    
Related