The Malloc() in the CortexA9 Standalone BSP delivered with SDK does not work correctly . The Malloc() allocates memory from the heap as expected. However, the Malloc() function does not seem to determine when the system heap is out of space and causes overwrite issues, and thus leading to the application to crash.
How can this be resolved?
This is a known issue.
To work around the problem, download the patch attach to the end of this answer record and follow the instructions below:
Unzip, the file and replace the _sbrk.c file in
<EDK Install Directory>\sw\lib\bsp\standalone_v3_11_a\src\cortexa9\gcc
Or, on Standalone SDK:
<SDK Install Directory>\sw\lib\bsp\standalone_v3_11_a\src\cortexa9\gcc