You are reading a single comment by @MaBe and its replies. Click here to read the full conversation.
  • but the issue still happened when I do the same actions

    Please share snippet to reproduce it.

  • To reproduce it, you need to:
    (1).Get a string, length about 1000(I download string from WebSocket).
    (2).

    fs = require("Storage");
    fs.erase("aName");
    fs.write("aName", thatString);
    

    (3). Code in .boot0:

    if(fs.getFree()<4096) fs.compact();
    

    if the free space did less than 4096 and compact() has run and reboot itself after compact, then run fs.compact(); again, if those actions right, you will lost all data in flash.

  • So according to this issue, I guess flash must have an amount of the abandoned data before running compact, if not, the compact function will cause data loss.

About

Avatar for MaBe @MaBe started