This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C1294NCPDT: Help with malloc() Error from the NDK

Part Number: TM4C1294NCPDT
Other Parts Discussed in Thread: SYSBIOS

I am using the following:

ccs 6.1.2 
TIRTOS 2.16.0.08,
compiler 5.2.7 
XDC 3.31.1333
TM4C1294NCPDT
ndk_2_25_00_09

I have a project that has 3 TCP/IP sockets I created on the Tiva.   The sockets have been working great and I have used the same code for the sockets in other projects so I have some confidence in it.  What I notices with my newest project is occasionally I get a error and the network stack seems to stop working but the LEDs that blink on the board indicate the CPU is still executing code.  When I get the error, the ping will fail and the sockets no longer work until I reboot or restart.

Recently I got the problem to happen when I had the debugger (CCS was running on a probe) on and I noticed a error I have never seen in the console window of CCS scrolling by:

54323.174 NodeNew: OOM
54323.174 RtFind: Clone creation failed!
54323.175 NodeNew: OOM
54323.175 RtFind: Clone creation failed!
54323.175 NodeNew: OOM
54323.175 RtFind: Clone creation failed!

Looking at the source code this looks like a malloc() failing in tirtos\products\ndk_2_25)00_09\packages\ti\ndk\stack\node\node.c

The resources used by the code are as follows:

*  CCS Memory Allocation  (window-show view-memory allocation) shows the flash is 18% used and the RAM is 52% used.

* CCS  ROV (run time object viewer)  shows the stacks for the tasks look OK since the stackPeak are all less than the stackSize..

*  I checked in the project configuration in CCS (right click project->properties-> build->Arm Linker->Basic Options:  I have the stack size st to 1024.

I assume the malloc() is failing because the memory is being fragmented but that's just a guess.

Any advice on how to troubleshoot this problem or how to fix it?

Thanks,

Doug