In previous post we learned how to install MicroPython to ESP8266. In this we go trough the process with ESP32. So lets install Micropython to ESP32.




 

  1. First download Micropython binary for ESP32:
    http://micropython.org/download#esp32
  2. Install esptools:
    sudo pip3 install esptool
  3. Now lets erase the flash with command:
    esptool.py --port /dev/ttyUSB0 erase_flash

    don’t forget to change the port “/dev/tty…” to your correct port. The result should be:

    esptool.py v2.3.1
    Connecting........__
    Detecting chip type... ESP32
    Chip is ESP32D0WDQ6 (revision 1)
    Features: WiFi, BT, Dual Core
    Uploading stub...
    Running stub...
    Stub running...
    Erasing flash (this may take a while)...
    Chip erase completed successfully in 5.3s
    Hard resetting via RTS pin...
  4. Lets flash the new firmware:
    esptool.py --chip esp32 --port /dev/ttyUSB0 write_flash -z 0x1000 esp32-20180318-v1.9.3-470-ge37b8ba5.bin

    change the port name and the binary file name. At the moment of writing this my file was “esp32-20180318-v1.9.3-470-ge37b8ba5.bin”. And result:

    esptool.py v2.3.1
    Connecting........_
    Chip is ESP32D0WDQ6 (revision 1)
    Features: WiFi, BT, Dual Core
    Uploading stub...
    Running stub...
    Stub running...
    Configuring flash size...
    Auto-detected Flash size: 4MB
    Compressed 973600 bytes to 604296...
    Wrote 973600 bytes (604296 compressed) at 0x00001000 in 53.4 seconds (effective 145.9 kbit/s)...
    Hash of data verified.
    
    Leaving...
    Hard resetting via RTS pin...
  5. Lets check that everything works run:
    picocom /dev/ttyUSB0 -b115200

    And if the result is:

    picocom v1.7
    
    port is        : /dev/ttyUSB0
    flowcontrol    : none
    baudrate is    : 115200
    parity is      : none
    databits are   : 8
    escape is      : C-a
    local echo is  : no
    noinit is      : no
    noreset is     : no
    nolock is      : no
    send_cmd is    : sz -vv
    receive_cmd is : rz -vv
    imap is        : 
    omap is        : 
    emap is        : crcrlf,delbs,
    
    Terminal ready
    

    You are good to go.

For more information check out:

GitHub