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.
Hello,
I'm having difficulty placing variables in FRAM. I'm using the documented technique using the #pragma PERSISTENT feature of the compiler. When I do this, the variable is placed in RAM, not FRAM. Here's an example of the code I'm using:
#pragma PERSISTENT( FRAM_write ) //#pragma location = 0x4400; unsigned long FRAM_write[ 128 ];
This places FRAM_write in RAM, as seen from the memory map:
output attributes/
section page origin length input sections
-------- ---- ---------- ---------- ----------------
.bss 0 00001c00 0000059a UNINITIALIZED
00001c00 00000200 (.common:FRAM_write)
However, when I use #pragma location to set the location of the variable in FRAM (e.g. at location 0x4400), then it is placed in FRAM.
#pragma PERSISTENT( FRAM_write ) #pragma location = 0x4400; unsigned long FRAM_write[ 128 ];
Here's the memory map, for the above code:
.TI.bound:FRAM_write
* 0 00004400 00000200 UNINITIALIZED
00004400 00000200 main.obj (.TI.bound:FRAM_write)
The only disadvantage of the using #pragma location, is that the FRAM_write buffer is now stepping on some code, since now the code crashes when the buffer is written to using the following test code,
which is executed immediately in main().
memset( FRAM_write, 0xA5, sizeof( FRAM_write ) );
Possibly this is a compiler issue? I'm using msp430_16.9.4.LTS and CCS 7.2.0.
Any help with this issue would be greatly appreciated.
Thanks,
Adam
**Attention** This is a public forum