Master boot record

Hi,

I am developing using the SoftDevice s140 7.2.0.

I am trying to use the MBR function sd_mbr_command() to upgrade my bootloader with command SD_MBR_COMMAND_COPY_BL.

The bootloader occupies the address range 0xf8000-0xfdfff, so the length is 0x6000 bytes. The initialization of the copy_bl_t component of the command structure is:

- bl_src pointing to a RAM buffer containing the new bootloader

- bl_len = 0x6000/sizeof(uint32_t) = 0x1800.

I have set the UICR_NWF[0] = 0xf8000 (bootloader_address) and UICR_NWF[1] = 0xfe0000 (mbr_params_page_address). When calling sd_mbr_command(), I get the error code 9 (NRF_ERROR_INVALID_LENGTH). What could be wrong? What is the valid range for the bl_len parameter?

Regards

  Dirk

Related