-
• #2
well, do you want to flash firmware or transfer jscode or save your code or anything else?
-
• #3
no firmware that's fine. Just trying to upload code and get it to persist across boot (.i.e. move from ram to flash). That's a little sample code above that causes the error.
Actually any code will. The
save()
function I understand moves code from ram to flash so it persists across boots right? Whenever I appendsave()
I get this error.The error occurs when I use
save()
in the webide as well so looks like I am not grokking the purposesave()
since the webide allows one to upload to resettable flash how do I invoke that in the command line? -
• #4
check this conversation
http://forum.espruino.com/conversations/342729/#comment15065783
-
• #5
Looking at the api
kickWatchDog
seems to be only something for official boards so maybe I'm trying to do something not supported on esp32 like usesave
? -
• #6
look's like there is some trash in the save area.
try this to save the sample code and preserve boot.
onInit() { console.log('program started') setInterval(() => {console.log('lubdub')},3E3); } setTimeout(save,1E3);
-
• #7
Seems the espruino tool doesn't have a way to start a terminal session in the same command right after an upload (and save)? so I've been running a second command right afterwards and that's what has been throwing the error whenever save is called
I did use the suggestions from the link you provided to that was helpful.
import {app} from './app.js' const PRODUCTION = false // this will be called on power up, if code was saved function onInit(){ setTimeout(app.call(null,opts),PRODUCTION?0:5000) // wait for possible terminal connect } setTimeout((PRODUCTION)?save:onInit,1000)
So I guess my question is how does one start a terminal session after upload (no save) in order to see the beginning stdout output. Alternatively I suppose I could send stdout tee'd to a file and view the file after connect (I have no clue how to do that on esp32)
I guess in general I'm used to my nodejs 14+ coding degugging/workflow under linux (i.e. full sbc running linux and nodejs) so I have some learning regards rolling up of es2017+ and then debugging and logging code on the esp32 device. Although the webide is fine I'm only interested in using my dev IDE's that being Atom and VsCode and writing in 2017+. That explains why I am using the cli directly.
Thx for you input @MaBe
Running esp32 wroom
trying to flash from the cli
results in this error and the code is not written to flash.
code and cli command
espruino --port /dev/ttyUSB0 -b 115200 --no-ble --board ../boards/ESP32.json
I was able to flash from the webIDE so it must be something particular to my direct use of the cli.
I must be missing some setting?
Related: Maybe the json job file is the way to go so I can set config details other than from "switches. Does the job file merge with defaults so I can just set those I need or do I have to set all values if I use it. Can I still use command line switches with a job file? ex. the --board switch as it seems the config for board only takes a url not a local path.