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

DFU of App Data section

SDK14.0.0 nRF52832 s132

I would like to DFU the contents of the App Data section. In particular, I would like to erase the contents for a "factory reset" command.

I've tried creating a separate DFU package that just contains 0xff in addresses 0x74000..0x78000. However, there is no way to specify a "data" DFU package. If I create an application DFU package, then the entire application is erased, and the 0xffs that were intended for 0x74000 are written to 0x23000 instead.

One way I think will work is to increase the size of the application so that it includes addresses up to 0x78000. However, this method adds a lot of time to the DFU process. Is there another way?

Parents
  • If you have a look here, you can find that by default the application data reserved is 3 pages. If you set DFU_APP_DATA_RESERVED to 0, the application data should be erase.

  • So you meant you want a special DFU update that will do "factory reset" when normal DFU update will keep the DFU_APP_DATA_RESERVED ?

    Correct.

    I would suggest to either modify the bootloader to erase the region when you receive the "factory reset" command, or if you don't want to modify the bootloader, you can have some code in your application that can erase the region before you switch to bootloader (assume you have buttonless DFU) .

    Thanks. I'd prefer that the functionality wasn't in the application (in case the app data contents cause the application to behave unexpectedly). That leaves updating the bootloader.

Reply
  • So you meant you want a special DFU update that will do "factory reset" when normal DFU update will keep the DFU_APP_DATA_RESERVED ?

    Correct.

    I would suggest to either modify the bootloader to erase the region when you receive the "factory reset" command, or if you don't want to modify the bootloader, you can have some code in your application that can erase the region before you switch to bootloader (assume you have buttonless DFU) .

    Thanks. I'd prefer that the functionality wasn't in the application (in case the app data contents cause the application to behave unexpectedly). That leaves updating the bootloader.

Children
No Data
Related