Matter light bulb does not fit in FLASH

When building the Matter Light Bulb sample application for the nRF52840 fails with:

/opt/nordic/ncs/toolchains/v2.1.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/zephyr_pre0.elf section `rodata' will not fit in region `FLASH'
/opt/nordic/ncs/toolchains/v2.1.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/../../../../arm-zephyr-eabi/bin/ld.bfd: region `FLASH' overflowed by 29964 bytes
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /opt/nordic/ncs/toolchains/v2.1.0/bin/cmake --build /Users/allencurtis/Documents/Work/KareTrax/light_bulb/build

Parents Reply
  • Hi,

    Matter applications are very large, so this is not out of the ordinary. The Matter libraries take up a lot of space, and you also have OpenThread, Bluetooth, the application itself, and other modules. However, there are ways to optimize the application for ROM and RAM footprint. If you follow the Memory footprint optimization guide, both the general recommendations and for specific subsystems, then you should be able to reduce the size. I have not tested in nRF Connect SDK v2.x.x, so the size might differ somewhat, but I have been able to get the application down to around 700 kB using this.

    Best regards,

    Marte

Children
No Data
Related