Bangle2 Flash storage corruption

Posted on
  • Last night I was watching the TV and glanced at my watch. It was showing UTC time instead of my correct local time. I don't remember there being any problems the last time I had looked at it.

    I checked the settings and the locale offset was still correct, but changing it wouldn't fix the display.

    I tried resetting the watch and the boot sequence showed something like "flash corrupt" and it proceeded to erase the watch. Eventually it restarted reset back to a fresh factory install.

    I've since reverted back to the "Release" 2v12.

    I don't recall doing anything differently that I hadn't done before. It just became "not working" all by itself.

    All seems good now, this is more of an "FYI" than anything else.

  • Ok - is this the first time it's happened to you since upgrading to (or past) 2v12?

    Someone else posted up basically the exact same thing last week.

    Basically: 2v11 had a bug where if the flash storage got corrupted (and it happened to be arranged in a certain way) then some flash memory wasn't erased that should have been.

    2v12 fixed that, but if your storage already had that bit of unerased memory in it from the 2v11 bug, as storage gets more and more full you'll eventually hit that unerased data, everything gets corrupted, and you'll see the problem you had.

    But hopefully now Storage has been completely erased - properly - you won't see the problem again

  • The watch on question was shipped since the Kickstarter - early January I think. So it's possible it came with 2v11, but I can't remember.

    It's only happened the once, so hopefully it's now sorted itself out.

  • Well, that'll teach me to speak too soon. Someone just found an issue in the 2v12 firmware that can occur if you Bangle compacts itself automatically because storage is full.

    It's now fixed in the latest cutting edge builds though

  • I've got two Bangle2s - one from you (the one that started this thread), the other is a dodgy one I got direct from SMA and flashed myself. That second one just now got itself tied up in knots trying to upgrade the firmware. On rebooting it declared "corrupt storage" and erased itself. After restarting when I tried the firmware upgrade again it worked.

    Neither of these watches has come close to filling storage. They both report over 6500K free.

    I could be wrong, but I get the impression that Flash starts out in an erased 'pristine' state and is written to over time. When data is changed, the old data is considered 'free' but is not actually erased. Writing continues to pristine memory until that inevitably runs out. Then the old (free) data is actually erased and put into a 'pristine' state that can be reused - this being that compact process.

    I guess what I'm now asking in a very roundabout way is - even if my Bangles have always reported over 6500K free at all times - will they eventually hit this compact corruption issue?

  • even if my Bangles have always reported over 6500K free at all times - will they eventually hit this compact corruption issue?

    No, they won't hit the compact issue I just fixed (that only occurs if the compact happens because storage was completely full I believe).

    Bangle.js starts at the beginning of Storage and works through, using it up - it assumes that any page after what it's used up is erased. The issue occurs when that Storage that should have been empty isn't.

  • Just happened to me this morning, time was set to UTC, and it wiped all the storage.

    Firmware: 2v12
    Bootloader: 2v12

    I upgraded my KS bootloader not that long ago.

    I see there's a 2v13 firmware, I guess this would be a good time to apply that.

  • I see there's a 2v13 firmware, I guess this would be a good time to apply that.

    Yes, I think so. There was a bug fixed that would have caused exactly this issue

  • Last night I tried to update apps on my watch running the original release 2v13 firmware for the first time in one or two weeks. They did not succeed.

    I was only able to try with my Android phone. Each time I attempted to update an app it appeared to start off OK, but I never got the green 'success' popup at the bottom of the screen. I tried the LCARS clock app first, then the Messages app. Both were broken afterwards and would not work.

    I was only after a few attempts retrying the update that the Bangle2 suddenly reset and showed a "storage corrupt" message and erased everything!

    Prior to all this there had been no indication that anything was wrong. After it restarted I upgraded to 2V13.19 and started restoring my watch.

    I can't remember exactly what I had installed, but it included:

    • Messages & Android Integration
    • my 2FA Authenticator
    • LCARS clock
    • Timer Clock
    • Digital clock widget
    • Bluetooth widget
    • Pedometer widget

    Sorry I don't have anything more useful. It wiped itself out before I could try anything else.

  • Ok, thanks - sorry about that.

    When was the last time you'd done a 'factory reset' on your Bangle? It's actually possible that there was stuff written into Storage halfway through because of a bug in a previous firmware, and you just hit it with the new one

  • I can't clearly remember when I last did a 'factory reset', but it was probably around the time I upgraded from 2v12 to 2v13. From memory my 2v12 had crashed with 'storage corrupt' and when it finished erasing and restarting I upgraded to 2v13 before restoring my apps and stuff.

    I don't really understand how corruption that might have occurred days or even weeks ago can end up with such fatal results - complete erasure of the watch. 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. When the write routines get to the first address of an erasable block, that block is erased before the writes continue.

    However, I recognise that emulating a file system is quite different from simple linear data logging.

  • 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.

  • Seems to be working well so far, in fact it feels more responsive. I recall that maybe a day or twoefore the storage corruption, the watch was awfully slow at showing up incoming messages (like around 4-5 seconds).

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Bangle2 Flash storage corruption

Posted by Avatar for andrewg_oz @andrewg_oz

Actions