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

FDS_ERR_NO_PAGES in fds_init() with DFU

Hello,

I am using SDK16, Softdevice S140 with SES.

I am trying to add DFU functionality in my application and leaving only the activation of the new firmware to secure bootloader(which I achieved by excluding "nrf_dfu.c" and making NRF_BL_DFU_ALLOW_UPDATE_FROM_APP 1).

I also have these defines in bootloader:

#define NRF_DFU_APP_DATA_AREA_SIZE 12288(in sdk_config.h)

#define DFU_APP_DATA_RESERVED      NRF_DFU_APP_DATA_AREA_SIZE (in nrf_dfu_types.h)

In application:


#define FDS_VIRTUAL_PAGES 3
#define FDS_VIRTUAL_PAGE_SIZE 1024
#define FDS_VIRTUAL_PAGES_RESERVED 0

When I ran application, The error came FDS_ERR_NO_PAGES(pm_init --> pds_init --> fds_init). The reason I found that the start address for FDS pages came wrong(it came 0xfb000) because bootloader address(it came 0xffffffff) was not set(It should be in UICR register). I am not sure but I guess my mistake was - I first programmed Bootloader and then the application which erased the UICR.

So, I used mergehex but then it gave error "The hex files cannot be merged since there are conflicts."

My settings are:

In application:

FLASH_PH_START=0x0

FLASH_PH_SIZE=0x100000

RAM_PH_START=0x20000000

RAM_PH_SIZE=0x40000

FLASH_START=0x27000

FLASH_SIZE=0xca000

RAM_START=0x20003910

RAM_SIZE=0x3c6f0

In Bootloader:

FLASH_PH_START=0x0

FLASH_PH_SIZE=0x100000

RAM_PH_START=0x20000000

RAM_PH_SIZE=0x40000

FLASH_START=0xf1000

FLASH_SIZE=0xd000

RAM_START=0x20005968

RAM_SIZE=0x3a698

(The flash area for bootloader starts where the area of application ends!)

I have set linker->memory segment as below for the bootloader as well as the application:

FLASH RX 0x0 0x100000;RAM RWX 0x20000000 0x40000;uicr_bootloader_start_address RX 0x10001014 0x4;bootloader_settings_page RX 0x000FF000 0x1000;uicr_mbr_params_page RX 0x10001018 0x4;mbr_params_page RX 0x000FE000 0x1000

I am not sure whether these settings are correct or not.

Kindly guide me through. Thank you!

  • Yes, if you are reserving the bootloader setting in your application you will see that error of overlapping. But by default there isn't any data should be put into that setting page in compile time. So the area should not be included in the hex file. Please check the bootloader hex file (you can use nrf Connect programmer tool to check). Only after you flash the bootloader and after the bootloader run, then the bootloader setting will be written. If you simply combine the hexes, or don't let the bootloader to run, the bootloader setting is remains blank. 


    You are trying to do something a little bit more advanced (integrate DFU into your application). I would suggest you to go step by step. 

    First get familiar with how you can generate bootloader setting (by using nrfutil) and combine it with the application so that it would accept the bootloader  + application + bootloader setting combined. 

    After you get that working, start to implement DFU in your application, but keep checking to avoid that the UICR being erased. 

Related