Can't build a model locally as a C++ library even the model was build successfully on edgeimpulse deployment to target thingy:91

Question/Issue:
Local build as C++ library failed due to the following memory overflow error:
“…/zephyr_pre0.elf section bss' will not fit in region RAM’
/opt/nordic/ncs/toolchains/20d68df7e5/opt/zephyr-sdk/arm-zephyr-eabi/bin/…/lib/gcc/arm-zephyr-eabi/12.2.0/…/…/…/…/arm-zephyr-eabi/bin/ld.bfd: region `RAM’ overflowed by 28064 bytes
Any hints or recommendations on how to resolve this memory issue?

Project ID:

Context/Use case:
I trained a model and deployed successfully to Thingy:91 from the project.
When I download the model and try to build locally as a C++ library I get the following memory overflow error:
“…/zephyr_pre0.elf section bss' will not fit in region RAM’
/opt/nordic/ncs/toolchains/20d68df7e5/opt/zephyr-sdk/arm-zephyr-eabi/bin/…/lib/gcc/arm-zephyr-eabi/12.2.0/…/…/…/…/arm-zephyr-eabi/bin/ld.bfd: region `RAM’ overflowed by 28064 bytes

My model requires 241.9K.

Hi @gtsolov

The error indicates that the compiled program is too large for the available RAM on the target device. The estimation is for the model and you have run over it is very close to the capacity at 256 KB RAM which is the total, if any other services are run besides the model it will run over.

To resolve this, you can try:

  • Reducing the complexity of the model to decrease its size.
  • Optimizing the code to use memory more efficiently.

Also I don’t see any recent changes to the t91 firmware, so you should be up to date and just hitting device limitations:

Best

Eoin

1 Like