Hi Team, I am using the PN7462AU platform with FreeRTOS, and the SDK example is configured to use heap_3.c. I am facing memory overflow issues and would like to better understand the heap configuration.
Since heap_3 uses the standard library's malloc()/free(), functions such as xPortGetFreeHeapSize() and heap statistics are not available. To gain visibility into heap usage and potentially increase the available heap, I tried switching from heap_3.c to heap_4.c by disabling heap_3.c and enabling heap_4.c. However, the application gets stuck during startup after making this change.
I have the following questions:
Is it safe and recommended to switch from heap_3 to heap_4 on PN7462AU?
How can I determine the amount of memory currently available to heap_3?
Since heap_3 does not support xPortGetFreeHeapSize(), what are the recommended methods to monitor heap usage and detect memory exhaustion?
What additional configuration changes are required when migrating from heap_3 to heap_4 (e.g., configTOTAL_HEAP_SIZE, linker script changes, memory regions, etc.)?
Any guidance or examples specific to PN7462AU and FreeRTOS would be appreciated.
Thank you
Hello @uday_gowda,
The NFC reader library offers examples that shows the implementation of FreeRTOS with the PN7462 that could be helpful. Also, I can recommend see the AN11784, it provides guidance on integrating an RTOS with the PN7462, that you can take by reference.
MCUXpresso IDE also includes several debugging features for FreeRTOS based applications. In particular, the "Heap Usage view" can help you in this case. Additional details are available in the chapter 3.6 of MCUXpresso IDE 25.06 FreeRTOS Debug Guide.
Finally, please take in mind that the PN7462 only have 12k of the SRAM.
BR
Habib