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

DFU bootloader -- region FLASH overflowed

Module: ilumi H52 BLE module (nRF52832)
SDK: nRF5_SDK_15.3.0_59ac345
Softdevice: 132_nrf52_6.1.1_softdevice.hex
Compiler: gcc version 7.3.1 20180622 (release) [ARM/embedded-7-branch revision 261907] (15:7-2018-q2-4)

My objective is to be able to update the whole flash "Over The Air".

I've compiled the secure bootloader according to "Getting started with Nordic's Secure DFU bootloader, a step by step guide" without errors.

But, as we are using the "ilumi H52 BLE" module, which contains an external power amplifier, I need to implement additional code. The additional code requires to enable GPIOTE_ENABLED and PPI_ENABLED in sdk_config.h. As a result I get the following errors from the linker:

/usr/lib/gcc/arm-none-eabi/7.3.1/../../../arm-none-eabi/bin/ld: _build/nrf52832_xxaa_s132.out section `.text' will not fit in region `FLASH'
/usr/lib/gcc/arm-none-eabi/7.3.1/../../../arm-none-eabi/bin/ld: region FLASH overflowed with .data and user data
/usr/lib/gcc/arm-none-eabi/7.3.1/../../../arm-none-eabi/bin/ld: section .mbr_params_page VMA [000000000007e000,000000000007efff] overlaps section .text VMA [0000000000078000,000000000007e28b]
/usr/lib/gcc/arm-none-eabi/7.3.1/../../../arm-none-eabi/bin/ld: section .dfu_trans VMA [000000000007e28c,000000000007e293] overlaps section .mbr_params_page VMA [000000000007e000,000000000007efff]
/usr/lib/gcc/arm-none-eabi/7.3.1/../../../arm-none-eabi/bin/ld: region `FLASH' overflowed by 748 bytes
collect2: error: ld returned 1 exit status
make: *** [/home/marc/nordic/nRF5_SDK_15.3.0_59ac345/components/toolchain/gcc/Makefile.common:294: _build/nrf52832_xxaa_s132.out] Error 1

I don't know how to solve this problem. It would be fine to get some assistance. Thank you.

Parents
  • Hi,

    You need to move the start address of the bootloader down so that you can accommodate the increased size. Since you use GCC you do this by adjusting the ORIGIN and LENGTH in the following line in the linker script (typically <SDK>\examples\dfu\secure_bootloader\pca10040_ble\armgcc\secure_bootloader_gcc_nrf52.ld):

    examples\dfu\secure_bootloader\pca10040_ble\armgcc\secure_bootloader_gcc_nrf52.ld

    You should have the memory layout in mind when you do this. Essentially the bootloader is close to the end of the flash, but you must reserve two pages after that (MBR params and bootloader settings). You also need to erase the SoftDevice before you program the bootloader again, as the bootloader .hex will contain the new bootloader start address that will be programmed at the end of the MBR page.

Reply
  • Hi,

    You need to move the start address of the bootloader down so that you can accommodate the increased size. Since you use GCC you do this by adjusting the ORIGIN and LENGTH in the following line in the linker script (typically <SDK>\examples\dfu\secure_bootloader\pca10040_ble\armgcc\secure_bootloader_gcc_nrf52.ld):

    examples\dfu\secure_bootloader\pca10040_ble\armgcc\secure_bootloader_gcc_nrf52.ld

    You should have the memory layout in mind when you do this. Essentially the bootloader is close to the end of the flash, but you must reserve two pages after that (MBR params and bootloader settings). You also need to erase the SoftDevice before you program the bootloader again, as the bootloader .hex will contain the new bootloader start address that will be programmed at the end of the MBR page.

Children
No Data
Related