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

secure bootloader preserve custom data in flash during DFU

I noticed that the secure bootloader by default protects bond information during FOTA. In earlier SDK versions there was something called preserved pages right below the bootloader in memory but I can't find it in SDK v15.1. 

How do I preserve my custom data during FOTA?

Parents Reply
  • Hi,

    The size of each bond can varya byt, but a typical bond with one CCCD requires 38 words (152 bytes). This means that you need at least 3 FDS virtual pages (assuming 1024 words per page) for data in order to get abot 80 bonds, so you need to set 4 in total. If you need to store additional data (you wrote 2 pages), then it totals to 6 pages.

    To achieve this, set FDS_VIRTUAL_PAGES in the projects sdk_config.h to 6 and set DFU_APP_DATA_RESERVED in nrf_dfu_types.h to resolve 6 pages as well (so that the bootloader stays away).

Children
No Data
Related