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.

#pragma DATA_SECTION() expansion



Hi,

 

I am interested to know how exactly the data object mapping is achieved with this pragma. Can someone point me where the definition of this might in the CCS5v compiler. I have been trying in the CCSv5 compiler folder with no results.

 

Thanks,

Shyama

  • The DATA_SECTION pragma (among many others) is described in the Compiler User's Guide.  You don't say which CPU target you are using, so this link is to all the manuals.  

    All data (and code) is placed by the compiler into what are termed input sections.  The linker performs two tasks.  1) It combines input sections together into output sections.  2) It allocates those output sections to target memory.  The compiler places data into input section names using a default algorithm.  The DATA_SECTION pragma overrides that algorithm and lets you specify the name of the input section which will contain the variable.  It remains your task to modify the linker command file so that input section is combined into an output section and allocated to target memory.  The main reason to use DATA_SECTION is because you have need to carefully control where some variable(s) are placed in memory.

    This wiki article is an example of one way to use DATA_SECTION.

    Thanks and regards,

    -George