Espruino code will not push to ESP

Posted on
  • After flashing Espruino onto an ESP32 (screenshot attached), I attempted to push code to the ESP via the Espruino Web IDE Chrome Extension.

    The IDE says it connects fine and says "Sent" after pressing the upload code to ESP button, but no console output is ever given and I am not allowed to type into the console in the left pane.

    Running Windows 10 on this particular machine. Any ideas? I'm sure its a noob mistake as I'm new to esptool and Espruino.


    1 Attachment

    • Espruino Flash.png
  • Have you tried connecting with Putty?

    look here

    Also try putty at 74,480 Baud as some chips start here to display the boot info and switch to 115,200 for the Espruino logo.
    Sometimes you have to exit WedIDE and unplug the chip and start over to clear the problem.

  • It works fine from PuTTy with the expected baud rate of 115200. Where would you recommend I go from here?

    I noticed after trying to send code via the IDE that my ESP would no longer respond through PuTTy either. I believe trying to send code via the IDE "freezes" the ESP for whatever reason. Note, this is not a failure to connect, but rather after connected just sits at a blank console window.

    For reference, my PuTTy output:

    rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
    configsip: 0, SPIWP:0x00
    clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_d­rv:0x00,hd_drv:0x00,wp_drv:0x00
    mode:DIO, clock div:2
    load:0x3fff0008,len:8
    load:0x3fff0010,len:1932
    ho 0 tail 12 room 4
    load:0x40078000,len:10012
    load:0x40080000,len:252
    entry 0x40080034
    
     _____                 _
    |   __|___ ___ ___ _ _|_|___ ___
    |   __|_ -| . |  _| | | |   | . |
    |_____|___|  _|_| |___|_|_|_|___|
              |_| http://espruino.com
     1v95 Copyright 2017 G.Williams
    
    Espruino is Open Source. Our work is supported
    only by sales of official boards and donations:
    http://espruino.com/Donate
    
    >console.log('hi');
    hi
    =undefined
    
  • Try bringing up WebIDE and clicking on the "gear" (settings) in the upper right. Now click on communications and check to see if the baud rate is set to 115,200.

    Here are the batch files I used to flash my Sparkfun ESP-32 Thing board.
    Put them in the same directory as the ESP-32 files. From the file explorer click on the batch files to execute them.
    First find out about the flash memory on the chip by running the ESPinfo.bat file

    :: Read ESP8288 or ESP32 chip info
    set /p pport=Enter a Com port 
    echo %pport%
    pause
    esptool.py --port %pport% --baud 115200 --no-stub chip_id
    esptool.py --port %pport% --baud 115200 --no-stub read_mac
    esptool.py --port %pport% --baud 115200 --no-stub flash_id
    pause
    

    You have to enter the com port as "com3" (no quotes in what you type)

    Next run the batch file EraseFlash.bat

    :: Erase flash
    set /p pport=Enter a Com port 
    echo %pport%
    pause
    esptool.py --port %pport% erase_flash
    pause
    

    Finally run the file FlashESP32.bat

    :: Flash ESP32 chip with Espruino
    set /p pport=Enter a Com port 
    echo %pport%
    pause
    esptool.py --port %pport% --baud 57600 write_flash --flash_freq 40m --flash_mode qio --flash_size 4MB 0x1000 bootloader.bin 0x10000 espruino_esp32.bin 0x8000 partitions_espruino.bin
    pause
    

    I just noticed that you use flash mode dio. I used qio in the batch file.
    ExpressIF produces devices with various flash memory chips that vary in size, speed and spi communications method. That's the difference in qio and dio.
    Figuring out what kind of flash your device has is the basic problem. When I buy a new ESP8266 or ESP-32 I like to use putty to bring up the initial screen using 115,200 and 74,480 baud. The information displayed usually tells me the flash size and spi mode, never seen anyting about the speed. If you do this first you will know what the factory used.
    Here's what I get from Putty and WebIDE after flashing with Espruino. Connect and press reset button on the ESP32 board.

    ets Jun  8 2016 00:22:57
    
    rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
    ets Jun  8 2016 00:22:57
    
    rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
    configsip: 0, SPIWP:0x00
    clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_d­rv:0x00,hd_drv:0x00,wp_drv:0x00
    mode:QIO, clock div:2
    load:0x3fff0008,len:8
    load:0x3fff0010,len:1932
    ho 0 tail 12 room 4
    load:0x40078000,len:10012
    load:0x40080000,len:252
    entry 0x40080034
    
     _____                 _
    |   __|___ ___ ___ _ _|_|___ ___
    |   __|_ -| . |  _| | | |   | . |
    |_____|___|  _|_| |___|_|_|_|___|
              |_| http://espruino.com
     1v95 Copyright 2017 G.Williams
    Espruino is Open Source. Our work is supported
    only by sales of official boards and donations:
    http://espruino.com/Donate
    

    Here's the output at 74480 Baud of an ESP8266-12 using Putty.

     ets Jan  8 2013,rst cause:2, boot mode:(3,7)
    
    load 0x40100000, len 2408, room 16
    tail 8
    chksum 0xe5
    load 0x3ffe8000, len 776, room 0
    tail 8
    chksum 0x84
    load 0x3ffe8310, len 632, room 0
    tail 8
    chksum 0xd8
    csum 0xd8
    
    2nd boot version : 1.6
      SPI Speed      : 40MHz
      SPI Mode       : DIO
      SPI Flash Size & Map: 32Mbit(1024KB+1024KB)
    jump to run user1 @ 1000
    
    rf cal sector: 128
    (Then it switches to 115,200 and you get garbage)
    

    A question for @MaBe. Does the memory size 4MB-c1 apply to ESP-32?

  • doh!

    I am so sorry to waste everyone's time, especially yours. It was a matter of setting the proper baud rate in Settings > Communication.

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

Espruino code will not push to ESP

Posted by Avatar for espftw @espftw

Actions