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.

Linker Command File Editing For #pragma DATA_SECTION

I'm asking for assistance to properly edit lnk_msp430f2610.cmd so that my CRC word will reside at 0x6000 (not used).  I've added the following statements:

#pragma DATA_SECTION (CRC_expected, ".CRC_location");

#pragma DATA_ALIGN(CRC_expected, 2);

unsigned int const CRC_expected[1]={0xCB8C};

I'm not certain if DATA_ALIGN is necessary.  I"ve looked over section 7.5 of slau131g.pdf and I am not certain where and what to add to the linker command file to set the location of CRC_expected to be 0x6000.  The map file says it's now at 0x0.  

  • In the memory section....

    MEMORY
    {
       
    CRCMEM: o=0x6000 l=0x0002
    ....
    }

    then in the "sections":

    SECTIONS
    {
        .CRC_location: > CRCMEM
    ...
    }

    Make sure to modify the other section(s) that contain 0x6000 to carve out the space for the new section.

**Attention** This is a public forum