I am developing a solution in which based on the PN7462 NFC solution. Now as per my requirement. I have created a lib(.a) file which for internal API which we don't want to provide to the third party. Now if I develop all the code in a single project it works fine. But after creating lib of all the APIs and creating another project for application code I am unable to run the project it hits "void vApplicationMallocFailedHook( void )" every time. I have checked that firmware goes to scheduler start but it does not enter the thread. I have looked into some thread and it could be the issue of linker file but I am unable to find a solution. I am attaching screenshots for MCU Linker and default linker file. I have checked with default LPC expresso style
Any help would be helpful.
Solved! Go to Solution.
As this is a library is has also to do with how the compiler manages it well as you application code
Please , check this post and verify if this helps you
You can try checking this
To verify if this works for your purposes, still you will need to test it and verify that it works as intended when implementing in your code.
Hope this helps.
Thanks, @estephania_mart for the response.
I think the issue is not because if NxpNfcRdLib As if trying to build a program using only application code.
Let me tell you something about my project first it was one project. Which works fine and it uses utilizes SRAM 3180bytes as shown in the image.
Now I want to create an application project which is built on my project. So this can be achieved if I create a static library of the project. Now I have two projects one is lib and another is application. Now the first step would be to create static lib of my project and call API from the application project as required. But this increases size SRAM size by 5kb. Code size is not the issue here. Please look at the attached image below.
I have attached a partial build log of the lib project. Where heap_2.o contains a very large portion of bss. Other files(which are removed from a text file) does not contain much of the bss.
I think heap_2.c is using 5kb of SRAM what could be the reason?
Thanks for the reply.
As it turns out I am able to build library combining all the source code freeRTOS and my code. And it is working. But now I have realized that the size of utilized SRAM is increased by around 5kb while I was using only application code.
As I looked into the building of lib it turns out heap_2.o the file uses 5120bytes of bss which turns out saved on SRAM. While using the same code without creating lib SRAM utilized is very less.
How can reduce this SRAM utilization while creating lib?