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.

CCS Memory Allocation View and Dynamically Allocated RAM

Other Parts Discussed in Thread: TM4C1294NCZAD

Hello,

I have a quick question about the Memory Allocation View in CCS.

In my Memory Allocation View (screenshot below), I see that the current program is taking up 64% of the available SRAM on my MCU (TM4C1294NCZAD).

Is this a guarantee that the program will never take up more than 64% of the total SRAM on the MCU? Or is it possible for dynamically allocated RAM to cause the total RAM used by the program to go above that 64% mark?

I want to add a TCP/IP stack to my project, so I want to make sure that there is enough RAM to spare.

I hope this question makes sense -- please let me know if I am making any wrong assumptions.

  • Hi,

    Is this a guarantee that the program will never take up more than 64% of the total SRAM on the MCU? Or is it possible for dynamically allocated RAM to cause the total RAM used by the program to go above that 64% mark?

    Yes, it is possible the dynamically allocated RAM (.e.g. heap) to increase beyond the 64% mark. I will also ask our compiler experts to comment on your question. 

  • Is this a guarantee that the program will never take up more than 64% of the total SRAM

    No.

    To understand it more precisely, please read the first part of the article Linker Command File Primer.  Focus on understanding the terms output section and memory range.  What it means is that the output sections allocated to the memory range SRAM take up 64% of it.  That said, I have seen systems that intentionally create a heap that uses an output section only to the establish the base address, and not the size of the heap.  In such a case, more than 64% of SRAM gets used.  From the Memory Allocation View alone, it is not possible to know whether this scheme, or another one like it, is being used.

    Thanks and regards,

    -George