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!