Flash/Upload MicroPython Firmware to ESP32 and ESP8266

This posts shows how to flash MicroPython firmware to ESP32/ESP8266 boards using the uPyCraft IDE software. It works on Windows, Linux, and Mac OS X.

Before continuing with this tutorial, make sure you follow one of these guides to install uPyCraft IDE on your computer:

With uPyCraft IDE installed in your computer, you can easily flash your ESP32 or ESP8266 boards with the MicroPython firmware. This post is divided in two parts, read Part 1 or Part 2 depending on your board:

  • Part 1 – ESP32
  • Part 2 – ESP8266

Note: After installing MicroPython firmware on your ESP32 or ESP8266, you can go back and use Arduino IDE again. You just need to upload code using Arduino IDE. Then, if you want to use MicroPython again, you need to flash MicroPython firmware.

[Part 1 – ESP32] Downloading and Flashing the MicroPython Firmware on ESP32

To download the latest version of MicroPython firmware for the ESP32, go to the MicroPython Downloads page and scroll all the way down to the ESP32 section.

Learn how to program and build projects with the ESP32 and ESP8266 using MicroPython firmware DOWNLOAD »

Learn how to program and build projects with the ESP32 and ESP8266 using MicroPython firmware DOWNLOAD »

You should see a similar web page (see figure below) with the latest link to download the ESP32 .bin file – for example: esp32-20181007-v1.9.4-631-g338635ccc.bin.

Note: if you’re using a different board (like a PyBoard, WiPy, or other), go to MicroPython Downloads page and download the right firmware for your board.

Selecting Serial Port

Go to Tools > Serial and select your ESP32 COM port (in our case it’s COM5).

Important: if you plug your ESP32 board to your computer, but you can’t find the ESP32 Port available in your uPyCraft IDE, it might be one of these two problems: 1. USB drivers missing or 2. USB cable without data wires.

1. If you don’t see your ESP’s COM port available, this often means you don’t have the USB drivers installed. Take a closer look at the chip next to the voltage regulator on board and check its name.

The ESP32 DEVKIT V1 DOIT board uses the CP2102 chip.

Go to Google and search for your specific chip to find the drivers and install them in your operating system.

Download our Free eBooks and Resources

You can download the CP2102 drivers on the Silicon Labs website.

After they are installed, restart the uPyCraft IDE and you should see the COM port in the Tools menu.

2. If you have the drivers installed, but you can’t see your device, double-check that you’re using a USB cable with data wires.

USB cables from powerbanks often don’t have data wires (they are charge only). So, your computer will never establish a serial communication with your ESP32. Using a a proper USB cable should solve your problem.

Selecting the Board

Go to Tools > Board. For this tutorial, we assume that you’re using the ESP32, so make sure you select the “esp32” option:

Flashing/Uploading MicroPython Firmware

Finally, go to Tools > BurnFirmware menu to flash your ESP32 with MicroPython.

Select all these options to flash the ESP32 board:

  • board: esp32
  • burn_addr: 0x1000
  • erase_flash: yes
  • com: COMX (in our case it’s COM5)
  • Firmware: Select “Users” and choose the ESP32 .bin file downloaded earlier

After pressing the “Choose” button, navigate to your Downloads folder and select the ESP32 .bin file:

Having all the settings selected, hold-down the “BOOT/FLASH” button in your ESP32 board:

While holding down the “BOOT/FLASH“, click the “ok” button in the burn firmware window:

When the “EraseFlash” process begins, you can release the “BOOT/FLASH” button. After a few seconds, the firmware will be flashed into your ESP32 board.

Note: if the “EraseFlash” bar doesn’t move and you see an error message saying “erase false.“, it means that your ESP32 wasn’t in flashing mode. You need to repeat all the steps described earlier and hold the “BOOT/FLASH” button again to ensure that your ESP32 goes into flashing mode.

[Part 2 – ESP8266] Downloading and Flashing the MicroPython Firmware on ESP8266

To download the latest version of MicroPython firmware for the ESP8266, go to the MicroPython Downloads page and scroll all the way down to the ESP8266 section.

You should see a similar web page (see figure below) with the latest link to download the ESP8266 .bin file – for example: esp8266-20180511-v1.9.4.bin.

Note: if you’re using a different board (like a PyBoard, WiPy, or other), go to MicroPython Downloads page and download the right firmware for your board.

Selecting Serial Port

Go to Tools > Serial and select your ESP8266 COM port (in our case it’s COM5).

Important: if you plug your ESP32 board to your computer, but you can’t find the ESP32 Port available in your uPyCraft IDE, it might be one of these two problems: 1. USB drivers missing or 2. USB cable without data wires.

1. If you don’t see your ESP’s COM port available, this often means you don’t have the USB drivers installed. Take a closer look at the chip next to the voltage regulator on board and check its name.

The ESP8266 ESP-12E NodeMCU board uses the CP2102 chip.

Go to Google and search for your specific chip to find the drivers and install them in your operating system.

You can download the CP2102 drivers on the Silicon Labs website.

After they are installed, restart the uPyCraft IDE and you should see the COM port in the Tools menu.

