EmbeddedRelated.com
Forums
Memfault Beyond the Launch

EEPROM guarantees after power loss during a write

Started by John Devereux February 5, 2008
Arlet <usenet+5@c-scape.nl> writes:

> On Feb 8, 11:58 am, John Devereux <jdREM...@THISdevereux.me.uk> wrote: > >> I would still love to know, for sure, that a write to part of a page >> does not involve an internal erasure of the entire page. Without >> knowing this each version stamp needs a page of its own as far as I >> can see. The act of writing the version number must be guaranteed not >> to upset the data it refers to, if it gets interrupted. >> >> I think I will have to try and test this. > > To test the system, you could make a simple test jig that switches the > power to your board. Use another controller to switch the power in > random intervals. The random interval timing should match the > discharge rate of the power supply capacitors such that the board > suffers a lot of brown out conditions. Add an extra R/C filter if > necessary. > > On the device you're testing, set up some special firmware that > continously writes updates to the EEPROM. Instead of real data, write > a verifiable test pattern, and have the software check it regularly. > If it finds corrupted data in a 'valid' block, trigger an alarm. > > Then leave the test setup in a corner of the lab, 24/7.
That sounds like a good idea to test a finished routine. But to get the initial information needed to write it, I am thinking of this: - Hack the electronics so the EEPROM can be powered from an output pin - hack my eeprom_write routine so that a timer can interrupt power to the EEPROM and hold the I2C pins low (so the eeprom is definitely unpowered). That allows the timer to interrupt programming using a precise time delay that I can sweep though a range of values. For each value I can - print the eeprom page contents (to a serial port) - reprogram the entire page with a test pattern - start the timer and the page programming test (different pattern, only alters part of page) I should be able to see any partial erasures, partial programming, and also any erasure of bytes on the same page outside of the program area. Perhaps I would printout extra regions like address 0 and parts of adjacent pages. This does not simulate a real system since there is no "brownout" state. So I still need something like your setup as a final verification. -- John Devereux

Memfault Beyond the Launch