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/TMDSDSK6455: finding maximum allocate able memory

Part Number: TMDSDSK6455

Tool/software: Code Composer Studio

Hi all,

how can I find the maximum heap allocatable memory in bytes?

I know that is already present at the dsk documentation but I want to find it through the code

I am also a little confused about CCS linker options where we can enter how much memory we have, so what happens if I enter more value than my dsk already has?

Thanks,

saeed

  • Throughout this post I use terms and coding techniques introduced in the article Linker Command File Primer.

    I'm not sure of the best way to solve your problem.  But I can give you an example that is probably a good start.

    I presume the heap is entirely contained in a single memory range.  That being the case, the linker command file can contain code similar to ...

    #define HEAP_SIZE 0x4000
    
    MEMORY
    {
        HEAP_MEMORY : origin = 0x10000000, length = HEAP_SIZE
        ...
    }
    
    heap_size_symbol = HEAP_SIZE;

    The overall point is to define the size of the heap in one place, then automatically propagate that size everywhere else.  On line 1, a preprocessor symbol is defined for the size of the heap.  On line 5, the memory range for the heap is defined.  On line 9, a symbol is defined, and the value of this symbol is the size of the heap.  You can use heap_size_symbol in your C or C++ code.  For details, please search the C6000 assembly tools manual for the sub-chapter titled Using Linker Symbols in C/C++ Applications.

    saeed mahmoodi said:
    what happens if I enter more value than my dsk already has?

    Another way to ask this question: What happens if the memory ranges in the linker command file do not match the system used for execution?  The linker presumes the memory ranges are correct.  So, at build time, nothing happens.  However, the code will not work.  Problems will occur at run time.

    Thanks and regards,

    -George