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

NRF52 Bootloader - Application Data Preserve

Hi,

I am using NRF52832 with secure bootloader to OTA my application in the field using Dual Bank updates and everything is working fine. In my application, I am using FDS library with 12 pages (48kb) reserved for my application data. 

I was going through the bootloader code and noticed that at some point I had set 

DFU_APP_DATA_RESERVED               (CODE_PAGE_SIZE * 0)

That would mean my FDS data should not be preserved after an OTA update. However with test I found that it definitely is being preserved. 

Confused, I look through the bootloader code, specifically where it checks the flash for space and allocates data for the new image in the function nrf_dfu_cache_prepare. From what I understood, this function does not actually delete the content of Bank 1. It simply overwrites it's content with the new image data. Since my new image size is small enough, my FDS data is not touched (but eventually will be when my new image size if big enough). 

Here is the logging information from this function

required_size: 0x199F0.
single_bank: F.
keep_app: T.
keep_softdevice: T.
SD_PRESENT: T.
Bank contents:
Bank 0 code: 0x01: Size: 0x18F30
Bank 1 code: 0x00: Size: 0x0
pass: 0.
cache add: 0x3F000.
cache_too_small: F.
keep_firmware: T.
delete_more: F.

Can someone confirm that what I have understood is correct?

Parents Reply Children
No Data
Related