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.

Placing Variables in Specific Memory Location - MSP430F5419A

Other Parts Discussed in Thread: MSP430F5419A

Hi,

We are using MSP430F5419A microcontroller and CCS v6.1 for our project.

We need to place a value say 0xA5 in location 0x1900(information memory).

INFOB                   : origin = 0x1900, length = 0x0080

We have tried the following methods but there is no effect on the txt file generated.

Method 1

#pragma LOCATION( x , address );
int x;

Method 2

#pragma DATA_SECTION(port_bit, ".infoB")
const unsigned char port_bit =BIT0;

Referred the following link to do this---> http://processors.wiki.ti.com/index.php/Placing_Variables_in_Specific_Memory_Location_-_MSP430

Please help regarding this.

Regards.

 

  • Reenu Thomas98 said:
    We have tried the following methods but there is no effect on the txt file generated.

    If the variable is not accessed anywhere in the program, then it may be getting removed by the compiler tools.
    Try adding the #pragma RETAIN as mentioned further down in that same wiki link you referenced.

  • Thanks for the help. There was not effect in the txt file generated when the variable is not accessed anywhere in the program. It gets removed by the compiler. So use the variable anywhere in the files used for the project. Also variable doesn't seem to work so I used array and its working fine. Please see the details below.
    In C code,
    #pragma DATA_SECTION(Version, ".infoD")
    const unsigned char Version [2] = { 0xA5, 0xA5};

    Following is the txt file generated,
    @1800
    A5 A5
    @5c00
    0F 14 1F 42 FE 05 3F 80 0A 00 05 24 2F 83 05 20
    D2 43 98 1C 02 3C D2 43 99 1C 0F 16 00 13 0F 14
    1F 42 3E 06 3F 80 0A 00 05 24 2F 83 05 20 D2 43