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

Error bootloader when use MBR parameter storage as application data area

Hi all,

I am using SDK 15.3 with NRF52811 chip.

My application include app + bootloader.

In my application, I use flash area from 2E000 to 2F000 for save my user data. It is MBR parameter storage. I find out that this area only use when update bootloader and SD, and I only want to update application, so I think I can use this area for save my user data.

But when I run full firmware (Bootloader + SD + Application). I have a trouble. Bootloader run to app_start function and reset, it not jump to Application. The cause seems to be due I use area flash MBR parameter storage.

__STATIC_INLINE void app_start(uint32_t vector_table_addr)

So can you show me advise. 

Thank !!!

  • Hi,

    You are right that you can avoid using the MBR params page if you don't need to update the bootloader or SoftDevice via DFU. In that case, you should make sure to not specify any MBR params page address. In SDK 15.3 this is placed at the end of the MBR page (page 0), next to where the bootloader start address is specified (MBR address is the very last word). In other SDK versions (newer and older), it is placed in UICR.  If the MBR params page address is specified, the MBR will read it and if it contains data it does not recognize, it will delete the page, so that maybe what you are seeing. You could update the project to not write the mbr_params_page to UICR or MBR.

    There is also another problem that affects this. SDK 15.3 also backs up bootloader settings to the MBR params page, and that is also something you need to remove if you want to store user data there. There is no configuration to disable this, so you need to remove it from the bootloader code.

  • Thank for reply,

    I have not read the read/write data in the bootloader.

    So in SDK 15.3, MBR params page is used for save data related to the bootloader. So when I use this area for save user data => conflic and my bootloader can't jump to application. 

    At other SDK, this infomation is saved to UCIR register.

    I understand that is correct ? Thank!

  • Giang said:
    I understand that is correct ? Thank!

    I am not sure.

    Bottom line is that if you want to use the MBR params page for application storage, then you must prevent the bootloader and MBR from using that page. Unfortunately, there is no simple configuration for doing so. To achieve this, you must:

    • modify the bootloader project to not place the MBR params address at the end of the MBR page (where it is specified).
    • remove everything related to bootloader settings backup in the bootloader, since that will make the bootloader use the MBR settings page (read, write and erase). If you incidentally write to the BL settings backup part of the MBR params page, this will make your device unbootable.
    • Modify nrf_bootloader_app_start_final() in the bootloader to not protect the MBR params page, so that it is writable from the application.
Related