Flash overflow in nrf5340-nrf7002


I'm currently working on implementing OpenThread on our custom board based on the nRF5340 along with the nRF7002. While building the project, I'm encountering the following build error:

  "section `rodata' will not fit in region 'FLASH'"
  "region `FLASH' overflowed"
This seems to indicate that the application is exceeding the internal flash limits. I’ve already tried disabling optional OpenThread features, but I still see a large `.rodata` footprint.
Could you please advise on best practices to reduce OpenThread’s memory usage in this configuration, especially while retaining support for the peripheral role?

Additionally, is there an officially supported way to move some of the OpenThread data or code into external flash on the nRF5340? If so, a reference or example would be greatly appreciated.

ERROR LOG
c:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr\zephyr_pre0.elf section `rodata' will not fit in region `FLASH'
c:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: region `FLASH' overflowed by 167144 bytes

Memory region         Used Size  Region Size  %age Used
           FLASH:      784948 B     892416 B     87.96%
             RAM:      403260 B       440 KB     89.50%
        IDT_LIST:          0 GB        32 KB      0.00%

Parents Reply
  • When we started development, NCS v2.6.2 was the latest available version, and our application was built and finalized using this version. The project is now in the production stage, so upgrading the SDK at this point could introduce delays due to the need for regression testing and validation. That’s why we are currently staying on v2.6.2.

    However, for future development or if we plan to update the project, we will evaluate compatibility with the latest SDK version. We understand that changes introduced in NCS, so we’ll make sure to review the migration documentation and check for any required updates to APIs or configuration settings.

    As we prepare for potential migration, we would like to clarify the following:

    1. What are the recommended steps for upgrading an existing application from NCS 2.6.2 to the latest version (e.g., NCS 3.x)?

      • Are there structured guidelines or tools to help transition to newer features like Sysbuild and HW model 2?

      • What should we watch out for in terms of API/configuration updates, board definitions, or system changes?

    In the current version (NCS 2.6.2), are there any known methods or best practices to reduce flash usage?

    • We are looking to optimize flash consumption

Children
Related