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.

Defining multiple section in CMD file

Hello,

I am using DSP/BIOS v 5.33.01, code generation tools v6.15, CCS v 3.3.81.11 and OMAPL-137 EVM.

I am following the example provided in SPRUG82A (TMS320C674x DSP Cache User's Guide), on page 56, that demonstrates the usage of multiple sections of memory to define the order in which functions are located in memory. The CMD file in example look like this:

MEMORY

{

L2SRAM: o = 00800000h l = 00010000h

EXT_MEM: o = 80000000h l = 01000000h

}

SECTIONS

{

   .cinit > L2SRAM

   .GROUP > L2SRAM

   {

    .text:_function_1 .text:_function_2

    .text

   }

......... (another sections) .......

}

Also a -mo option is required to add to compiler's options, which I also did.

I tried to implement this in my project, but I get this error at the end of compilation:

 

<Linking>

"E:\\Projects\\DSP_CODE\\evm6747\\c6747.cmd", line 18: error: cannot
   find file ".text"
"E:\\Projects\\DSP_CODE\\evm6747\\c6747.cmd", line 18: error: filename
   or assignment expected instead of ":"
"E:\\Projects\\DSP_CODE\\evm6747\\c6747.cmd", line 20: error: cannot
   find file "_function_1"
"E:\\Projects\\DSP_CODE\\evm6747\\c6747.cmd", line 20: error: cannot
   find file "_function_2"

There is another method of implementation introduced in the document, that has a slightly different syntax and also not working.

 

Please help.

Regards

Arye

  • These are syntax errors which mean that you have used incorrect syntax in your linker command file.

    The right place to look for the correct syntax is the C6000 Assembly Tools User Guide, spru186. I have rev q of that UG.

    Section 7 describes the Linker, and section 7.10 talks about the GROUP directive which is what you want to use.

    It may be as simple as removing the "." in front of GROUP in your linker cmd file. But it may depend on exactly what you are trying to get done.

  • The syntax looks fine. I just tried the cmd file below in a non-bios project and it worked:

    MEMORY
    {
        VECS:        o = 0xFFFF0000  l = 0x00000080
        ARMRAM:      o = 0xFFFF0080  l = 0x00001f80
        DSPRAM:      o = 0x11800000  l = 0x00040000
        SHAREDRAM:   o = 0x80000000  l = 0x00020000
        SDRAM:       o = 0xC0000000  l = 0x20000000
    }

    SECTIONS
    {
        .bss        >   SHAREDRAM
        .cinit      >   SHAREDRAM
        .cio        >   SHAREDRAM
        .const      >   SHAREDRAM
        .stack      >   SHAREDRAM
        .sysmem     >   SHAREDRAM
     GROUP >  SHAREDRAM
     {
        .text:_led_test .text:_TEST_execute
        .text
        }
        .switch     >   SHAREDRAM
        .far        >   SHAREDRAM
    }

    If you are using DSP/BIOS, you can not alter the CMD file auto-generated by DSP/BIOS. You should add a custom cmd file with the groups you want. For example:

    SECTIONS
    {
     GROUP >  SDRAM
     {
        .text:_createStreams .text:_prime
        .text
        }

    }

    Add this file to your project (so the project will have 2 cmd files). Add the -mo option. Also, in your linker order option put the custom linker file before the file generated by BIOS:

     

     

  • Thank You Marianna and Randy,

    I did used a separate CMD file, like You suggested. The mistake was, as Randy mentioned, in dot in front of GROUP keyword.

    The mistake is in examples shown documents SPRUG82A (TMS320C674x DSP Cache User's Guide) pages 56-57, and SPRU862B (TMS320C64x+ DSP Cache User's Guide) pages 58-59.

    Thank You both!

    Regards

    Arye

  • Hello,

    I have a similar situation where a client application runs the library( .lib) file. I'm using C6678 processor and CCS v5.1.

    With #pragma CODE_SECTION statments, inside the library file, I have mapped some functions spread over multiple files, to different sections. I created a .xdt file and called it from the configuration (.cfg) file to get the linker.cmd file.

    For ex. my file1.c file contains sections .section1 and .section 2.

    file2.c contains .section1 and .section3.

    I need all these sections gets memory mapped in the following order, section1, section2, section3.

    I tried GROUP keyword as mentioned above, to get that, but it is not mapping across multiple files. (with -mo option off.). ie section1 functions inside file1.c and section1 functions inside file2.c are mapped continuously in the .map file. I tried several combinations of that but still I could not get that working across the files.

    I tried like these,

    GROUP : load > MSMCSRAM
    {
        .Section1
        .Section2

        .Section3

    }

    I could get this working using .SECTION keyword from Client application, but since it has to refer obj files inside library file, I cannot use that option, in my application.

    ex.

    .text : {

    -l =file_lib.lib<file1.obj>(.text,Section1)
    -l =file_lib.lib<file1.obj>(.text,Section2)
    -l = file_lib.lib<file2.obj>(.text,Section1)
    -l = file_lib.lib<file2.obj>(.text,Section3)
    } > MSMCSRAM

    Please suggest me alternatives that will suit to my need.

    Thanks and regards

    Sudhi

  • Sudhi,

    You should post this to the TI C/C++ Compiler Forum instead of this C64x Single Core DSP Forum. Since this two-year old thread has been marked answered, your set of people following this thread here is greatly reduced.

    When you post to the Compiler Forum, please post a link to that new thread onto this thread.

    Regards,
    RandyP