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%