Effect of increase in application size on data stored in flash by FDS

Hello everyone

The company I work for produces an nRF52840 based dongle.

We also have a bootloader which is a modified sdk example.

We need to save some important data in flash and we do it using FDS. 

I wanted to know in which region the FDS module stores the data?

Won't "Increase in Application Code Size" overwrite the data we store using FDS by updating the firmware through bootloader in future?

How can we make sure of that?

Parents
  • Hi,

    FDS stores data right below the bootloader (see memory layout). The number of pages used are configured by the FDS_VIRTUAL_PAGES define in the application's sdk_config.h. The default value here is 3, which maps to 3 pages, each 4 kB. You can set this to another value, but never less than 2 (as one page is needed for swapping during garbage collection).

    In order to prevent FDS data from being overwritten, the bootloader has a configuration parameter that makes it stay away from a specific number of pages below the bootloader, which is configured by the NRF_DFU_APP_DATA_AREA_SIZE define in the bootloader's sdk_config.h. This is in bytes, but it must be a multiple of a flash page size (0x1000). So if you use 3 FDS pages in your application, this should be set to 3 * 0x1000 = 12288. With this, the bootloader will never write to the three pages below the bootloader during a DFU update.

Reply
  • Hi,

    FDS stores data right below the bootloader (see memory layout). The number of pages used are configured by the FDS_VIRTUAL_PAGES define in the application's sdk_config.h. The default value here is 3, which maps to 3 pages, each 4 kB. You can set this to another value, but never less than 2 (as one page is needed for swapping during garbage collection).

    In order to prevent FDS data from being overwritten, the bootloader has a configuration parameter that makes it stay away from a specific number of pages below the bootloader, which is configured by the NRF_DFU_APP_DATA_AREA_SIZE define in the bootloader's sdk_config.h. This is in bytes, but it must be a multiple of a flash page size (0x1000). So if you use 3 FDS pages in your application, this should be set to 3 * 0x1000 = 12288. With this, the bootloader will never write to the three pages below the bootloader during a DFU update.

Children
Related