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.

TMS320C6713B: About the code in lnk.cmd

Part Number: TMS320C6713B

https://software-dl.ti.com/ccs/esd/documents/sdto_cgt_Linker-Command-File-Primer.html

The "Additions and Changes" part in above link suggests readers to post code of linker command file which is not described in that article, and that's why I create this question.

My lnk.cmd file is written as below(in order to highlight my question, I didn't put here the code which functionally repeat):

-c

-heap 0x1800

-stack 0x1800

-lrts6701e.lib

MEMORY

{

      IRAM:    o = 00000000h      l = 00000400h

}

SECTIONS

{

   .bss      >      IRAM     fill = 0

}

Could someone advise the meaning and format of the Red codes?

Also, after you kindly answer my question, please go further to make Additions to the article of the link above.

Thanks and Best Regards.

  • Hi

    This information should be available in TMS320C6000 Assembly Language Tools. Please review the version you are using.

    https://www.ti.com/lit/ug/sprui03e/sprui03e.pdf

    -heap 0x1800

    -stack 0x1800

    -lrts6701e.lib

    Refer Section 8.4 Linker Options.

    • For -heap, refer Section 8.4.14. The C/C++ compiler uses an uninitialized section called .sysmem for the C run-time memory pool used by malloc(). You can set the size of this memory pool at link time by using the --heap_size or -heap (alias) option.
    • For -stack, refer Section 8.4.28. The TMS320C6000 C/C++ compiler uses an uninitialized section, .stack, to allocate space for the run-time stack. You can set the size of this section in bytes at link time with the --stack_size or -stack (alias) option.
    • For -l, refer Section 8.4.16. To use a file that is not in the current directory, use the --library linker option. The --library option's short form is -l.
    -c

    For -c, refer Table 8.7.  This enables the --rom_model i.e autoinitializes variables at run time.

    MEMORY

    {

          IRAM:    o = 00000000h      l = 00000400h

    }

    SECTIONS

    {

       .bss      >      IRAM     fill = 0

    }

    For this, refer the Section 8.5.4.2 MEMORY Directive Syntax.

    "o" and "l" denote the "origin" and "length" attributes.

    • Origin: specifies the starting address of a memory range; enter as origin, org, or o. The value, specified in bytes, is a 32-bit integer constant expression, which can be decimal, octal, or hexadecimal.
    • Length: specifies the length of a memory range; enter as length, len, or l. The value, specified in bytes, is a 32-bit integer constant expression, which can be decimal, octal, or hexadecimal.
    • Fill: specifies a fill character for the memory range; enter as fill or f. Fills are optional. The value is an integer constant and can be decimal, octal, or hexadecimal. The fill value is used to fill areas of the memory range that are not allocated to a section.

    Regards

    Karan

  • Thank you very much!