-
• #2
try
reset();save();
-
• #3
Thanks. Just tried.
Same result.
dump() still shows the old code... -
• #4
hmm
_____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v89 Copyright 2016 G.Williams >u32 = new Uint32Array(4); =new Uint32Array(4) >u32[0] = 32; =32 >save(); =undefined Erasing Flash..... Writing.... Compressed 32000 bytes to 1373 Checking... Done! >dump(); var u32 = new Uint32Array([32, 0, 0, 0]); pinMode(D29, "input_pulldown", true); =undefined >reset(); =undefined _____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v89 Copyright 2016 G.Williams >save(); =undefined Erasing Flash..... Writing.... Compressed 32000 bytes to 1181 Checking... Done! >dump(); pinMode(D29, "input_pulldown", true); =undefined >
only one line for a pinMode() coming from reset();
-
• #5
Maybe it's the WebIDE?
Chrome Version 54.0.2840.98 (64-bit) on OSX 10.11.6 here with WebIDE.I played around with Settings->Communications->Save on Send.
When it is set to "Yes, even execute after 'reset()'" I can remove the code when:- putting on dummy line like
var foo;
on the right hand pane - click "Send to Espruino"
Simple example:
>dump(); function onInit() {digitalPulse(LED1, 1, 100);} pinMode(D29, "input_pulldown", true); =undefined
Not working:
>reset();save(); =undefined Running onInit()... _____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v88 Copyright 2016 G.Williams Erasing Flash..... Writing.... Compressed 32000 bytes to 1222 Checking... Done! Running onInit()... >dump(); function onInit() {digitalPulse(LED1, 1, 100);} pinMode(D29, "input_pulldown", true); =undefined
Putting this into the right hand pane finally kills the code (actually it replaces the current code by some dummy code):
var foo;
Send and check:
>Erasing Flash..... Writing... Compressed 32000 bytes to 17 Checking... Done! Loading 17 bytes from flash... =undefined >dump(); var foo = undefined; pinMode(D29, "input_pulldown", true); =undefined
This is strange...
- putting on dummy line like
-
• #7
I suppose
reset();
is done by the IDE and you can see it works - somehow.
The second puck was still 1v88 - you are right.
But it is the same with 1v89. -
• #8
getting worse now after playing around with HID:
>reset(); =undefined _____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v89 Copyright 2016 G.Williams Uncaught SyntaxError: Got ?[255] expected EOF at line 1 col 1 ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ... ^
Question:
How can I reset the puck's memory to factory default?
reset()
doesn't seem to work or have side effects. -
• #10
It's because of the
Save on Send
that was set in your IDE - obviously if you set it toYes, even execute after 'reset()'
then reset wont work :)To force it to be removed, just run
E.setBootCode()
without arguments - it's the same for all Espruino boards. I'm wondering where the best place to add that to the docs is? -
• #11
Oops - was missing that - Thank Gordon !
Yesterday my 5 pucks arrived. @gordon - superb!
Started to play around a bit and just got stuck at a thing that happened to my pico before:
I tried out a demo, now I want to get rid of it.
So I connect and do this:
Call reset() to kill it:
Call save() to persist the "clean" state:
Should be gone now, or not?
But look here - still there:
So - how can I get rid of the running code?
Maybe I did not understand the concept of reset() and save() properly...