Skip to main content

Micropython for XIAO ESP32C6

MicroPython is a lean and efficient implementation of the Python 3 programming language that includes a small subset of the Python standard library and is optimised to run on microcontrollers and in constrained environments.

Since its first launch in 2014, micropython has supported many microcontrollers, including the ESP32 series, but currently does not officially support the ESP32C6 chip. This firmware is self compiled, and the official firmware is already on its way. Please be patient.

In this page, we will guide on how to use the the XIAO ESP32C6 capability using the simple and easy syntax from micropython.

Hardware Preparation

I am using Seeed Studio XIAO ESP32C6 board here.

Seeed Studio XIAO ESP32C6

Software Preparation

In this guide I will be using windows 10 alongside with Thonny IDE and esptool. In order to use esptool make sure to install Python 3 environment on your windows OS. Before getting started make sure to download the firmware and Install Thonny

Thonny IDEFirmware and Sample Code

👍 Greatly Thanks

The firmware designed for XIAO ESP32C6 board, using in this wiki is made by our friend: Zhishuo Song, whom we are really greatful for.

Getting Started

The firmware is designed only for XIAO ESP32C6 MicroPython programming. We will first flash the firmware and then use the example on it.

Step 1. Flashing the firmware

Locate the usb to serial port address by opening the device manager

pir

Extract the downloaded zip file and navigate to the folder.

pir

click On the path box then type "CMD" and press enter

pir

You will be directed to cmd terminal.

pir

Install esptool using pip command (make sure python 3 is already installed)

pip install esptool

pir

Erase the flash memory on the XIAO ESP32C6 using this command

esptool.py --port COMXX --chip esp32c6 erase_flash

Now proceed to install the micropython firmware using this command

esptool.py --port COMXX --baud 460800 --before default_reset --after hard_reset --chip esp32c6  write_flash --flash_mode dio --flash_size detect --flash_freq 80m 0x0 ESP32C6_MicroPython.bin
tip

change the COMXX with port COM number on your PC

pir

Step 2. Upload the example code

Now we will upload the example code to XIAO ESP32C6 internal flash memory.

For this part I am using thonny IDE first I configure the port

pir

run blinker.py example program

pir

NTP get now time from wifi

step1: Open wifi_Ntp.py file on Thonny

pir

step2: change you wifi router ssid and password on line 8

pir

step3: run code

When running the program, you can see in the shell window that the XIAO is connected to the specified wifi and get the NTP network time.

pir

Troubleshooting

If the program cannot be burned, please try using the BOOT button and RST button to set the board to boot download mode

✨ Contributor Project

Tech Support & Product Discussion

Thank you for choosing our products! We are here to provide you with different support to ensure that your experience with our products is as smooth as possible. We offer several communication channels to cater to different preferences and needs.

Loading Comments...