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.

TM4C1294 TI-RTOS application - running out of heap memory



Hi,

I have a simple TI-RTOS application that I am developing that runs a couple of tasks and I now need to add ethernet capability. When I run the application with the NDK disabled in XDCONF it runs fine but when I add in the NDK I now get a heap memory error. Checked in ROV and there is loads of unused heap space. I can see that the network stack is starting up as NC_NetStart is trying to start but the error message suggests that NetStart is not completing and the network open hook function is not reached.

apMem: line 361: out of memory: handle=0x20016cd8, size=2048  (first two chars missing for some reason)

00000.000

NC_NetStart: WARNING: Boot thread has not completed!

ROV: heap totalSize is 0x400, totalFreeSize and largestFreeSize are both 0x3b8

Any suggestions welcome.

Russ

  • Hi Russ,

    I don't know anything about the application that you are trying to develop, but if there is not enough free space in the heap, the memory will not be assigned and the pointer will be equal to NULL (0). That also means that your totalFreeSize and largestFreeSize will not change.

    What you can try:
    Try to find the line where the heap error occurs to find out how much memory the application is trying to get.
    Then increase your stack size accordingly.

    If you can't find the line, try increasing your heap size by an arbitrary number (if you have enough RAM available, increase it a lot).

    Michel
  • Just adding a minor point to Michel's remark, second paragraph: I think Michel meant 'heap', not 'stack'.
    Having said that, please check in ROV for stack usage as well, and look at the stacks in use to see the max usage information and make sure that you also have adequate stack space. If you blew the stack ROV will likely show that as well,
    Murat