We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello,
A colleague of mine needs to maintain the values of variables in non-volatile memory but the only provisions he has is internal flash. He implemented a scheme that uses 7 sectors (LPC1788) and it seems to work but occasionally, some bits get corrupt. The assumption is that same page (256 bytes) can be written again and again as long as no bits are set from 0 to 1 (this is supported by an application note by NXP: www.nxp.com/.../AN11008_Flash_based_non-volatile_storage_with_software.zip). Disabling interrupts during write operations does not help, and besides he mapped his interrupts to RAM as well as the ISRs themselves. Any thoughts...? Thanks in advance.
If you write data in smaller blocks than what the flash use for ECC, and the formware then computes and saves ECC, you can't later change the other bytes part of the same block. While your changes performs the "correct" change between zero and one, the ECC bits will sometimes need to chaneg 1->0 and sometimes 0->1. This not possible without an erase.
And since it isn't a parity (intended to detect errosr) but an ECC, it have the ability to "correct" some errors. So if you do multiple writes, you can get a garbage ECC - and that ECC can result in a "repair" of the actual data bits.
Yes that was the problem! Thanks a lot, one of our clients was/is furious - but at least now there is a prospect for a fix...