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.

cgtools v5.2.1 Link Errors

Other Parts Discussed in Thread: TMS320F2812

I am using ccs v4 to compile some projects I imported from ccs v3.3.

Using ccs v4 I get the following errors with cgtools v5.2.1 ( I do not get these errors using cgtools v4.1.3).

cgtools v4.1.3 generated 0-length for the sections .stack .ebss .reset .bss., so the linker had no problem.

Why would v5.2.1 generate non-zero length for these sections?

Why is v5.2.1 looking for the _main symbols?

How do I tell the cg tools to stop generating run-time code for me?

Thanks for your help.

Note: My linker command file maps all these sections to PAGE 1 without defining any memory for PAGE 1.  The the old linker in v4.1.3 did not have any problem with it.

 

error: no valid memory range(NULL) available for placement of ".stack"

error: run placement fails for object ".stack", size 0x400 (page 1)

"../SRC/xxx.cmd", line 121: error: no valid memory range(NULL) available for placement of ".ebss"

"../SRC/xxx.cmd", line 121: error: run placement fails for object ".ebss", size 0x8 (page 1)

"../SRC/xxx.cmd", line 126: error: no valid memory range(NULL) available for placement of ".reset"

"../SRC/xxx.cmd", line 126: error: placement fails for object ".reset",size 0x2 (page 1)

"../SRC/xxx.cmd", line 122: error: no valid memory range(NULL) available for placement of ".bss"

"../SRC/xxx.cmd", line 122: error: run placement fails for object ".bss", size 0x0 (page 1)

"../SRC/xxx.cmd", line 120: error: no valid memory range(NULL) available for placement of ".data"

"../SRC/xxx.cmd", line 120: error: run placement fails for object ".data", size 0x0 (page 1)

 

error: unresolved symbols remain

 

 

 

undefined first referenced

symbol in file

--------- ----------------

_main C:\Program Files\Texas Instruments\ccsv4\tools\compiler\c2000\lib\rts2800_ml.lib<args_main.obj>

  • I need to see what is in your linker command file.  Please post it.

    Thanks and regards,

    -George

  • With the permission of the lead, the relevant portions of the command file is included below.

    MEMORY
    {
        /* Program Memory */
        /* Memory(RAM/FLASH/OTP) blocks can be moved to PAGE1 for data allocation */

        /********************         TL PART        **********************/
        CEI_TLAPITBL    : origin = 0x3F6FD0, length = 0x000030
        CEI_TLVERTBL    : origin = 0x3F7000, length = 0x000020
        CEI_TLCODE      : origin = 0x3F7020, length = 0x000F5F
        /********************************************************************/

    PAGE 1:
    }

    SECTIONS
    {
        tlText                :
                              {
                                  *(.text)
                              }
                              > CEI_TLCODE,      PAGE = 0
        .tlData               :
                              {
                                  *(.data)
                              } > CEI_TLCODE,      PAGE = 0


        /*.stack              : > CEI_TLRAML0,     PAGE = 0*/

        /*.esysmem            : > CEI_TLRAML0,     PAGE = 0*/

        tlConst             :
                              {
                                  *(.econst)
                                  *(.bss)
                              } > CEI_TLCODE,      PAGE = 0

        TLCTSEC             : > CEI_TLCODE,      PAGE = 0
        TLAPITBLSEC         : > CEI_TLAPITBL,    PAGE = 0
        TLVERSEC            : > CEI_TLVERTBL,    PAGE = 0
        .cinit                   :   PAGE = 0
        .switch             :    PAGE 0

            .stack   :  PAGE = 1
            .data    :  PAGE = 1
            .ebss    :  PAGE = 1
            .bss     :  PAGE = 1
            .econst  :  PAGE = 1
            .const  :   PAGE = 1
            .cio  :     PAGE = 1
    }

  • Looking over your link command file, and your first post, made me realize you are probably linking without --rom_model (AKA -c) or --ram_model (AKA -cr).  And that's why your link works under CCS v3.3.  When you moved your project to CCS v4, one of those options somehow got set.  So please try this.  Bring up your project Build Properties.  Select C6000 Linker | Runtime Environment.  The selection Initialization Model is a drop down box with 3 entries.  Choose the empty one.  I'm confident, though not certain, this will solve your problem.

    Thanks and regards,

    -George

  • I changed the linker setting selection as suggested (i.e. setting runtime env to "none"), but that did not do the trick.

    I assume that there is no way to avoid the run-time code and data, is that right? 

    The link command file dumps all the run-time stuff to PAGE1 which does not have any memory assigned, and the v4.1.3 linker takes it just fine.  I have verified down-grading the cg tool back to  v4.1.3 instead (but still using the same project in ccs4), and the errors went away. 

    btw. my processor is TMS320F2812.

    Thanks!

  • I do not understand how you ever got the v4.1.3 linker to work.  I have tried my own small test cases and failed.  To make progress on this, I need some sort of test case which builds clean under v4.1.3 but fails under v5.2.1.  I realize that may be lot to ask.  But I see no other alternative.  If it helps, you can send the test case just to me, and not post it here.  Click on my name or avatar, then "Start Conversation".  The interface which comes up includes an icon for attaching a file.

    Thanks and regards,

    -George

  • Further investigation conducted off-line reveals a bug in the linker.  It should not attempt to allocate output sections, such as .stack and .bss, which are size 0, even if the link command file contains a specification for that output section.  I filed SDSCM00039460 in the SDOWP system.  Feel free to track it with the SDOWP link in my sig below.

    Thanks and regards,

    -George