Wow, that's crazy. I'm just not sure how it can even happen!
Please can you try running the following code and post up the result?
var f = require("Flash");
function getHeader(addr) {
var d = f.read(32,addr);
var d32 = new Uint32Array(d.buffer);
if (d32[0]==0xFFFFFFFF) return undefined;
var h = {
addr : addr,
name : "",
size : d32[0]&0xFFFFFF,
flags : d32[0]>>24
};
for (var i=4;d[i]&&i<d.length;i++)
h.name += String.fromCharCode(d[i]);
return h;
}
function dumpStorage() {
var addr = 0x40000000;
var h = getHeader(addr);
while(h) {
while (h) {
print(h);
addr += ((h.size+3)&~3) + 32;
h = getHeader(addr);
}
addr = (addr&~4095)+4096;
h = getHeader(addr);
if (h) print("NEW PAGE 0x"+addr.toString(16));
}
}
dumpStorage();
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Wow, that's crazy. I'm just not sure how it can even happen!
Please can you try running the following code and post up the result?