You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • If you're going to be writing to some new part of the memory, wouldn't it get erased first? That's how I handle Flash chips in my data logger.

    In your data logger, what happens when it first starts up? How does it know where it should start writing data from?

    It's just a lot easier/safer for Espruino to assume flash is clear, because unless something bad has happened it should be.

    I don't really understand how corruption that might have occurred days or even weeks ago can end up with such fatal results

    To be honest it doesn't have to be so fatal (it could just cope up with a 'storage corrupt' message and ask if you want to continue or factory reset). The issue is if something goes wrong and it ends up crashing and going into a boot loop, it'll be me that ends up having to pay to send replacement devices to everyone it happens to - so I tend to err on the side of caution to ensure it's able to keep working.

About

Avatar for Gordon @Gordon started