Sample smp_svr on NRF52840 dongle: .text does not fit in FLASH

Hi,

I am trying to evaluate the provided smp_svr sample with the BLE DFU on the NRF52840 dongle after I have already tested it on the DK.

I get the following error message during the build: zephyr/zephyr_pre0.elf section `text' will not fit in region `FLASH'. Region `FLASH' overflowed by 10876 bytes. I assume the reason for it is the bootloader that is required for flashing the dongle. What do I have to do to get it work on the dongle?

Thank you!

Elias

  • Hello Elias,

    Since the dongle has a bootloader and MBR from the nRF5 SDK, it means that the flash addresses from 0x00000000 -> 0x00001000, and a chunk at the end (don't remember the address by heart, but this is the old bootloader, and it is located at the "top" of the flash) is already occupied, and you can't remove them.

    Since the mcuboot bootloader from NCS is usually placed on 0x00000000, this will collide with the nRF5 MBR. Therefore, the board files say that you need to stay away from 0x00000000 -> 0x10000000, and it will. The problem however, is that it then tries to fit the bootloader into 0x00001000 -> 0x0000c000, which is a bit too small. Add this to your smp_svr\child_image\mcuboot.conf:

    CONFIG_PM_PARTITION_SIZE_MCUBOOT=0x10000

    This will increase the size of the MCUBOOT parition, so that it can still fit the bootloader even though it doesn't touch the MBR from the nRF5 SDK.

    Best regards,

    Edvin

Related