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" beeing ignored by linker

Other Parts Discussed in Thread: MSP430FE427A

hi,

i try to drive a display, but the character-table seems to be too big for the msp430fe427a.

so i try to define my character table the following way:

"#pragma DATA_SECTION ( ascii_tab , ".S65LCD" );

unsigned char ascii_tab[96][14]={ ...."

in the .cmd-file, i tell the linker the following:

".S65LCD : {} > FLASH"

but inside the memory the .S65LCD-section is empty... only 0xFFFF. Why doesnt the linker copy the array to the flash?

 

  • Hello,

     

    i had some issues with the memory placement as well, so first thing you could try is to really use that variable in your main-routine, i have experienced that if you just declare a variable that you dont use it isnt present in your memory.

     

    If you just want that variable to be somewhere in Flash you simply can declare it const ( as a constant )  if you hadnt known befor, then the linker will automatically place it in the flash, but you cannot change it anymore as it is laying in the Flash. But that is what you want anyway i guess.

     

    Hope that helps a bit.

    Greets.

  • solved the problem: the compiler (or linker?) doesnt write the data of my "ascii_tab[ ][ ]" to flash if it isnt const.

    Edit: thank you seb!

**Attention** This is a public forum