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.

fine placement for .const:.string

Other Parts Discussed in Thread: SYSBIOS, TMS320C6654

Hi,

I have in my project some files used for debug than contain printf with char strings (defined directly into printf function).

for example: printf("DSP firmware version :  %s\r\n", VERSION);

I use CODE_SECTION and DATA_SECTION pragmas to create new sections to place these debug features in DDR3 instead of L2SRAM, but char strings still appears in .const section as .const:.string

Is there something like a pragma to declare into each source file to put .const:.string into specific section (like for code and data)?

I've found a solution in sysbios .cfg file to put .const:.string section in DDR3, but this apply to all .const:.string section, but I want to do this only for my debug files.

Program.sectMap[".const:.string"] = new Program.SectionSpec();

Program.sectMap[".const:.string"].loadSegment = "DDR3";

I'm working on tms320C6654 with ccs 6.1.3 compiler 7.4.16 sysbios 6.46.0.23 and xdctools 3.32.0.6

Thanks for your help

  • Hi

    Maybe this doesn't suit your needs, but to operate at file level and on multiple file, I use a remap at linker command file and a filename prefix/postfix (hoping non ambiguous), as in:
    .const_strings
    {
    dbg_*.obj(.const:.string)
    } > RAM
    You can add a simple "lnk_dbg_const.cmd" to your project and CCS should automatically merge with the SYSBIOS one.
  • Hi,

    To check your solution, I've created linker_const.cmd file than contain:
    SECTIONS
    {
    .const:.string: load > DDR3
    }
    It's put the full .const:.string section into DDR3.

    So I replace this by what I want:
    SECTIONS
    {
    *dbg.o(.const:.string): load > DDR3
    }
    and obtain following errors:
    "linker_const.cmd", line 3: error #10030-D: expecting section type (COPY,
    DSECT, or NOLOAD) instead of ".const:.string"
    "linker_const.cmd", line 3: error #10026-D: expecting output section, GROUP, or
    UNION instead of ":"

    I've also tried as you said:
    .const_strings
    {
    *dbg.o(.const:.string)
    } > DDR3
    and obtain following errors:
    "linker_const.cmd", line 1: error #10008-D: cannot find file ".const_strings"
    "linker_const.cmd", line 2: error #10021-D: expecting filename, option, MEMORY,
    or SECTIONS instead of "{"
    "linker_const.cmd", line 4: error #10021-D: expecting filename, option, MEMORY,
    or SECTIONS instead of ">"

    What is wrong in my linker cmd?

    thanks
  • Hi,

    The following works for me:

    SECTIONS
    {
      .const_strings
      {
        diagmon_*.obj(.const:.string)
      } > SH_RAM
    }
    

    Note that:

    • when using a filename filter, you have to declare a new section and then the list of program section you have to put into
    • With my CGT (C6000 7.4.16, Windows), the object file extension is ".obj"
    • The SECTION {...} directive is always required
    • If the object files are in a library, you need something like *libname.lib<dbg_*.obj>(.const:.string)
    • You can allocate a whole library at once with libname.lib(.const.:string)

  • Thanks, it does what I need