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

Secure DFU, Should you use fstorage or nrf_dfu_flash

Within a buttonless DFU application should nrf_dfu_flash or fstorage be used to erase and write to flash?

SDK 13.0.0 - Soft device s132_nrf52_4.0.2_softdevice running on a nRF52832.

I want to store device specific information (like Serial Number) in flash that the DFU update will not erase. I am following the default DFU memory layout and want to place this information at the end of the application area. DFU_APP_DATA_RESERVED is set to CODE_PAGE_SIZE * 3. My understanding is that this setting will cause the DFU to no erase the last 3 pages of the application area.

Parents
  • Hi,

    That configuration instructs the bootloader to not erase some flash pages which are used by the Peer Manager to store bond information. Thus, the application can retain bond data after a DFU. If you write to that area using fstorage you might end up corrupting the fds data.

    In short:

    • If you don't use Peer Manager, you can use that area as you wish.
    • If use Peer Manager, increase DFU_APP_DATA_RESERVED to include more one flash page and write your data there.
Reply
  • Hi,

    That configuration instructs the bootloader to not erase some flash pages which are used by the Peer Manager to store bond information. Thus, the application can retain bond data after a DFU. If you write to that area using fstorage you might end up corrupting the fds data.

    In short:

    • If you don't use Peer Manager, you can use that area as you wish.
    • If use Peer Manager, increase DFU_APP_DATA_RESERVED to include more one flash page and write your data there.
Children
No Data
Related