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

why app preserved data are lost after DFU

I configured the bootloader to preserve one page of data ( I configured #define DFU_APP_DATA_RESERVED 0x400 on the bootloader project

I also made the same thing with my project code

my userdata are located on the page above the bootlaoder (0x0003BC00). I can read the flash and see that my data are stored. but when I perform DFU, I lose them

here the flash memory dump

what could be the issue (im using softdevice 8.0, SDK 10, nrf51822)

Parents
  • The CODE_PAGE_SIZE should not be changed from the default value of 0x400. This is the actaul page size for the flash implementation we have on the 51. Please see "preserving application data" for instruction on how preserve app data when doing DFU.

    If you're using pstorage you will also have to account for the swap page that resides on the flash page just below the start address of the bootlaoder. I.e., reserve at least two pages. More details on how the memory allocation with pstorage works can be found here.

Reply
  • The CODE_PAGE_SIZE should not be changed from the default value of 0x400. This is the actaul page size for the flash implementation we have on the 51. Please see "preserving application data" for instruction on how preserve app data when doing DFU.

    If you're using pstorage you will also have to account for the swap page that resides on the flash page just below the start address of the bootlaoder. I.e., reserve at least two pages. More details on how the memory allocation with pstorage works can be found here.

Children
Related