This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DFU not preserving app data

Hi all, I have made some modifications to the bootloader example project (dfu_dual_bank_ble, s110) to get a bootloader that meets my requirements. It is working ok, I can upgrade the firmware over the air but application data does not get preserved. In the bootloader project I have made this change:

#define DFU_APP_DATA_RESERVED 0x0400

So to my understanding 1K of flash destinated to the application data should be preserved when upgrading.

The app that gets upgraded just uses 32B of flash to store the device name but everytime that I do an OTA upgrade the device name gets erased. What is it failing here? In the app I do the saving properly because the name is preserved across power cycles.

Thanks in advance

Regards

Parents
  • Alright, solved. My mistake. The size I was reserving in the bootloader (DFU_APP_DATA_RESERVED=0x400) didn't match the size I was reserving in the application through pstorage_init.h: I was reserving 2048B (PSTORAGE_MAX_APPLICATIONS=2) and I was telling the bootloader to preserver just one page. I have changed DFU_APP_DATA_RESERVED and everything is working ok.

    Best regards

Reply
  • Alright, solved. My mistake. The size I was reserving in the bootloader (DFU_APP_DATA_RESERVED=0x400) didn't match the size I was reserving in the application through pstorage_init.h: I was reserving 2048B (PSTORAGE_MAX_APPLICATIONS=2) and I was telling the bootloader to preserver just one page. I have changed DFU_APP_DATA_RESERVED and everything is working ok.

    Best regards

Children
No Data
Related