From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerry Van Baren Date: Tue, 1 Feb 2005 17:13:19 -0500 Subject: [U-Boot-Users] Flash environment vs EEPROM environment In-Reply-To: <200502012228.57451.roger.larsson@norran.net> References: <20050201184555.1463BC108D@atlas.denx.de> <41FFD322.4030401@smiths-aerospace.com> <200502012228.57451.roger.larsson@norran.net> Message-ID: <41FFFEFF.9060706@smiths-aerospace.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Roger Larsson wrote: > On Tuesday 01 February 2005 20.06, Jerry Van Baren wrote: > >>Wolfgang Denk wrote: >> >>>Dear Thomas, >>> >>>in message > > you wrote: > >>>>Yes, I know that this has been discussed recently and the recommendation >>>>is to store the environment in flash, but: >>> >>>Indeed. >> >>[snip] >> >> >>>>- Are there conditions known to cause similar effects with flash chips >>>>as described for EEPROM devices? Could power loss or similar conditions >>> >>>No. >>> >>> >>>>when writing environment sectors cause a flash device to destroy other >>>>sectors than the just written one? >>> >>>In theory yes. You could assume a system without power monitoring >>>where the power is failing slowly so that at some point during the >>>brownout the CPU migth start executing bogus insructions, or that >>>some bus driver corrupts the addresses or data, or... In theory >>>anything can happen. >>> >>>Best regards, >>> >>>Wolfgang Denk >> >>Flash corruption is more than in theory: proper hardware design is to >>have a power fail warning sufficient to allow a flash write cycle to >>complete before power completely fails and your software should not >>write to the flash when the power fail warning is active. > > > I assume this is true for all flash CHIPS and not only higher level > assemblies like Compact Flash (that I read can be destroyed if written > to when power fails) > > /RogerL Correct. My experience is actually with bare flash chips (NAND and NOR). Assemblies will inherit the problems (to the best of my knowledge). Since most applications write rarely and diabolical power glitches happen even rarer (except in our labs where we have a diabolical glitch machine for testing :-), most people get away without taking special precautions (power failure warnings). I've seen a CF marketing sheet (I forgot which manufacturer offhand) which bragged that their CF would not get corrupted if power were removed "unexpectedly", but in the fine print it stated that power had to be held up for some period of time (basically a write cycle time) after a write. Of course, that requires a power failure warning ;-). Always read the fine print :-). Incidentally, I have never seen a bare flash chip be destroyed. I believe what happens with CF et al. assemblies is that the metadata gets corrupted and the CF controller gets confused, turning it into a brick (well, more like a skipping stone). I understand you can do a low level format to recover them. A quick google search turned up: http://www.sandisk.com/retail/rescuepro.asp http://www.lc-tech.com/rescuepro.htm gvb