Content originally posted in LPCWare by GregDavies on Mon Aug 31 11:50:52 MST 2015
I have an application running on an LPC4357 that uses EEPROM to store configuration. Sometimes when I turn on the device, it will read all 0s from the EEPROM (not xFF as in uninitialized state). I'm using the 2.04 version of LPCOpen, but I don't see any changes related to EEPROM in the new version. The code calls Chip_EEPROM_Init() then starts reading configuration data, and works fine on most of the units most of the time.
I've been making the problem show up more often by making the power bounce a lot as it's turning on (wiggling the AC cable as I plug it in). I realize that's not a good characterization, but it's a good indication it may be power related. I've never seen this issue come up when I use the reset line instead.
I've tried calling Chip_EEPROM_DeInit() before the init call, or in various combinations before and/or after reading 0s, but it seems to have no effect.
One thing that I did notice is that as soon as I do a Chip_EEPROM_EraseProgramPage(), the EEPROM reads normally again. I've worked around the issue for now by doing an erase/program without writing any data after initializing the EEPROM, and it works every time, but I still don't understand what the problem actually is, to know if I've solved it for good.
We've seen this behaviour on one other unit (seeing it in about 1 out of 50-200 units). I figure at this rate someone else must have seen and fixed this same problem. Any insights?