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

Linker Error in DFU on custom project

Greetings,

I am trying to create a bootloader project in VisualGDB (our IDE of choice) and GCC based off of the secure_bootloader/pca10056_s150_ble example. I was able to transfer over the project and settings, but are running into problems with the Linker.

Linker Error Messages:

VisualGDB/Debug/nRF52840_DevKit_Bootloader section `.text' will not fit in region `FLASH'
region FLASH overflowed with .data and user data nRF52840_DevKit_Bootloader
section .mbr_params_page VMA [000fe000,000fefff] overlaps section .text VMA [000f8000,000fe3cb] 
section .crypto_data VMA [000fe3cc,000fe3d3] overlaps section .mbr_params_page VMA [000fe000,000fefff]
region `FLASH' overflowed by 1076 bytes

Linker Memory Allocations (from secure_bootloader_gcc_nrf52.ld)

MEMORY
{
FLASH (rx) : ORIGIN = 0xf8000, LENGTH = 0x6000
RAM (rwx) : ORIGIN = 0x20005968, LENGTH = 0x3a698
uicr_bootloader_start_address (r) : ORIGIN = 0x10001014, LENGTH = 0x4
bootloader_settings_page (r) : ORIGIN = 0x000FF000, LENGTH = 0x1000
uicr_mbr_params_page (r) : ORIGIN = 0x10001018, LENGTH = 0x4
mbr_params_page (r) : ORIGIN = 0x000FE000, LENGTH = 0x1000
}

Other info:

SDKv16.00, S140, nRF52840 w/ PCA10056 dev board

Compiler Optimization: Minimize Size (-Os)

We haven't made any changes to the project (yet) so were expecting the size to be identical. Should we increase the FLASH region size? What would explain the overlap of .crypto_data with .mbr_params_page?

Parents
  • Hello,

    I have not used VisualGDB myself, but the linker error indicates that the bootloader code is starting to grow into the MBR params page, so it seems like the image built with  VisualGDB must be slightly bigger. Maybe it's using a different GCC toolchain release? I noticed from building the bootloader with the SDK makefile that there is little headroom for the bootloader to grow.

    Bootloader built with Makefile is already close to 0x6000 bytes

    Anyway. I think it's a good idea to try allocating more FLASH to the bootloader as you suggested.  Just rememeber that the nootloaderstart address should be aligned to a flash page boundary, so the next start address you may try is 0xf7000.

Reply
  • Hello,

    I have not used VisualGDB myself, but the linker error indicates that the bootloader code is starting to grow into the MBR params page, so it seems like the image built with  VisualGDB must be slightly bigger. Maybe it's using a different GCC toolchain release? I noticed from building the bootloader with the SDK makefile that there is little headroom for the bootloader to grow.

    Bootloader built with Makefile is already close to 0x6000 bytes

    Anyway. I think it's a good idea to try allocating more FLASH to the bootloader as you suggested.  Just rememeber that the nootloaderstart address should be aligned to a flash page boundary, so the next start address you may try is 0xf7000.

Children
Related