flash fails from cli

Posted on
  • Running esp32 wroom

    trying to flash from the cli
    results in this error and the code is not written to flash.

    --] Compacting Flash...
    --] ERROR: >> jshKickWatchDog Not implemented,using taskwatchdog from RTOS

    code and cli command

    console.log('program started')

    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.

  • well, do you want to flash firmware or transfer jscode or save your code or anything else?

  • 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 append save() I get this error.

    The error occurs when I use save() in the webide as well so looks like I am not grokking the purpose save() since the webide allows one to upload to resettable flash how do I invoke that in the command line?

  • 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 use save?

  • 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);
  • 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),PRODUCTIO­N?0:5000)  // wait for possible terminal connect

    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

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

flash fails from cli

Posted by Avatar for dgk @dgk