How to Flash MicroPython Firmware to ESP32 and ESP8266

Using the uPyCraft IDE software, this post shows how to flash MicroPython firmware to ESP32 and ESP8266 boards. It works with Linux, Mac OS X, and Windows.

Be sure to follow one of these guides to install the uPyCraft IDE on your PC before continuing with this tutorial:

You can quickly flash your ESP32 or ESP8266 boards with the MicroPython firmware if you have uPyCraft IDE installed on your PC. There are two sections to this post; depending on your board, read Part 1 or Part 2.

  • Part 1 – ESP32
  • Part 2 – ESP8266

Note: You may return to using Arduino IDE after installing MicroPython firmware on your ESP32 or ESP8266. Using Arduino IDE, you just need to upload code. Then, you need to flash MicroPython firmware if you want to use it again.

Part 1 – ESP32: Downloading and Flashing the MicroPython Firmware on ESP32

Go to the MicroPython Downloads page and scroll down to the ESP32 section to download the latest version of MicroPython firmware for the ESP32.

The latest web link to download the ESP32.bin file should be shown on a page similar to the one shown below (see figure). For example, esp32-20181007-v1.9.4-631-g338635ccc.bin.

micropython firmware download esp32

Note: Go to the MicroPython Downloads page and choose the right firmware for your board if you're using a different one (such as a PyBoard, WiPy, or another).

Selecting Serial Port

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

uPyCraft IDE Select Serial Port COM5

Important: If you plug your ESP32 board into your PC but can’t find the ESP32 port available in your uPyCraft IDE, it might be one of these two problems: 1. USB drivers are missing; or 2. USB cables have no data wires.

1. It usually means you don't have the USB drivers installed if you don't see your ESP's COM port available. Check the name of the chip on the board that is next to the voltage regulator.

The ESP32 DEVKIT V1 DOIT board uses the CP2102 chip.

cp2102 chip esp32

To find the drivers and install them on your operating system, search Google for your specific chip.

cp2102 driver download

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

cp2102 drivers download site

You should see the COM port in the Tools menu after restarting the uPyCraft IDE with it installed.

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

Often, the USB cables that come with power banks are charge-only cables without data wires. As a result, your computer and the ESP32 will never establish serial communication. Your issue should be resolved if you use a proper USB cable.

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:

uPyCraft IDE Select Board ESP32

Flashing/Uploading MicroPython Firmware

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

uPyCraft IDE Tools burn Firmware

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
flash firmware esp32 prepare

Navigate to your Downloads folder, then select the ESP32.bin file after pressing the “Choose” button:

select esp32 bin file uPyCraft IDE

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

boot button

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

OK update firmware esp32

You may release the “BOOT/FLASH” button when the “EraseFlash” process starts. The firmware will be flashed onto your ESP32 board in a short while.

esp8266 firmware flashing message

Note: It means that your ESP32 wasn't in flashing mode if the “EraseFlash” bar doesn't move and you see an error flash message saying “erase false.” To make sure that your ESP32 enters flashing mode, you need to repeat all the steps outlined before and hold the “BOOT/FLASH” button.

micropython erase false message failed

Part 2 – ESP8266: Downloading and Flashing the MicroPython Firmware on ESP8266

Go to the MicroPython Downloads page and scroll down to the ESP8266 section to download the latest version of MicroPython firmware for the ESP8266.

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.

micropython firmware download esp8266

Note: Go to the MicroPython Downloads page and choose the right firmware for your board if you're using a different one (such as a PyBoard, WiPy, or another).

Selecting Serial Port

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

uPyCraft IDE Select Serial Port COM5

Important: If you plug your ESP8266 board into your PC but can’t find the ESP8266 port available in your uPyCraft IDE, it might be one of these two problems: 1. USB drivers are missing; or 2. USB cables have no data wires.

1. It usually means you don't have the USB drivers installed if you don't see your ESP's COM port available. Check the name of the chip on the board that is next to the voltage regulator.

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

esp8266 cp2102 driver

To find the drivers and install them on your operating system, search Google for your specific chip.

cp2102 driver download

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

cp2102 drivers download site

You should see the COM port in the Tools menu after restarting the uPyCraft IDE with it installed.

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

Often, the USB cables that come with power banks are charge-only cables without data wires. As a result, your computer and the ESP8266 will never establish serial communication. Your issue should be resolved if you use a proper USB cable.

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:

uPyCraft IDE Select Board ESP8266

Flashing/Uploading MicroPython Firmware

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

uPyCraft IDE Tools burn Firmware

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
flash firmware esp8266 prepare

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

select esp8266 bin file uPyCraft IDE

Having all the settings selected, hold down the “BOOT/FLASH” button on your ESP8266 board.

esp8266 flash button

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

OK flash firmware esp8266

You may release the “BOOT/FLASH” button once the “EraseFlash” process begins. After a few seconds, the firmware will be flashed onto your ESP8266 board.

esp8266 firmware flashing message

Note: It means that your ESP8266 wasn't in flashing mode if the “EraseFlash” bar doesn't move and you see an error flash message saying “erase false.” To make sure that your ESP8266 enters flashing mode, you need to repeat all the steps outlined before and hold the “BOOT/FLASH” button.

micropython erase false message failed

Conclusion

We hope you find this tutorial helpful. Flash MicroPython firmware on your ESP32 or ESP8266. Read Getting Started with MicroPython on ESP32 and ESP8266 to learn more about MicroPython.

If you like ESP8266, you may also like:

We hope you find this tutorial useful. Thanks for reading.

Oh hi there It’s nice to meet you.

Sign up to receive awesome content in your inbox, every month.

We don’t spam! Read our privacy policy for more info.

Leave a Reply

Your email address will not be published. Required fields are marked *

Developing IoT Projects with ESP32

Automate your home or business with inexpensive Wi-Fi devices

ESP8266 Home Automation Projects

Leverage the power of this tiny WiFi chip to build exciting smart home projects