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.

Linker file help

 how to use cmd files? should i create a new one for each and every project or does ti supply them already (ready to be used) and one does not need have to go for custom built under normal circumstances.........I found few *.cmd files in F28069 device support directory,  with following name

28069_RAM_lnk.cmd

28069_RAM_CLA_C_lnk.cmd

28069_RAM_CLA_lnk.cmd

F28069.cmd

why so many files for just one memory, i mean peripheral are bounded to particular memory.

 am totally confused.

  • Abhishek,

    TI supplies a number of linker files that you could start with.  There can be multiple files in a project.  Each 28x example uses two linker command files. These files specify the memory where the linker will place code and data sections. One linker file is used for assigning compiler generated sections to the memory blocks on the device while the other is used to assign the data sections of the peripheral register structures used by the F2806x peripheral header files.

    As you have noted there are a number of them in the device support directory.  These are the files used to specify the memory where compiler/assembler generated code and data sections will be placed.

    • 28069_RAM_lnk.cmd: Has all code and data sections mapped to RAM memory.  This allows you to develop using RAM only and avoids having to program the flash.
    • 28069_RAM_CLA_lnk.cmd: This is the same as the above, except memory used by the CLA has been defined as such - for example CLA program memory.
    • 28069_RAM_CLA_C_lnk.cmd:  This is the same, except there are additional items needed for the CLA C compiler - for example the scratch pad has been added.
    • F28069.cmd: This file uses flash.  It might be the bases for a final application that needs to be loaded into the flash memory.

    Note - You would not include all of the above in one project.  You would start with the one closes to what you are trying to do and modify it for your particular needs.

    The other file will likely be: F2806x_Headers_nonBIOS.cmd - which allocates the bitfield structures. 

    You may find the following helpful:

    Understanding linking: http://processors.wiki.ti.com/index.php/C28x_Compiler_-_Understanding_Linking

    Regards

    Lori

  • thanks Lori, looking at wiki right now, from what i get 

    1. for learning purposes i can use ti supplied cmd files.

    2. unless its required to place certain sections at specific locations, i dont have to touch cmd files.

    3. now about memcopy function, it copies peripheral related functions as defined in F28069_GlobalVariablesDefs.c to RAM  are these locations already defined in cmd files?

    thanks

    Abhi 

  • Abhishek,

      F2806x_Headers_nonBIOS.cmd - would place the peripheral structures into the correct memory locations.But if you need the functions for the peripherals i think you will have to manually include them in your project.The .c files containing the peripheral functions can be obtained from tidcs(ti documnents) under the DSPxxxx_COMMON folder.Once included in the project the compiler would take care of proper placement.


    Sreejith