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

Protect NVM from being overwritten during reflash

I'm using the pstorage driver on the nRF51 to maintain several NVM variables. The NVM functions correctly and maintains state between power cycles. However, when I reflash the device using OTA reflash (application only, not SoftDevice), all of my NVM variables are reset to 0xFF. How do I prevent reflashing from modifying my NVM variables?

This is the command line I'm using to generate the zip file used for OTA reflash -

nrfutil dfu genpkg myProgram.zip --application myProgram.hex --application-version 0xffff --dev-revision 0xffff --dev-type 0xffff --sd-req 0xfffe

Thanks

Brian

Parents Reply
  • FormerMember
    0 FormerMember in reply to FormerMember

    The principle of dual bank update is that there has to be enough available free space for what you want to update. So yes, if there is not enough space for a new bootloader and a new application at the same time, they will have to be updated in two separate steps. First bootloader and then the application would be the best.

    DFU_APP_DATA_RESERVED is just a size, so the start address for the bootloader will still be the same. Note: If using pstorage and reserving 0x400, 0x400 will only correspond to the swap page in pstorage, see more in this post.

    Regarding DFU_APP_DATA_RESERVED, I would recommend you to take a look at this post.

Children
No Data
Related