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.

Apply DATA_SECTION to Multiple Symbols Automatically

Hello,

I am currently using the following .c code to put these symbols in section CHARACTERISTICS.

#pragma DATA_SECTION (PADDING, "CHARACTERISTICS")
const uint16_T PADDING = 0xFFFFU;
#pragma DATA_SECTION (DUMMY_CHARACTERISTIC_C, "CHARACTERISTICS")
const uint16_T DUMMY_CHARACTERISTIC_C = 1U;

The tedious nature of having to write a #pragma DATA_SECTION for each and every symbol aside, my code will eventually be auto-coded and I doubt that I will be able to insert the #pragma automatically for every symbol.

Is there an equivalent way of doing the following in CCS please?

#pragma section "CHARACTERISTICS"

/* Auto code start. */
const uint16_T PADDING = 0xFFFFU;
const uint16_T DUMMY_CHARACTERISTIC_C = 1U;
/* Auto code end */

#pragma section

In other words, only one manually inserted pragma is required to bookend what could be hundreds of symbols.

Thank you very much.