Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Why is the value of NRF_DFU_APP_DATA_AREA_SIZE 8192 bytes on the nRF5281x?

I want to use bootloader for nRF52811.

On nRF5 SDK 17,

exmaples/dfu/secure_bootloader/pca10056e_s112_ble/config/sdk_config.h
  #define NRF_DFU_APP_DATA_AREA_SIZE 8192

But,
exmaples/dfu/secure_bootloader/pca10056_s140_ble/config/sdk_config.h
  #define NRF_DFU_APP_DATA_AREA_SIZE 12288

I use FDS in my application. (3pages flash)

Should I change the value of NRF_DFU_APP_DATA_AREA_SIZE from 8192 to 12288?

Why is it 8192 bytes instead of 12288 in nRF52811?

Parents
  • Hi,

    Isolated, there is no right or wrong value of NRF_DFU_APP_DATA_AREA_SIZE, as long as it is a multiple of a flash page size in bytes. The only thing that decides which value you should set NRF_DFU_APP_DATA_AREA_SIZE in the bootloader's sdk_config.h file to is how many pages you use for application data (FDS and/or other). If you use 3 pages for application data (FDS) in your case, then you must set NRF_DFU_APP_DATA_AREA_SIZE to 1024 words * 4 bytes per word * 3 pages = 12288 bytes. If you set a higher value than needed, then you may not be able to perform DFU even though there is actually enough room. And if you set a lower value you risk corrupting the application data during a DFU update, as the bootloader may use the flash area.

    If you only need a single FDS page for data storage and one for swap, then you can keep NRF_DFU_APP_DATA_AREA_SIZE as 8192 in the bootloader sdk_config.h and set FDS_VIRTUAL_PAGES to 2 in the application's sdk_config.h. If you need two data pages of FDS, then you need to set NRF_DFU_APP_DATA_AREA_SIZE to 12288 instead, and FDS_VIRTUAL_PAGES to 3 (or higher numbers if you need it, though you will soon run out of flash on the nRF5281x devices).

  • Thanks.

    This means that if your application has FDS_VIRTUAL_PAGES set to 3, then NRF_DFU_APP_DATA_AREA_SIZE must be set to 12288 or higher, regardless of nRF52811 / nRF52832?

  • Yes, that is the case. This has no dependency on the IC variant (other the practical issue than that the number of available flash pages is quite small on the nRF52811).

Reply Children
No Data
Related