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.

RTOS/TCI6638K2K: How to use a 'User defined linker command file'?

Part Number: TCI6638K2K

Tool/software: TI-RTOS

For our TCI6638 multi-core project we generate our platform using the RTSC Tools Edit Platform wizard.  However this has become inconvenient because we specify many SECTIONS.  It would be nice to be able to move the SECTION rows in the wizard to order them sequentially but that isn't possible.  Therefore, we would like to specify the sections using a text editor.  I would like some help to know how to do this.

Reading the documentation: Memory Management it seems that there are two options:

  1. Specify a 'User defined linker command file'
  2. Control the linker command file generated by XDCtools based on it's Javascript template

I don't understand (2) at all.  Does one modify the Javascript template?

Given that that my goal is to specify multiple sections, is my best option to use 1) or 2) ?

Assuming the answer is 1), consider this diagram , it shows that the application build tools accept a user-defined linker command file or an auto-generated (by RTSC) linker command file.  

  1. Would I use both a user-defined linker command file and an auto-generated file, or only a user-defined linker command file?
  2. How would I specify to CCS to use the user-defined file and not the auto-generated file?

Best regards

David

  • David,
    I am assuming that you are using CCS. Let me know if that's not the case.
    If you create a linker command file that contains only SECTIONS directives and save it in the top directory of your project, both your file and the generated linker command file would be used.

    Why don't you want to include the generated file? If it's because you want to exclude some of the section allocation from that file, you can do it using Program.sectionsExclude in your config script. Read about it under "Configuring the generated linker command file" in the documentation you have already found.
  • Hi Sasha

    Thanks for your reply. I am indeed using CCS.

    The reason I want to do all this is that I have many sections and they are hard to maintain using the Platform Wizard in CCS - I want to maintain them using a text file instead.

    So I could specify the SECTIONS directives in a manual linker command file the top directory of my project, as you suggested. However, I guess that I would then have to give the SECTIONS different names in the 'manual' file to those specified in the auto-generated file. I think that would be a bit of a headache.

    Could I instead maintain manually the definition file used by xdc (i.e. used by the Platform Wizard)? Perhaps I can then update the platform by invoking xdc. From the perspective of the CCS build nothing then changes. I would just never use the Wizard?

    Do you think this is a good idea?

    Which file would I edit? Platform.xdc or <project_name>_TCI6638.java?

    Best regards

    David
  • Are you worried that both your linker command and the generated linker command file would try to allocate .bss, for example?
    If you use Program.sectionsExclude, you can specify all the sections that you don't want allocated in the generated file, and that's how you would avoid allocating .bss in both directives.

    You could use your alternative idea, but I don't think it's easier. You would have to run 'xdc' for any change as opposed to editing your linker command file in a text editor. You would edit Platform.xdc, the Java file is an internal file and you would have a hard time compiling it after making changes.
  • Hi Sasha

    I followed your advice to use a manual linker command file: link.cmd, to which I have moved all memory segment definitions, except L2INST and L2DATA, from my platform.

    It appears to be working.

    Thanks for your help.

    David