Firmware Flashing

This page describes how to flash MicroPython firmware onto mPython IoT. When using the device for the first time, upgrading firmware, or troubleshooting abnormal behavior, follow the steps below to re-flash.

Prerequisites

  • A Type-C data cable (supports both data transfer and charging)

  • A computer with mPython IDE installed

  • Official firmware file ( .bin )

Method 1: Flashing with mPython IDE

  1. Connect mPython IoT to the computer using a Type-C data cable and turn on the power switch.

  2. Open mPython IDE and select the serial port corresponding to mPython IoT in the device connection area.

  3. Enter the firmware flashing tool and select the downloaded firmware file.

  4. Click start flashing and wait for the progress bar to complete.

  5. After flashing is complete, the device restarts automatically, indicating the firmware has been written.

Method 2: Flashing with esptool

If you are familiar with the command line, you can also use the esptool utility to flash firmware. First install esptool:

pip install esptool

Then execute the flashing command (replace COM3 with your actual serial port and the firmware filename with the actual name):

esptool --chip esp32c2 --port COM3 --baud 921600 write_flash 0x0 firmware.bin

Attention

The firmware flash address and erase method for ESP32-C2 may vary depending on the firmware version. Please refer to the official firmware documentation. Do not power off or disconnect the cable during flashing.

Verifying the Flash

After flashing is complete, connect the device in mPython IDE and open the serial terminal. If you can enter the MicroPython interactive environment normally (the >>> prompt appears), the firmware flashing was successful.

Hint

If flashing fails, try lowering the baud rate, replacing the data cable, or re-entering flash mode and retrying.