Forums

Using flash program memory for non-volatile storage in 56/F800E family

Started by rodr...@yahoo.com.br August 6, 2007
Hi all,
If possible, I would like to get some help with the following issue:

I'm using the DEMO56F8014 EVM board, which is shipped with an 56F8014 DSC, CodeWarrior 5.6 and Processor Expert 2.96 for 56/F800E family.

With this configuration, I need do use a given amount of the flash program memory as a non-volatile memory storage, to emulate EEPROM features. In my case, this non-volatile memory must store the operational configuration of my embedded software and also an even greater amount of data. Both these "portions" of data must be retrieved during reboots and may be modified during the embedded software run-time.

After some researching in libraries of references/documents, I found two possibilities:

1 - To use flash memory program variables, as is said in the documents Targeting_56800E.pdf and by the video PMEMDATA.wmv;

2 - To declaring a new section of program flash memory (splitting the program memory) and use it in companion of one Processor Expert Memory Bean or a SDK library to read an write from/to this section of program flash memory.
The first possibility was already tested by me, but I noticed that if I declare a flash program memory variable, its content, even modified during run-time, is not updated in program memory.

An example:

__pmem int viTest = 1; // variable in flash program memory.

int main()
{
word viAux;
...
viTest = 10; // Does not work!!!!!!!!
viAux = viTest // "viAux" receives 1 even after the last statement
...
}

Once its seems not work, I would like to test the second possibility. So,
I would like to now if anyone could give some directions about what document I should read and what to do to implement the second possibility....

Any direction will be appreciated.

Thank you,
Rodrigo
Hi Rodrigo,

I think this is a general understanding problem with flash memory.
You can use of course variables defined as flash vars; but modifying them won't work, since you need to write the flash content which is way more complicated than RAM operations.

There are 4 rules:
1) Erased bits are always "1"
2) You can only turn "1" bits into "0"
3) To reset the content (set to "1") you have to erase a full flash page.
4) Write and erase operations go through programming the flash controller.

For the "normal" usage, you can treat flash variables as constants.
If you want to use the flash content as a NVRAM storage, you should copy its content into the RAM; use in in from the RAM, and when you want to store them, erase the flash and copy the RAM content into the desired Flash area.

BR,
George




-----Ursprgliche Nachricht-----
Von: m... [mailto:m...] Im Auftrag von r...@yahoo.com.br
Gesendet: Freitag, 3. August 2007 18:13
An: m...
Betreff: [motoroladsp] Using flash program memory for non-volatile storage in 56/F800E family



Hi all,

If possible, I would like to get some help with the following issue:

I'm using the DEMO56F8014 EVM board, which is shipped with an 56F8014 DSC, CodeWarrior 5.6 and Processor Expert 2.96 for 56/F800E family.

With this configuration, I need do use a given amount of the flash program memory as a non-volatile memory storage, to emulate EEPROM features. In my case, this non-volatile memory must store the operational configuration of my embedded software and also an even greater amount of data. Both these "portions" of data must be retrieved during reboots and may be modified during the embedded software run-time.

After some researching in libraries of references/documents, I found two possibilities:

1 - To use flash memory program variables, as is said in the documents Targeting_56800E.pdf and by the video PMEMDATA.wmv;

2 - To declaring a new section of program flash memory (splitting the program memory) and use it in companion of one Processor Expert Memory Bean or a SDK library to read an write from/to this section of program flash memory.

The first possibility was already tested by me, but I noticed that if I declare a flash program memory variable, its content, even modified during run-time, is not updated in program memory.

An example:

__pmem int viTest = 1; // variable in flash program memory.

int main()
{
word viAux;
...
viTest = 10; // Does not work!!!!!!!!
viAux = viTest // "viAux" receives 1 even after the last statement
...
}

Once its seems not work, I would like to test the second possibility. So,
I would like to now if anyone could give some directions about what document I should read and what to do to implement the second possibility....

Any direction will be appreciated.

Thank you,
Rodrigo