Hello - I’m learning to build executable code for my XIAO-ESP32C6 processor using PlatformIO and following the guidance offered here: XIAO ESP32C6 with PlatformIO | Seeed Studio Wiki
I’d appreciate any hints for solving my build problem.
Thanks,
Jim
Source code:
#include <Arduino.h>
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
PlatformIO build log:
Executing task in folder blinkXiaoEsp32C6: platformio run
Processing seeed_xiao_esp32_c6 (platform: https://github.com/Seeed-Studio/platform-seeedboards.git; board: seeed-xiao-esp32-c6; framework: arduino)
-------------------------------------------------------------------------------------------------
esp configure_default_packages
True
True
True
pop toolchain-xtensa-esp-elf
esp configure_default_packages
True
True
True
pop toolchain-xtensa-esp-elf
Verbose mode can be enabled via `-v, --verbose` option
esp configure_default_packages
True
True
True
pop toolchain-xtensa-esp-elf
board id is seeed-xiao-esp32,will call board_build/esp/esp_build.py
franwork_dir = /home/jcl/.platformio/packages/framework-arduinoespressif32@src-e0f89a6286f1dc9d7e5bc14cb3c0a9e3
CONFIGURATION: https://docs.platformio.org/page/boards/Seeed Studio/seeed-xiao-esp32-c6.html
PLATFORM: Seeed Studio Xiao Series (1.0.0+sha.c3f8d8e) > Seeed Studio XIAO ESP32C6
HARDWARE: ESP32C6 160MHz, 512KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-builtin, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
- esp32-arduino-libs @ 5.1.0+sha.d38afc77db
- framework-arduinoespressif32 @ 3.1.1+sha.108a0792
- tool-esptoolpy @ 5.1.0
- tool-riscv32-esp-elf-gdb @ 14.2.0+20240403
- tool-sreccat @ 1.164.0 (1.64)
- tool-xtensa-esp-elf-gdb @ 14.2.0+20240403
- toolchain-riscv32-esp @ 13.2.0+20240530
board id is seeed-xiao-esp32-c6, will call board_build/esp/esp_build.py
in _embed_files py
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 25 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
in sizedata.py
Compiling .pio/build/seeed_xiao_esp32_c6/FrameworkArduinoVariant/variant.cpp.o
Compiling .pio/build/seeed_xiao_esp32_c6/src/main.cpp.o
Building .pio/build/seeed_xiao_esp32_c6/bootloader.bin
Generating partitions .pio/build/seeed_xiao_esp32_c6/partitions.bin
Compiling .pio/build/seeed_xiao_esp32_c6/FrameworkArduino/ColorFormat.c.o
Traceback (most recent call last):
File "/home/jcl/.platformio/packages/tool-esptoolpy@src-c789e87e8acca61ff196b2d4ea81dd1a/esptool.py", line 34, in <module>
import esptool
File "/home/jcl/.platformio/packages/tool-esptoolpy@src-c789e87e8acca61ff196b2d4ea81dd1a/esptool/__init__.py", line 41, in <module>
import rich_click as click
ModuleNotFoundError: No module named 'rich_click'
*** [.pio/build/seeed_xiao_esp32_c6/bootloader.bin] Error 1
Compiling .pio/build/seeed_xiao_esp32_c6/FrameworkArduino/Esp.cpp.o
================================== [FAILED] Took 1.64 seconds ==================================
* The terminal process "platformio 'run'" terminated with exit code: 1.
* Terminal will be reused by tasks, press any key to close it.
Hi there,
Season’s Greetings. 
SO , can you show you PlatformIO.ini file contents ?
Also have you done a clean build first?
How did you setup your build environment?
HTH
GL
PJ 
Hi PJ - Below please find my PlatformIO.ini file. - Cheers - Jim
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:seeed_xiao_esp32_c6]
platform = https://github.com/Seeed-Studio/platform-seeedboards.git
board = seeed-xiao-esp32-c6
framework = arduino
Also, I followed the instructions given here: XIAO ESP32C6 with PlatformIO | Seeed Studio Wiki
As to doing a clean build first, I don’t know what you are referring to. - Jim
Thank you, grobasoz. I ran the pip command and as best I can tell rich_click is installed. For example, I see the following in the Terminal output: “Successfully installed rich_click-1.9.4”. However, I’m still getting the same build error within PlatformIO as shown in the following:
Processing seeed_xiao_esp32_c6 (platform: https://github.com/Seeed-Studio/platform-seeedboards.git; board: seeed-xiao-esp32-c6; framework: arduino)
-----------------------------------------------------------------------------------------------------
esp configure_default_packages
True
True
True
pop toolchain-xtensa-esp-elf
esp configure_default_packages
True
True
True
pop toolchain-xtensa-esp-elf
Verbose mode can be enabled via `-v, --verbose` option
esp configure_default_packages
True
True
True
pop toolchain-xtensa-esp-elf
board id is seeed-xiao-esp32,will call board_build/esp/esp_build.py
franwork_dir = /home/jcl/.platformio/packages/framework-arduinoespressif32@src-e0f89a6286f1dc9d7e5bc14cb3c0a9e3
CONFIGURATION: https://docs.platformio.org/page/boards/Seeed Studio/seeed-xiao-esp32-c6.html
PLATFORM: Seeed Studio Xiao Series (1.0.0+sha.c3f8d8e) > Seeed Studio XIAO ESP32C6
HARDWARE: ESP32C6 160MHz, 512KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-builtin, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
- esp32-arduino-libs @ 5.1.0+sha.d38afc77db
- framework-arduinoespressif32 @ 3.1.1+sha.108a0792
- tool-esptoolpy @ 5.1.0
- tool-riscv32-esp-elf-gdb @ 14.2.0+20240403
- tool-sreccat @ 1.164.0 (1.64)
- tool-xtensa-esp-elf-gdb @ 14.2.0+20240403
- toolchain-riscv32-esp @ 13.2.0+20240530
board id is seeed-xiao-esp32-c6, will call board_build/esp/esp_build.py
in _embed_files py
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 25 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
in sizedata.py
Building .pio/build/seeed_xiao_esp32_c6/bootloader.bin
Traceback (most recent call last):
File "/home/jcl/.platformio/packages/tool-esptoolpy@src-c789e87e8acca61ff196b2d4ea81dd1a/esptool.py", line 34, in <module>
import esptool
File "/home/jcl/.platformio/packages/tool-esptoolpy@src-c789e87e8acca61ff196b2d4ea81dd1a/esptool/__init__.py", line 41, in <module>
import rich_click as click
ModuleNotFoundError: No module named 'rich_click'
Compiling .pio/build/seeed_xiao_esp32_c6/FrameworkArduino/MD5Builder.cpp.o
*** [.pio/build/seeed_xiao_esp32_c6/bootloader.bin] Error 1
==================================== [FAILED] Took 0.83 seconds ====================================
In case helpful, here’s some data regarding my installation of rich_click:
framewk 125= pip install 'rich_click'
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: rich_click in ./.local/lib/python3.13/site-packages (1.9.4)
Requirement already satisfied: click>=8 in /usr/lib/python3.13/site-packages (from rich_click) (8.1.7)
Requirement already satisfied: rich>=12 in ./.local/lib/python3.13/site-packages (from rich_click) (14.2.0)
Requirement already satisfied: markdown-it-py>=2.2.0 in ./.local/lib/python3.13/site-packages (from rich>=12->rich_click) (4.0.0)
Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /usr/lib/python3.13/site-packages (from rich>=12->rich_click) (2.18.0)
Requirement already satisfied: mdurl~=0.1 in ./.local/lib/python3.13/site-packages (from markdown-it-py>=2.2.0->rich>=12->rich_click) (0.1.2)
In that case I’m not sure what the issue could be. It may be a red herring error, where the underlying problem is caused by conflicting esptool versions?
You could try a …
pio pkg update -g -t tool-esptoolpy
1 Like
I generally only use espressif32 when supplying the platform in the platformio ini file.
I’m now able to build and burn a blink app to my XIAO-ESP32C6. The key was to install the extension “pioarduino IDE” in VSCode. Thanks for everyone for helping me!
2 Likes
Thanks for the update.
The pioarduino extension is a great alternative to PlatformIO (which should have worked as well).
For those wanting to stick with PlatformIO, the solution I found to work was to install rich-click and intelhex to the PlatformIO environment… eg (for Windows)
C:\Users<user>.platformio\penv\Scripts\python.exe -m pip install rich-click
C:\Users<user>.platformio\penv\Scripts\python.exe -m pip install intelhex
I also had to “update” esp32-hal-i2c-slave.c with suggested build warnings…
warning: implicit declaration of function 'i2c_ll_slave_set_fifo_mode'; did you mean 'i2c_ll_enable_fifo_mode'? [-Wimplicit-function-declaration]
378 | i2c_ll_slave_set_fifo_mode(i2c->dev, true);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
| i2c_ll_enable_fifo_mode
NB: I haven’t tested these I2C changes.
1 Like