Skip to main content
tyronevs
Associate II
December 19, 2007
Question

Writing to Bank0 Sectors 5 - 7 of STR71xFR2 without erase

  • December 19, 2007
  • 2 replies
  • 869 views
Posted on December 19, 2007 at 08:32

Writing to Bank0 Sectors 5 - 7 of STR71xFR2 without erase

This topic has been closed for replies.

2 replies

tyronevs
tyronevsAuthor
Associate II
December 19, 2007
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
December 19, 2007
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.