Dear All
We implement a DFU over USB functionality to the custom board nrf52840 board by compiling via gcc. Somehow there is my understanding problem with the linker for bootloader and app. Here is the important part of the secure_bootloader.ld linker file for the bootloader:
MEMORY { FLASH (rx) : ORIGIN = 0xf4000, LENGTH = 0xa000 RAM (rwx) : ORIGIN = 0x20000008, LENGTH = 0x3fff8 uicr_bootloader_start_address (r) : ORIGIN = 0x00000FF8, LENGTH = 0x4 bootloader_settings_page (r) : ORIGIN = 0x000FF000, LENGTH = 0x1000 uicr_mbr_params_page (r) : ORIGIN = 0x00000FFC, LENGTH = 0x4 mbr_params_page (r) : ORIGIN = 0x000FE000, LENGTH = 0x1000 }
and here is the generic_gcc_nrf52.ld linker file's part for the memory:
MEMORY { FLASH (rx) : ORIGIN = 0x26000, LENGTH = 0xca000 RAM (rwx) : ORIGIN = 0x20002220, LENGTH = 0x3dde0 uicr_bootloader_start_address (r) : ORIGIN = 0x00000FF8, LENGTH = 0x4 }
All compiles well and mergehex complains that I am overlapping some regions. Clearly I have a lack of understanding, how to create the linker file, as I am trying to sort it out by looking at the examples and reading the blogs. I am using SDK 15.0.0. Here is my confusion and following some questions:
1. According to the memory map, MBR starts at 0, is the statement correct: mbr_params_page (r) : ORIGIN = 0x000FE000, LENGTH = 0x1000
2. Is including in the app linker file: uicr_bootloader_start_address (r) : ORIGIN = 0x00000FF8, LENGTH = 0x4 immportant?
3. Bootloader and settings are as follows:
Bootloader DFU Settings:
* File: bootsettings.hex
* Family: NRF52840
* Start Address: 0x000FF000
* CRC: 0x5593BD4D
* Settings Version: 0x00000001 (1)
* App Version: 0x00000002 (2)
* Bootloader Version: 0x00000001 (1)
* Bank Layout: 0x00000000
* Current Bank: 0x00000000
* Application Size: 0x0002785C (161884 bytes)
* Application CRC: 0x55A80F33
* Bank0 Bank Code: 0x00000001
* Softdevice Size: 0x00000000 (0 bytes)
* Boot Validation CRC: 0x00000000
* SD Boot Validation Type: 0x00000000 (0)
* App Boot Validation Type: 0x00000000 (0)
Any idea why the mergehex complains about possible region overlapping when app and bootloader (and settings) are merged?
4. What are the changes regarding DFU and bootloader from 15.0 to 15.3, would changing to 15.3 resolve these issues?
Best, Emek