Open geeksville opened 6 days ago
I might (hopefully will) look into this in a week or two.
This same corruption probably exposed #4167 a couple of days ago.
hmm this is less that perfect (though quite possibly unrelated to the problem):
// brief window of risk here ;-)
if (FSCom.exists(filename) && !FSCom.remove(filename)) {
LOG_WARN("Can't remove old pref file\n");
}
if (!renameFile(filenameTmp.c_str(), filename)) {
LOG_ERROR("Error: can't rename new pref file\n");
}
We could eliminate this window of risk by renaming the file.new to be file.good, then remove file, then rename file.good to be filename (a 3 stage commit). Then at load time if we ever see a file.good existing, we know that we lost power during that window and file.good should be used instead of file (and file should be deleted at that point.
But this might not actually be the bug, so I'll wait until I look into this and somehow make a reproducable failure.
Category
Other
Hardware
Other
Firmware Version
2.3.14.c67a9dfe
Description
I bet it is not wm1110 specific. Occurred while doing hundreds of power cycles.
I bet the best way to find/fix it is to turn off our "if config read fails or is corrupted completely factory reset and try again". Instead we should spin inside the ICE debugger.
Notes from chat:
Relevant log output
No response