-
• #2
A number of threads on this. See http://forum.espruino.com/conversations/275173/#comment12543052
-
• #3
@CanyonCasa I could be totally wrong here, but from the way @urbiman said "bake javascript into the firmware" leads me to believe he wants to compile a binary of Epruino with some javascript embedded so when he flashes it to a chip it already has the code on it and doesn't need to then be programmed by the WebIDE. Though I could be wrong.
-
• #5
Sorry for the misunderstanding. I don't know how or if possible, but I would suggest looking at Espruino tools (i.e. npm install espruino). I just recently started using the command line. If you can't do it directly you can probably add on a processor or plugin to get there.
-
• #6
Upload your code via the ide, and test. Then you can use a command line tool to save the save area of eprom to a file - which board are you using as the method would be different for each board.
Also - the saved code might not work on a new version of the firmware, as the addresses of functions can change - so any
oninit()
might not work correctly with an updated firmware. -
• #7
Thanks @Wilberforce , can you maybe point me to a list or other source where I can find the area where the code is stored?
-
• #8
As @Wilberforce says, I'd suggest just getting it working, using
save()
orE.setBootCode()
, then reading out the complete contents flash memory. You can then write that to any new devices - of course how you do that depends on the device you're using :)If you're compiling yourself you can compile in JS code to get executed pretty easily too, but it's realistically more painful than just reading what's in flash memory
Is there any way to bake JavaScript into the firmware so it gets flashed with the firmware? I mean a JavaScript that gets executed after startup of the chip just like if I would have transferred it using the IDE?