MicroPython Setup on ESP32-C3

I have got a LuatOS ESP32C3-CORE board earlier, and thought to try MicroPython on it.

Installation

  • Download Thonny, and install it
  • Found out and note down the installation folder, for example: C:\Users\Tony\AppData\Local\Programs\Thonny
  • Download the Firmware, the latest version is V1.19.1 currently
  • Connect the board to computer, and USB-SERIAL driver, note down the Port once connection is successful
  • Flash the firmware
<Thonny installation folder>\python.exe -u -m esptool --chip esp32c3 --port COM9 erase_flash

<Thonny installation folder>\python.exe -u -m esptool --chip esp32c3 --port COM9 --baud 460800 write_flash -z 0x0 c:/firmware/esp32c3-20220618-v1.19.1.bin

Code and Run

  • Open main.py from MicroPython device in Thonny, add some test code below
  • The LED will be blinking every half second
from machine import Pin, I2C
import time

led=Pin(12,Pin.OUT)

while True:
    led.off()
    time.sleep(0.5)
    led.on()
    time.sleep(0.5)

Reference