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.

TMS320F280049: How to place _c_int00 on a flash location?

Part Number: TMS320F280049


Dear Champs,

I am asking this for our customer.

The user wants to place the address value of _c_int00 (say, 0x00082836 in the .map) generated by the compiler on a flash location (.out is EABI format).

The user finds that the compiler has a error for the below statement because _c_int00 is not a constant to the compiler.

extern uint32_t _c_int00;
#pragma DATA_SECTION(testVar, "testEntryPoint")
#pragma RETAIN(testVar)
volatile const uint32_t testVar = (_c_int00);

Do you have any suggestion how the user can place the address value of _c_int00 on a flash location?

Wayne Huang

  • This solution presumes the function _c_int00 comes from the compiler RTS library.  Inside the SECTIONS directive of the linker command file, create an output section for this purpose.  Use lines similar to ...

         for_c_int00
    	 {
    	    rts*.lib<boot*.obj>(.text)
    	 } > FLASH

    This creates an output section named for_c_int00.  It is composed of one input section.  That is the .text input section, from a file with a name that matches the pattern boot*.obj, that comes from a compiler RTS library.

    If the function _c_int00 comes from some other place, possibly because of how a software development kit arranges such details, then this solution does not work.

    Thanks and regards,

    -George

  • Dear George,

    The user later found that it works by using & for _c_int00, like this

    extern uint32_t _c_int00;
    #pragma DATA_SECTION(testVar, "testEntryPoint")
    #pragma RETAIN(testVar)
    volatile const uint32_t testVar = (uint32_t)(&_c_int00);

    1. Do you have any comment about the above implementation?

    2. Is _c_int00 defined in RTS library? Or is it defined by the linker? 

    3. We are somewhat confused with the naming. In EABI, we usually find "_" is omitted, but for "_c_int00", "_" is still used before the letter c. Do you know why?

    Wayne Huang

  • Do you have any comment about the above implementation?

    I take this question from the first post ...

    how the user can place the address value of _c_int00 on a flash location?

    ... to mean the user wants to control the memory address at which _c_int00 resides.  C code similar to ...

    testVar = (uint32_t)(&_c_int00);

    ... doesn't do that.  The line ...

    #pragma DATA_SECTION(testVar, "testEntryPoint")

    ... only controls the memory address of testVar.  It has no impact on the location of _c_int00.  

    Is _c_int00 defined in RTS library? Or is it defined by the linker? 

    A definition is provided in the RTS library that comes with the compiler.  It is possible to provide a custom implementation.  I'm not aware of any C28x SDK which does that.  But it is always wise to check.

    We are somewhat confused with the naming. In EABI, we usually find "_" is omitted, but for "_c_int00", "_" is still used before the letter c. Do you know why?

    It is part of the C standards that names which begin with an underscore character "_" are reserved to the implementation.  The name of the entry point _c_int00 is an example of such a name.

    Thanks and regards,

    -George