Ok, I'm just running this code (writing to multiple files, 100 times a second) on an MDBT42Q with firmware 2v09 and we'll see if it breaks:
function log(){"ram"
var f = "log"+Math.floor(Math.random()*8)+".txt";
if (require("Storage").read(f) == "undefined") {
require("Storage").write(f,'1');
}else{
var n=parseInt(require("Storage").read(f))+1;
n=n.toString();
require("Storage").write(f,n);
}
}
require("Storage").write("A","Hello World");
setInterval(log, 10);
require("Storage").write("B","Yet another bit of data for us to store");
setInterval('print(require("Storage").getFree(), require("Storage").list())', 2000);
However it did get me thinking - are you using a watchdog timer? While we should kick the watchdog often enough, I guess if you used a small timeout then it's possible that the device would reboot itself during the compaction phase.
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.
Ok, I'm just running this code (writing to multiple files, 100 times a second) on an MDBT42Q with firmware 2v09 and we'll see if it breaks:
However it did get me thinking - are you using a watchdog timer? While we should kick the watchdog often enough, I guess if you used a small timeout then it's possible that the device would reboot itself during the compaction phase.