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

DFU_APP_DATA_RESERVED not working

nrf51822_AA rev3, SDK8.0.0, S110 8.0.0

My application has the max number of bonds set to 24 with a size of 128bytes each. So that's 3 pages. Plus one page for saving user/state information. So, I'd like to save a total of 4 pages when DFUing.

I set DFU_APP_DATA_RESERVED to 0x1000, but it has no effect.

I printf'ed a bunch of defines to try to figure out the problem, but I think everything looks right:

NRF_UICR_BOOT_START_ADDRESS = 0x10001014
CODE_REGION_1_START = 0x00018000
SOFTDEVICE_REGION_START = 0x00001000
BOOTLOADER_REGION_START = 0x0003C000
BOOTLOADER_SETTINGS_ADDRESS = 0x0003FC00
DFU_REGION_TOTAL_SIZE = 0x00024000
DFU_APP_DATA_RESERVED = 0x00001000
DFU_BANK_PADDING = 0x00000000
DFU_IMAGE_MAX_SIZE_FULL = 0x00023000
DFU_IMAGE_MAX_SIZE_BANKED = 0x00011800
DFU_BL_IMAGE_MAX_SIZE = 0x00003C00
DFU_BANK_0_REGION_START = 0x00018000
DFU_BANK_1_REGION_START = 0x00029800

PSTORAGE_DATA_START_ADDR = 0x0003AC00
PSTORAGE_DATA_END_ADDR = 0x0003BC00

I can read back the memory using "nrfjprog.exe --memrd 0x0003AC00 --n 4096" and I can see the bond and state information, but after DFUing it's all gone.

bootloader flash settings:
IROM1: 0x3C000 / 0x3C00
IRAM1: 0x20002000 / 0x1F80
IRAM2: 0x20003F80 / 0X80 (no init)

application flash settings:
IROM1: 0x18000 / 0x28000
IRAM1: 0x20002000 / 0x2000

Help...thanks!

Parents
  • @Chris: I assume the PSTORAGE_DATA_START_ADDR calculated to be 0x0003AC00 was the setting in your application. Note that the area from 0x3AC00 to the start address of the bootloader BOOTLOADER_REGION_START (0x3C000) is 0x1400 = 5 pages. There is 1 page extra because of the swap page. So if you simply set the DFU_APP_DATA_RESERVED = 0x1000. This may not be enough. And you first page will be erased when the bootloader erases DFU Bank 1.

    Could you try to set it to 0x1400 ?

Reply
  • @Chris: I assume the PSTORAGE_DATA_START_ADDR calculated to be 0x0003AC00 was the setting in your application. Note that the area from 0x3AC00 to the start address of the bootloader BOOTLOADER_REGION_START (0x3C000) is 0x1400 = 5 pages. There is 1 page extra because of the swap page. So if you simply set the DFU_APP_DATA_RESERVED = 0x1000. This may not be enough. And you first page will be erased when the bootloader erases DFU Bank 1.

    Could you try to set it to 0x1400 ?

Children
No Data
Related