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.

Where can I find the user guide or docment which tell how to write a good cmd file in project?

Other Parts Discussed in Thread: SYSBIOS

Hi,all:

I see so many cmd files among different dsp projects.But to be honest,
Sometimes I cannot understand why cmd file can be written like that.
For example,a cmd file I meet like below.While I have some questions.

.cinit: load > MSMCSRAM
.pinit: load >> L2SRAM
.init_array: load > L2SRAM
.const: load >> DDR3
.data: load >> L2SRAM
.fardata: load >> L2SRAM
.switch: load >> L2SRAM
.sysmem: load > L2SRAM
.far: load >> L2SRAM
.args: load > MSMCSRAM align = 0x4, fill = 0 {_argsize = 0x8; }
.cio: load >> L2SRAM

Q1:
Do all those sections like .cinit .pinit .init .const ... .far .cio which are
produced by SYSBIOS ?

Q2:
Is it necessary that I place above sections like .cinit .pinit .init .const ... .far .cio
into CMD file when I use SYSBIOS in my application?
I am not sure about that. Sometimes I can see those above sections appear in the CMD file.
Sometimes I cannot see those above sections in the CMD file. Why ?
If those sections are indispensable they should appear in CMD file in any time. Sometimes appear,
Sometimes don't appear. I am puzzled.

  • Q1:

    Those sections are defined by the TI code generation tools (Compiler/Linker), NOT by SYS/BIOS.

    Q2:

    Those sections should be explicitly placed within a linker command file.

    Usually with CCS, a linker command file is included in the project that places those sections.

    Alan

  • Hi,Alan:

    Thanks for your reply.

    Can I understand cmd file like below?

    1.

    In a CCS project with rtsc cfg file. There are two cmd files in projects.One is user defined cmd file.

    the other is BIOS or cfg file auto generate cmd file for example this

    2.

    Those sections like  .cinit .pinit .init .const ... .far .cio which I said above are auto generated

    by BIOS or CGT or linker. This is automation and it's no need to be written by myself.

    The only need for me is to write a user define CMD file.The difference between user define cmd

    file and auto-generate cmd file is that auto-generate cmd file includes sections which is generated

    by cgt or linker like .cinit .pinit .init .const ... .far .cio.  But user define cmd file doesn't need to include

    those sections.

    If any incorrect Please tell me.

    Thanks!

  • David,
    in all CCS projects the sections generated by the compiler are already allocated for you. There could be different ways how that's accomplished but your assumption is correct - you should never need to allocate these section in your user-defined CMD file. Also, you don't have to have a user-defined CMD file. Only if you are creating new sections or defining symbols at the link time, you may need to add your CMD file.
    For more info about CMD files, take a look at this link http://www.ti.com/lit/pdf/spru186, Section 8.5. Generation of CMD files by XDCtools is described here http://rtsc.eclipse.org/docs-tip/Memory_Management#RTSC_Platforms_in_Application_Build.