Description
I've noticed an odd but somewhat nasty issue that appears to be reproducible. With Circuit Playground Express (but perhaps other M0 express and maybe M0 basic boards) if my project uses a lipo battery that runs low enough to brownout and turn off, after I swap in a new battery the entire SPI flash is erased and my old program is gone. It's happened twice in a row with my arc reactor project, and I have a feeling it always happens when power goes low like this (I've only ever run the battery completely dead twice and both times the FS was destroyed on next power up). My suspicion is in the low voltage or brownout state perhaps the SPI flash chip isn't readable and the board brownout resets, fails to read the flash, and assumes the FS is bad and erases it all (or maybe the FS was actually corrupted during the brownout).
Opening this as an issue for now to investigate further. I think we want to setup a board with a bench supply to VBAT and start it at 3.3 volts, then lower it bit by bit into brownout mode (probably around 2.5 volts or so) and see if it repros for easier investigation. I'm not sure there's a fix but if we can understand what's happening better perhaps there are workarounds or ways to prevent the FS from being destroyed.