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.

Can anybody help me explain this error in cmd file?

Hello:

    I found an error when building the c code in C6713 dsk.

 

  

 

The error seems to indicate that there is not enough memory for the section .const.

 

But I just want to know what is the probable reason of causing this error?

What .const normally contains?

 

I imported 965499 data with pointer:

 

And defined many constants with #define:

 

 

Is it because I defined so many constant that .const section has not been assigned enough memory in IRAM?

 

 

thank you

 

  • Hi,

    Where did you get this entry for IRAM ?
    IRAM o = 0x00000000 l = 0x00100000

    It seems wrong entry, C6713 has internal RAM size about 192KB + 64KB (L2)

    Also try to move all the entry to external RAM.

    Ex: C6713.cmd

    MEMORY
    {
    IRAM o = 0x00000000 l = 0x00030000 /* 192kB - Internal RAM */
    L2RAM o = 0x00030000 l = 0x00010000 /* 64kB - Internal RAM/CACHE */
    EMIFCE0 o = 0x80000000 l = 0x10000000 /* SDRAM in 6713 DSK */
    EMIFCE1 o = 0x90000000 l = 0x10000000 /* Flash/CPLD in 6713 DSK */
    EMIFCE2 o = 0xA0000000 l = 0x10000000 /* Daughterboard in 6713 DSK */
    EMIFCE3 o = 0xB0000000 l = 0x10000000 /* Daughterboard in 6713 DSK */
    }

    SECTIONS
    {
    .text > IRAM
    .stack > IRAM
    .bss > IRAM
    .cio > IRAM
    .const > IRAM
    .data > IRAM
    .switch > IRAM
    .sysmem > IRAM
    .far > IRAM
    .args > IRAM
    .ppinfo > IRAM
    .ppdata > IRAM

    /* COFF sections */
    .pinit > IRAM
    .cinit > IRAM

    /* EABI sections */
    .binit > IRAM
    .init_array > IRAM
    .neardata > IRAM
    .fardata > IRAM
    .rodata > IRAM
    .c6xabi.exidx > IRAM
    .c6xabi.extab > IRAM
    }
  • Yu Zhang,

    This is a forum for hardware or device questions. Normally, compiler tool questions should be asked on the C/C++ Compiler Forum. However, they would not have someone like Titus to catch your mistakes on things like the size of memory being used in your linker command file.

    You need to be starting from example files for your device, and it would help you if you used TI-RTOS since it will create a linker command file for you. You are making your job difficult.

    You can refer to the Optimizing C Compiler User Guide to learn which components of your program will go into the .const section. The obvious component would be any variables defined at const int varname <number>, but the User Guide can help you learn more about other components that may go there.

    Your .const section is huge from the number stated in the error message.

    You can refer to the linker's output .map file (Smalltry2.map, maybe?) and see all of the object files that contribute to your 7MB .const section. Then look at the code and see how it is being used.

    The bottom line is to follow Titus' suggestions to use the correct linker .cmd file and to put your program and data in external memory.

    Regards,
    RandyP