vApplicationMallocFailedHook getting triggered when creating multiple tasks

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

vApplicationMallocFailedHook getting triggered when creating multiple tasks

794 Views
arpandutta0000
Contributor I

Hi Team,
We are facing an issue where vApplicationMallocFailedHook gets triggered when creating multiple tasks.

Context:
We are trying to develop a FreeRTOS application using the NXP-provided RTOS SDK for the iMX8 QuadMax board. We can create, build, and run sample hello world application. We are using the build_debug.sh script to build the application.

Issue:
When we create multiple tasks(around 4-5 tasks) with a stack depth of 0x800U with just some minimal logs, vApplicationMallocFailedHook function gets triggered and the application behaves unexpectedly afterward.

Additional Info:
We found a few threads regarding the same where the solution suggests increasing the heap size using some version of MCUXpresso IDE.

referred threads:
https://community.nxp.com/t5/Kinetis-Microcontrollers/FreeRTOS-bumping-into-vApplicationMallocFailed...

https://community.nxp.com/t5/MCUXpresso-IDE/How-to-configure-heap-and-stack-sizes-in-MCUXpresso/m-p/...

 

Questions:

  1. Is increasing heap size the proper way to resolve vApplicationMallocFailedHook issue or should we look into something else? 
  2. If we need to increase heap size, how to do it without using the MCUXpresso IDE? Which file(s) do we need to edit to increase the heap size?
0 Kudos
Reply
1 Reply

726 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi @arpandutta0000 

Refering the link you provided, for freertos stack size modification on MPU SDK, please find below config in FreeRTOSConfig.h

Zhiming_Liu_0-1715043661618.png

 

0 Kudos
Reply