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 LOCATION for COFF?

Hello,

I read in the compiler manual that #pragma LOCATION only works for EABI.

Is there an equally simple way to locate a symbol at a specific address in a COFF project please? For example, a CRC in the last two words of a flash sector.

The only solution I can currently think of is to define a MEMORY directive with the target address and length 2:

   FLASHM             : origin = 0x0BC000, length = 0x001FFE    /* on-chip Flash */

   FLASHM_CRC  : origin = 0x0BDFFE, length = 0x000002    /* on-chip Flash */

Then a SECTION directive to direct the variable to FLASHM_CRC. Is that my only option?

Thank you.