Topic: Memory overflow error with nRF5340


I am working with nRF5340 device and have integrated wolfSSL library into my project.
I am facing memory overflow issue when I build the project with TFM(_ns) enabled.

Below is the error message I see

zephvr/zephyr pred.elf section text' will not fit in region 'FLASH'
Region 'FLASH' overflowed by 170820 bytes

Attached my prj.conf file

All I need from the wolf library is to support TLS 1.2 with minimal code size so, please let me know the setup I need to use it for my project.

Let me know if any additional information is required.

Thank you in advance.

Post's attachments

wolf-prj.txt 1.76 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.


Re: Memory overflow error with nRF5340

Hi ajmal,

You can use our user_settings.h to disable all features which are not needed for your use case.  You can find a documented example of our common settings here: … template.h

For us to give personalized size optimization support, we would need a paid support agreement in place.  If you are interested, please let me know where you are located, and I will connect you with your region's sales rep.



Re: Memory overflow error with nRF5340

Hi kareem,

Thanks for the quick response. We will go through the document you provided.

Regarding paid support agreement, I will discuss with our team and let you know. Thank you for the support.


Re: Memory overflow error with nRF5340

Hi Kareem,

Sorry for the late response, was busy with some other high priority task.

I configured the template file as you suggested and I do not see any significant change in the build size.
Please see below memory report when I try to build the project in nRF5340 with TF-M disabled and wolfSSL enabled.

Memory region         Used Size  Region Size  %age Used
            FLASH:         362612 B     441856 B     82.07%
                RAM:           81120 B        440 KB     18.00%
         IDT_LIST:                0 GB            2 KB      0.00%

I added below line to my prj.conf file


And also I have enabled TARGET_EMBEDDED in the above template file

Please guide me if I am doing anything wrong.

Thank you in advance.