Espruino on ESP32

Posted on
of 3
First Prev
/ 3
  • I just recieved my esp32 supporting board, soldered ESP-32S (blue one).

    when powering up i got this in a serial terminal:

    rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
    configsip: 0, SPIWP:0x00
    mode:DIO, clock div:2
    entry 0x400981dc
    I (26) boot: Espressif ESP32 2nd stage bootloader v. V0.1
    I (33) boot: compile time 09:30:50
    D (54) boot: mmu set paddr=00000000 count=1
    D (54) boot: magic e9
    D (54) boot: blocks 04
    D (54) boot: spi_mode 02
    D (54) boot: spi_speed 00
    D (56) boot: spi_size 02
    I (60) boot: SPI Speed      : 40MHz
    I (65) boot: SPI Mode       : DIO
    I (69) boot: SPI Flash Size : 4MB
    I (74) boot: Partition Table:
    I (78) boot: ## Label            Usage          Type ST Offset   Length
    D (87) boot: load partition table entry from 4000(3f404000)
    D (95) boot: type=0 subtype=0
    I (99) boot:  0 factory          factory app      00 00 00010000 00100000
    D (109) boot: load partition table entry from 4020(3f404020)
    D (117) boot: type=1 subtype=1
    I (121) boot:  1 rfdata           RF data          01 01 00110000 00040000
    D (131) boot: load partition table entry from 4040(3f404040)
    D (139) boot: type=1 subtype=2
    I (143) boot:  2 wifidata         WiFi data        01 02 00150000 00040000
    D (153) boot: load partition table entry from 4060(3f404060)
    D (161) boot: type=ff subtype=ff
    I (165) boot: End of partition table
    I (170) boot: Loading app partition at offset 00010000
    D (177) boot: mmu set paddr=00010000 count=16
    D (183) boot: bin_header: 233 8 2 2 40080780
    I (189) boot: section 0: paddr=0x00000020 vaddr=0x00000000 size=0x0ffe8 ( 65512) 
    D (200) boot: found drom section, map from 00010010 to 3f400010
    I (208) boot: section 1: paddr=0x00010010 vaddr=0x3f400010 size=0x05b84 ( 23428) map
    I (220) boot: section 2: paddr=0x00015b9c vaddr=0x3ffbf100 size=0x0130c (  4876) load
                                                                     @I (280) heap_alloc_caps: Initializing heap allocator:
    I (280) heap_alloc_caps: Region 19: 3FFC040C len 0001FBF4 tag 0
    I (284) heap_alloc_caps: Region 23: 3FFE8000 len 00010000 tag 1
    check b=0x3ffc0418 size=130008 ok
    check b=0x3ffdfff0 size=0 ok
    check b=0x3ffe800c size=65508 ok
    I (306) cpu_start: Pro cpu up.
    I (310) cpu_start: Single core mode
    I (315) cpu_start: Pro cpu start user code
    rtc v112 Sep 26 2016 22:32:10
    XTAL 40M
    I (348) cpu_start: Starting scheduler on PRO CPU.
    D (350) nvs: init start=6 count=3
    D (353) nvs: nvs_open misc 1
    D (354) nvs: nvs_get_str_or_blob log
    frc2_timer_task_hdl:3ffc4290, prio:22, stack:2048
    tcpip_task_hdlxxx : 3ffc4ec4, prio:18,stack:2048
    phy_version: 123, Sep 13 2016, 20:01:58, 0
    D (486) nvs: nvs_open nvs.net80211 1
    D (486) nvs: nvs_get opmode 1
    D (486) nvs: nvs_get country 1
    D (487) nvs: nvs_get_str_or_blob sta.ssid
    D (491) nvs: nvs_get_str_or_blob sta.mac
    D (494) nvs: nvs_get sta.authmode 1
    D (497) nvs: nvs_get_str_or_blob sta.pswd
    D (501) nvs: nvs_get_str_or_blob sta.pmk
    D (505) nvs: nvs_get sta.chan 1
    D (508) nvs: nvs_get auto.conn 1
    D (511) nvs: nvs_get bssid.set 1
    D (514) nvs: nvs_get_str_or_blob sta.bssid
    D (517) nvs: nvs_get sta.phym 1
    D (520) nvs: nvs_get sta.phybw 1
    D (523) nvs: nvs_get_str_or_blob sta.apsw
    D (527) nvs: nvs_get_str_or_blob sta.apinfo
    D (531) nvs: nvs_get_str_or_blob ap.ssid
    D (535) nvs: nvs_get_str_or_blob ap.mac
    D (538) nvs: nvs_get_str_or_blob ap.passwd
    D (542) nvs: nvs_get_str_or_blob ap.pmk
    D (546) nvs: nvs_get ap.chan 1
    D (548) nvs: nvs_get ap.authmode 1
    D (551) nvs: nvs_get ap.hidden 1
    D (554) nvs: nvs_get ap.max.conn 1
    D (557) nvs: nvs_get bcn.interval 2
    D (561) nvs: nvs_get ap.phym 1
    D (563) nvs: nvs_get ap.phybw 1
    D (566) nvs: nvs_get ap.sndchan 1
    D (569) nvs: nvs_set_blob sta.mac 6
    D (583) nvs: nvs_set_blob ap.mac 6
    pp_task_hdl : 3ffc877c, prio:23, stack:8192
    get wifi mode: 2
    set wifi mode
    get wifi ap mac: 0A:C4:03:03:FB:68
    get wifi ap ssid: Ai-Thinker_ESP32_03FB68
    get wifi ap password: 12345678
    set wifi ap ...
    get wifi sta ssid: 
    get wifi sta password: 
    set wifi sta ...
    wifi start
    mode : softAP(24:0a:c4:03:fb:69)
    D (605) event: SYSTEM_EVENT_AP_START
    V (607) event: enter default callback
    dhcp server start:(ip:, mask:, gw:
    V (617) event: exit default callback
    Ai-Thinker Technology Co. Ltd.
    Oct 13 2016 09:39:50
    start led blink task.
    start http server task.
    Welcome to use ESP-32S Module !
    Welcome to use ESP-32S Module !

    The last line is repeating...

    I press the reset and io0 and then release the reset, then io0, in serial terminal i got this:

    waiting for download

    Then I try to flash it:

    hygy@hygy-ThinkPad-E450:~/work/espruino/­esp32/esptool(master % u=)$ ./ --port /dev/ttyUSB1 --baud 230400 write_flash -z --flash_mode dio --flash_freq 40m --flash_size 16MB 0x1000 ../bootloader.bin 0x10000 ../espruino_esp32.bin 0x8000 ../partitions_singleapp.bin v2.0-beta1
    Detecting chip type... ESP32
    Uploading stub...
    A fatal error occurred: Invalid head of packet ('\x00')

    What I'm doing wrong?

  • I remember having that - search the esp32 gitter channel for a reference to header packet - something might come up....

  • This is what you wrote there:

    Then your timing is off - run the script again and push the boot button
    I just did a flash at --baud 460800 and it seemed to work fine.

    I tried pushing the Io0 button, and re run but it does not help. Any other idea?

    Attached a pucture about the board.

    1 Attachment

    • esp32.jpg
  • Hi @hygy,

    have you solder something to the bottom like resistors or a voltage regulator ?

  • It does seem to be one of those things that depends on how you hold you tongue!

    Hold down reset and io0 and then release reset - keeping io0 down. You should be in boot loader mode then

  • Is there an advantage to using Espruino vs Eclipse for the ESP32 development? Is there any native functionality that gets lost?

  • I'm not using Eclipse, as long as you can edit the source files you can use anything!

  • @Wilberforce Thanks for the reply. I was under the impression that once you started messing with various IDEs you might loose some modules or features of the chip. Thanks.

  • The main ide once you are flashed, is to use the espurino ide to send JavaScript to the board..

  • Hi folks,
    Here the latest ESP32 build updated to 1v91.381

    Please note that partitions have might have changed since the last update, detailed in README_flash.txt in the tgz file

    You might need to /eraseflash too.

    1 Attachment

  • @Wilberforce The ESP32 build works well. Cheers.

  • With the update I am ready to take the esrpuino plunge on my ESP32. Previously I have only used it for light weight development on the Esp8266. The chip will still have I2C, UART, PWM and control neopixels night? Do I need to find js libraries instead of C libraries for special operations?

  • Hello.
    There is fully completed firmware for esp32? There is any troubles with running code on it? All features of espruino is compatible with esp32?
    Thanks for the fast reply.

  • @PressAnyKey, there's a port in progress. @Wilberforce and @JumJum are leading it. You can also get them on the gitter channel here

  • I like wemos d1 with ESP8266 so I thought that getting wemos built esp32 board would be good as it also has 4MB flash available. See­Id=0&initiative_id=AS_20170420235556&Sea­rchText=LoLin32 Would this be a good board to get to start playing with the ESP32 Espruino?

  • All of the esp32 boards I have seen are 4mb - because of the RTOS and libs, the firmware is bigger so you need that size. I have heard good things about the wemos esp8266 too, but have had not direct experience. I think it should be suitable.

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

Espruino on ESP32

Posted by Avatar for Kolban @Kolban