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.
Hi all,
Currently, I would like to store the data into an array, and I have allocated that array into flash whose address is 0x10200 (I use MSP430F5438).
However, I cannot get the address of that array correctly because compiler always converts 0x10200 into 0x00200, which obviously will give me a incorrect writing or reading.
My code is shown below:
#pragma DATA_SECTION (array, "memory section starts at 0x10200"); // Allocate array into the flash whose address is 0x10200
UBYTE array[size];
void main(void)
{
char *ptr;
ptr = (char *)(array); // Read the address of the array - here ptr will be set to 0x00200 rather than 0x10200
FLASH_WriteByte(ptr, 0xAA); // Write 0xAA to the array - I cannot successfully write 0xAA to that array
}
By the way, if I set the value of array size to 0x10000 (64K), the compiler would give me an "array size is too large" error.
how do I avoid this problem?
So, is anyone able to give me some help about thoes problems?
Thanks!
Liu
Hi milanqingren,
I'm assuming you're using the CCE IDE. Pls refer to the Users Manual (slau132c.pdf; http://focus.ti.com/lit/ug/slau132c/slau132c.pdf) page 94, par. 6.1.1 LARGE-CODE MEMORY MODEL and par. 6.1.2 LARGE-DATA MEMORY MODEL.
The F5438 is a MSP430X device, so the --silicon_version=mspx is set when creating a project for this device. Your example will also require the --large_memory model option to be set.
So, pls check your project propetries for that! To do so, go to PROJECT-->PROPERTIES-->RUNTIME MODEL OPTIONS and set the --large_memory model option.
Rgds
aBUGSworstnightmare
Hi,
your #pragma DATA_SECTION looks a little strange to me! Pls have a look at this: http://e2e.ti.com/forums/t/4649.aspx.
G**kbuster
Thanks aBUGSworstnightmare!
After putting complier into LARGE-DATA MEMORY MODEL, I am able to write data to the flash.
Liu
**Attention** This is a public forum