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.

LAUNCHXL-F28379D: I can't quite understand the #pragma setting in example project "flash_programming" for F28379D

Part Number: LAUNCHXL-F28379D
Other Parts Discussed in Thread: C2000WARE

Hi expert,

The example project located here: C:\ti\c2000\C2000Ware_1_00_05_00\device_support\f2837xd\examples\dual\flash_programming\cpu01

My question is related to this line:

#pragma CODE_SECTION(Example_Error,ramFuncSection);

I have never seen any section named "ramFuncSection" in CMD file for this example project. The CMD file only have below section definition:

#ifdef __TI_COMPILER_VERSION__
    #if __TI_COMPILER_VERSION__ >= 15009000
        GROUP
        {
            .TI.ramfunc
            { -l F021_API_F2837xD_FPU32.lib}
         
        } LOAD = FLASHD,
          RUN  = RAMLS03, 
          LOAD_START(_RamfuncsLoadStart),
          LOAD_SIZE(_RamfuncsLoadSize),
          LOAD_END(_RamfuncsLoadEnd),
          RUN_START(_RamfuncsRunStart),
          RUN_SIZE(_RamfuncsRunSize),
          RUN_END(_RamfuncsRunEnd),
          PAGE = 0    
    #else
        GROUP
        {
            ramfuncs
            { -l F021_API_F2837xD_FPU32.lib}
         
        } LOAD = FLASHD,
          RUN  = RAMLS03, 
          LOAD_START(_RamfuncsLoadStart),
          LOAD_SIZE(_RamfuncsLoadSize),
          LOAD_END(_RamfuncsLoadEnd),
          RUN_START(_RamfuncsRunStart),
          RUN_SIZE(_RamfuncsRunSize),
          RUN_END(_RamfuncsRunEnd),
          PAGE = 0    
    #endif
#endif

Q1: Should I use #pragma CODE_SECTION(Example_Error," .TI.ramfunc"); instead?

Q2: I think we need to add "" on section names, but why complier didn't give an error?

Q3: If the #pragma is not correctly set, why the example project runs without any obvious problem?

Thanks

  • Sheldon,

    As discussed with you in the other post in a related context, below ifdef is added to the examples.  This defines ramFuncSection as ".TI.ramfunc" or "ramfuncs" based on the compiler version.  You can see the quotes below.  Hence, examples work fine.

    #ifdef __TI_COMPILER_VERSION__

       #if __TI_COMPILER_VERSION__ >= 15009000

           #define ramFuncSection ".TI.ramfunc"

       #else

           #define ramFuncSection "ramfuncs"

       #endif

    #endif

    Thanks and regards,

    Vamsi