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.

Stack and Heap size on C66x EVMs

I am puzzled about the stack and heap requirements when compiling code in CCSv5. Under project>properties>C6000 Linker>Basic Options there is

Set C system stack size (--stack_size, -stack)
Heap size for C/C++ dynamic memory allocation (--heap_size, -heap)

Question 1: What is the unit attached to the numeric value placed in this field? (bits, bytes, kilobytes, megabytes...) 


Question 2: How does this map into a phyiscal c66x EVM? When I initially coded my algorithm and ran it in simulation under CCS it would not work until I increased the stack and heap size to 128000 and 1024000 respectively. The c66x evm boards have 512MB DDR3 and 128MB nand Flash memory. based on this what determines the max heap and stack size available and how much memory is availible to store the code? and given my current algorithm how can I see in the simulator how much memory is being occupied by the algorithms execution.

Thanks,

Aaron

  • Hi Aaron,

    Please check spru186v.pdf - TMS320C6000 Assembly Language Tools v 7.3 User's Guide section 7.4.26 Define Stack Size (--stack_size Option) and section 7.4.11 Define Heap Size (--heap_size Option),

    Question 1 - Byte

    Question 2 - It is maped to.sysmem section, you can see where it is defined in the project map file and you can change where you want it to reside,

    Thanks,

    HR

  • Hi,

    Just comment on HRi's answer

    2 - You also can map the stack it to the memory you want (L2SRAM,...) in the platform.

    And I have another question, the size of stack and heap shouldn't be reflected on the linker.cmd too?  In my case I always get:

    -heap  0x0
    -stack 0x1000

    It doesn't matter the value I choose in the linker options.

    Thanks

  • Johannes said:

    And I have another question, the size of stack and heap shouldn't be reflected on the linker.cmd too?  In my case I always get:

    -heap  0x0
    -stack 0x1000

    It doesn't matter the value I choose in the linker options.

    The linker options from CCS affect the lilnker invokation command line only (they are not writte into the .cmd) and take precedence over your linker.cmd.

  • Hi Alberto,

    Thanks for your answer. I realized what's happening in my case, like HRi said, the -stack results in the .stack section and -heap is mapped to the .sysmem section and the size configured will appear in the .map file. However, I was using a RTSC project and the values put in the linker options do not affect the .map file, you have to use the .cfg file to do so. Sorry for the mess.

    Regards