I'm using FDS together with Flash manager, and checked if everything goes alright in flash.
As per doc, I set FLASH_MANAGER_RECOVERY_PAGE_OFFSET_PAGES to FDS_PHY_PAGES.
But then, I see a gap of 2 pages between the FDS pages and the Flash manager pages.
The flash layout then becomes:
0x00000000 MBR 0x00001000 SD 0x00026000 App 0x0006C000 Flash manager 0x00070000 -- Unused -- 0x00072000 FDS 0x00076000 Bootloader 0x0007E000 MBR params 0x0007F000 Bootloader settings
So I printed out some variables:
FDS_PHY_PAGES = 4 BOOTLOADERADDR() = 0x00076000 p_flash_end = 0x00075000 mp_recovery_area = 0x00070000
To me, it looks like there are 2 faults in flash_manager_defrag.c::flash_manager_defrag_init()
/* The 52-series SoftDevice's MBR needs an extra page for bootloader and SoftDevice DFU-ing. */ p_flash_end = (flash_manager_recovery_area_t *) (BOOTLOADERADDR() - PAGE_SIZE);
A page is subtracted here, while the BOOTLOADERADDR() already takes MBR params page into account.
p_recovery_area = p_flash_end - FLASH_MANAGER_RECOVERY_PAGE_OFFSET_PAGES - 1; /* pointer arithmetic */
A page is subtracted here for no reason?
Using:
- nRF52832
- nRF5 SDK for Mesh 3.2.0
- nRF5 SDK 15.3
- SoftDevice 6.1.1