2. If you have the drivers installed, but you can’t see your device, double-check that you’re using a USB cable with data wires.

USB cables from powerbanks often don’t have data wires (they are charge only). So, your computer will never establish a serial communication with your ESP8266. Using a a proper USB cable should solve your problem.

Selecting the Board

Go to Tools > Board. For this tutorial, we assume that you’re using the ESP8266, so make sure you select the “esp8266” option:

Flashing/Uploading MicroPython Firmware

Finally, go to Tools > BurnFirmware menu to flash your ESP32 with MicroPython.

Select all these options to flash the ESP8266 board:

  • board: esp8266
  • burn_addr: 0x0
  • erase_flash: yes
  • com: COMX (in our case it’s COM5)
  • Firmware: Select “Users” and choose the ESP8266 .bin file downloaded earlier

After pressing the “Choose” button, navigate to your Downloads folder and select the ESP8266 .bin file:

Having all the settings selected, hold-down the “BOOT/FLASH” button in your ESP8266 board:

While holding down the “BOOT/FLASH“, click the “ok” button in the burn firmware window:

When the “EraseFlash” process begins, you can release the “BOOT/FLASH” button. After a few seconds, the firmware will be flashed into your ESP8266 board.

Note: if the “EraseFlash” bar doesn’t move and you see an error message saying “erase false.“, it means that your ESP8266 wasn’t in flashing mode. You need to repeat all the steps described earlier and hold the “BOOT/FLASH” button again to ensure that your ESP8266 goes into flashing mode.

Wrapping Up

We hope you’ve found this tutorial useful. Your ESP32/ESP8266 should now be flashed with MicroPython firmware. To learn more about MicroPython read: Getting Started with MicroPython on ESP32 and ESP8266.

If you liked this post, you might like our next ones, so make sure you subscribe to the RNT blog and download our free electronics eBooks.


Learn how to program and build projects with the ESP32 and ESP8266 using MicroPython firmware DOWNLOAD »

Learn how to program and build projects with the ESP32 and ESP8266 using MicroPython firmware DOWNLOAD »


Enjoyed this project? Stay updated by subscribing our weekly newsletter!

20 thoughts on “Flash/Upload MicroPython Firmware to ESP32 and ESP8266”

  1. Nice tutorial! One question: after flashing the Micropython firmware to the ESP32, can I still use the ESP32 with the Arduino-IDE?

  2. If I flash an ESP32 or ESP8266 board with MicroPython is this permanent? Or can I go back to using the Aduino IDE and code?

  3. Very interesting and helpful post! But I have this error message any time I tried to upload a script:

    download false
    exec(open(‘main.py’).read(),globals())
    Traceback (most recent call last):
    File “”, line 1, in
    OSError: [Errno 1] EPERM

    • Hi.
      Try to reconnect the board to uPyCraft IDE or click the STOP button before uploading a new script.
      I think that error means that your ESP is not ready to receive a new script.

      Note: make sure your file name is correct (boot.py/main.py) and that your script indentation is also correct (no spaces for the first instructions and two spaces for indentation).
      Finally, it looks like the firmware was flashed correctly. But in case you keep having problems, we recommend reflashing the firmware.
      I hope this helps.
      Let me know how it went.
      Regards,
      Sara 🙂

  4. Hi Ruis! I flashed my ESP32 board with Micropython and all seemed to work. After turning the PC off and then on again, I’ve found my ESP32 board contained nothing. I’ve repeated the process many times according your instructions, but whenever the situation was the same, the board did not contain anything. Do I have to throw the card? Many thanks.

  5. Hi,
    Anybody try to flash Yunshan wifi relay with Micropython firmware
    ucexperiment.wordpress.com/2016/12/18/yunshan-esp8266-250v-15a-acdc-network-wifi-relay-module/
    Really appreciate your help, thanks in advance

    • Hi Shukri. I’ve never experimented with Yunshan wifi relay. It uses an ESP8266, so it should be possible to flash micropython.
      Probably you need to follow the instructions on that page to connect the board to your computer using TTL, and then follow the steps to upload firmware:
      “To program the ESP8266 module, I connected the TX, RX and ground pins of connector P6 to a SparkFun USB FTDI programmer, and jumped the two pins of connector P5 together when I was ready to upload. Connector P5 grounds GPIO0 and GPIO15, sending the device into bootloader mode. If you have trouble programming the ESP8266 like I did on the first attempt, ensure you also ground your FTDI device through the P6 connector.”

  6. I have been trying to install micropython over and over getting nowhere. I just happened to see you site after a google. I was able to load it onto adafruit HUZZAH feather and two esp32 dev kit v1. Your soft is great. Thank You Very Much

  7. The ESP8266 can be flash successfully but the ESP32 is not able to flash even though the display indicates that EraseFalsh is 100% and Burn is 100%. DO you know what happen ?

  8. Under windows I can upload and run only one time, my program, but in next time I only see error on uPyCraft – open serial error. Please help.

Leave a Comment

Download our Free eBooks and Resources

Get instant access to our FREE eBooks, Resources, and Exclusive Electronics Projects by entering your email address below.