-
• #2
Jens, I assume you entered this in the console pane of the Espruino Web IDE... Doing so may conflict with the sending of the statement(s) / uploading and the execution of them because of the single threaded execution of JavaScript and setup of communication from console to Espruino board and back. Try to paste it in the edit pane and upload the code to the board. If this does not help, place it in a function, upload the function, and then invoke it. Take a look at this conversation. It covers some aspects of what you experience, even thought he conversation title may no read like that to you. Look for the 2 cents posts.
-
• #3
@allObjects, Hi I tried all that you suggested and still have the timeout problem (in the web console pane as well as a program). Any other ideas? Funny seems that when I write a string with a specific length and read it afterwards I get a length number ox 0xff - so the length seemed to be stored somehow.
Thanks
Jens -
• #4
Jens, what board are you using?
-
• #5
A puck.js (received about 1-2 weeks ago) with the 1v90 firmware.
-
• #6
Jens, take a look at this conversation about low level flash access. ...may be you already have... ;/
-
• #7
Hi @allObjects, Yep, I used the very simple example from @MaBe and that is what I get instead of his output:
| __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v90 Copyright 2016 G.Williams >{ "flash": function () { [native code] }, "addr": 471040, "endAddr": 475136 } >Uncaught InternalError: Timeout on jshFlashWrite at line 1 col 62 ...,a.length,a.length>>8,0]),b);b+=4;4!=a.length&&(c=new Uint8A... ^ in function "_write" called from line 2 col 102 ...ory!";this._write(a.end,b,c) ^ in function "write" called from line 1 col 26 f.write(0, 'Hello Flash.'); ^ ÿÿÿÿÿÿÿÿÿÿÿÿ =undefined >
-
• #9
That is strange. I just tried on the 1v90.12 build and it works fine for me - but I guess it's possible that there is some corrupted data already in flash.
Could you try
f.erase();
? -
• #10
Ok, I tried the code below:
// Tested on Puck.js var f = new (require("FlashEEPROM"))(); f.erase(); console.log(f); f.write(0, 'Hello Flash.'); console.log(E.toString(f.read(0)));
and got:
1v90 Copyright 2016 G.Williams >Uncaught InternalError: Timeout on jshFlashErasePage at line 1 col 31 this.flash.erasePage(this.addr) ^ in function "erase" called from line 1 col 9 f.erase(); ^ { "flash": function () { [native code] }, "addr": 471040, "endAddr": 475136 } Uncaught InternalError: Timeout on jshFlashWrite at line 1 col 62 ...,a.length,a.length>>8,0]),b);b+=4;4!=a.length&&(c=new Uint8A... ^ in function "_write" called from line 2 col 102 ...ory!";this._write(a.end,b,c) ^ in function "write" called from line 1 col 26 f.write(0, 'Hello Flash.'); ^ ÿÿÿÿÿÿÿÿÿÿÿÿ =undefined >
Am I doing something stupidly wrong or do I have a faulty puck?
Thanks again
-
• #11
That's really interesting - it could be related to some other problems people have been having with saving to flash.
Have you tried removing the battery from your puck and re-inserting it to power cycle it? It could be that the software has got into a strange state.
-
• #12
Ok, after a power cycle the flash worked as expected again. Unfortunately only for a very short time (after 3-5 more flash write attempts it breaks again).
Hope this can be fixed soon.
Thanks -
• #13
Interesting - thanks for the update. By 'flash write attempts', what do you mean? From a clean power-on, what exactly did you do to get it to happen?
I just uploaded that code repeatedly and I can't reproduce it.
Hi,
Did anyone of you experience the same error?
Thanks
Jens