-
• #2
No...
reset()
thensave()
has almost the same effect.What's
list()
? Or did you meanload()
? -
• #3
ups, yes I mean load()
can you please change the title ?
-
• #4
No problem :)
-
• #5
reset()
thensave()
has almost the same effect... as aclear()
would have.Would it be possible to actually make it this way? ...because after a first
save()
on a flashed Espruinoreset()
always leaves residues. Only a re-flash gets you back to the realy clean slate... state. The startup is different with the residues.What ere these few hundred bytes that still are saved anyway after a
reset ()
? -
• #6
AFAIK, some bytes are still occupied holding the (command) history for the Web IDE.
Source: http://forum.espruino.com/comments/12713514/
Also, try adding: global["\xFF"].history=[];
It's a hack but it removes the command history - something that could have been using memory that would have stopped you saving. -
• #7
After
reset();save();
the only command history left will be that of you typingsave()
. While there may seem to be a few hundred bytes used most of that is just an artefact of compressing ~80kB of zeros.I think you'll find that
reset();save()
reports almost exactly the same number of bytes used as if you just flashed a fresh Espruino image and typedsave()
-
• #8
On ESP8266 there are some lines of code after reset() coming from jshReset(), so
reset();save();
is not a appropriate option.The reason behind this is, that saved code caused trouble on ESP8266 when updating to a new release in the past. Sure "erase_flash" is an option, but works only over serial connection AFAIK.
But
require("Flash").erasePage(addr);
will do.So this is my
clear();
var clear = function() { require('Flash').erasePage(your_save_code_page); }; >clear(); =undefined >load(); =undefined No code in flash! >
I purposely did not name addr. If this is helpful for you, than lookup it up at the Espruino ESP8266 board documentation page section "SAVING CODE TO FLASH"
-
• #9
Thanks - if you want to do it when you flash a new firmware, you could just add a line to flash blank.bin to the correct place to overwrite your saved code.
If we had a 1Mb image file that could just be written to the device (like you can with the 512k one) it'd solve a lot of this trouble
-
• #11
A 1MB file would damage a lot of sections with special ESP setting, what causes a bricked ESP that has to be flash with the original AT firmware to unbrick.
-
• #12
Are you sure about that? The 512k combined image works perfectly
-
• #13
Not sure, I only know for sure that there is a size limit of 479232 bytes for a single image file for ESPs.
-
• #14
just changed the tile because with 1v94
reset(true)
is the one that can be used to erase save pages.
Is it planed to have clear() to erase saved program code ?