nrf7002dk - region `FLASH' overflowed

Hi,

I am trying to create a Wi-Fi application on nrf7002dk using SMP over Bluetooth LE for Firmware Updates, but I get a "region 'FLASH' overflowed" error when I try to build the project:

[1/11] Linking C executable zephyr\zephyr_pre0.elf
FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map 
c:/nordicsemi/toolchains/v2.3.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/../../../../arm-zephyr-eabi/bin/ld.exe: zephyr\zephyr_pre0.elf section `rodata' will not fit in region `FLASH'
c:/nordicsemi/toolchains/v2.3.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/../../../../arm-zephyr-eabi/bin/ld.exe: region `FLASH' overflowed by 1424 bytes
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
[115/263] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/C_/nordicsemi/v2.3.0/modules/hal/nordic/nrfx/drivers/src/nrfx_gpiote.c.obj
FAILED: modules/mcuboot/mcuboot_subimage-prefix/src/mcuboot_subimage-stamp/mcuboot_subimage-build mcuboot/zephyr/zephyr.hex mcuboot/zephyr/zephyr.elf 

Is there any option to reduce the project's size? I have already disabled the debug options.

Regards,

Candela

Parents Reply Children
  • Hi,

    I will continue to help with this case.

    Can you upload your full build log as a .txt file?

    Are you able to reproduce the issue if you add MCUboot to any of our samples?

    Regards,
    Sigurd Hellesvik

  • Hi Sigurd,

    I'm attaching the complete build log with the Flash overflowed error, you can find it on this link

    On the other hand, yes, I can reproduce the issue adding these three configurations to the smp_svr sample:

    CONFIG_WIFI=y
    CONFIG_WIFI_NRF700X=y
    CONFIG_WPA_SUPP=y

    Best regards,

    Candela

  • Hi,

    Enabling an SMP Server will split your available flash into two, effectively reducing available flash by half.
    This is likely why you experience flash limitation errors.

    To solve this, you got two options:

    1. Reduce/optimize flash usage. See Memory footprint optimization, and disable features you do not need.
    2. Add external flash. See External flash memory partitions. Remember to add this for the mcuboot child image as well

    Regards,
    Sigurd Hellesvik

  • Hi,

    I followed your recommendations, optimizing flash usage and using an external flash, and I got to reduce significativelly the flash usage. Nevertheless, I still have questions on how to add the mcuboot child image on the external flash. By now, I have used the partition manager to set the mcuboot_secondary region into the external flash, but I still have no enough space for the bootloader and the application on the primary flash. Do I need to move any other region to the external flash?

    I am attaching the output partition manager report.

      external_flash (0x800000 - 8192kB):
    +---------------------------------------------+
    | 0x0: mcuboot_secondary (0xf4000 - 976kB)    |
    | 0xf4000: external_flash (0x70c000 - 7216kB) |
    +---------------------------------------------+
    
      flash_primary (0x100000 - 1024kB):
    +-------------------------------------------------+
    | 0x0: mcuboot (0xc000 - 48kB)                    |
    +---0xc000: mcuboot_primary (0xf4000 - 976kB)-----+
    | 0xc000: mcuboot_pad (0x200 - 512B)              |
    +---0xc200: mcuboot_primary_app (0xf3e00 - 975kB)-+
    | 0xc200: app (0xf3e00 - 975kB)                   |
    +-------------------------------------------------+
    
      otp (0x2fc - 764B):
    +------------------------------+
    | 0xff8100: otp (0x2fc - 764B) |
    +------------------------------+
    
      sram_primary (0x80000 - 512kB):
    +-----------------------------------------------+
    | 0x20000000: pcd_sram (0x2000 - 8kB)           |
    | 0x20002000: sram_primary (0x6e000 - 440kB)    |
    | 0x20070000: rpmsg_nrf53_sram (0x10000 - 64kB) |
    +-----------------------------------------------+
    
     CPUNET flash_primary (0x40000 - 256kB):
    +--------------------------------------------+
    +---0x1000000: b0n_container (0x8800 - 34kB)-+
    | 0x1000000: b0n (0x8580 - 33kB)             |
    | 0x1008580: provision (0x280 - 640B)        |
    +---0x1008800: app (0x37800 - 222kB)---------+
    | 0x1008800: hci_rpmsg (0x37800 - 222kB)     |
    +--------------------------------------------+
    
     CPUNET sram_primary (0x10000 - 64kB):
    +-------------------------------------------+
    | 0x21000000: sram_primary (0x10000 - 64kB) |
    +-------------------------------------------+

    Thanks!

    Candela

  • Candela said:
    but I still have no enough space for the bootloader and the application on the primary flash.

    Can you post the build log showing this?

Related