cancel
Showing results for 
Search instead for 
Did you mean: 

Writing to Bank0 Sectors 5 - 7 of STR71xFR2 without erase

tyronevs
Associate II
Posted on December 19, 2007 at 08:32

Writing to Bank0 Sectors 5 - 7 of STR71xFR2 without erase

2 REPLIES 2
tyronevs
Associate II
Posted on December 19, 2007 at 08:16

Hi all,

I need to be able to write(change) data in the upper part of the flash that I am using as NV storage. The problem is that I cannot afford to erase the sector as I don't have enough RAM to store the contents in while erasing the entire 64K block.

I receive the 1 over 0 error when I try to modify the data in flash. (Which is right according to the datasheet)

Can anyone advise me on this?

Regards

:-[

kleshov
Associate II
Posted on December 19, 2007 at 08:32

Correct, you cannot write a 1 over 0 without erasing the whole sector. What you are trying to achieve is called 'EEPROM emulation in flash'. There is an excellent application note on the subject from ST:

http://eu.st.com/stonline/products/literature/an/13455.pdf

The main idea is to use two flash sectors: when you are erasing one of them, the data is stored in another. The rest of it is a lot of logic to deal with unexpected power outages.