XIAO ESP32C6 in PlatformIO

There’s a tutorial on using the Xiao ESP32-C6 on PlatformIO in the Wiki. However there is another approach that some might find easier: pioarduino which is a fork of platform-espressif32 by Jason2866. Just use

platform = https://github.com/pioarduino/platform-espressif32.git#develop
board = seeed_xiao_esp32c6

in platformio.ini.

All the sketches in sigmdel/xiao_esp32c6_sketches can be compiled with the develop branch of the pioarduino fork. They can also be compiled with the stable branch if the seeed_xiao_esp32c6.json board definition file is added in a local directory.

Many thanks to Jason2866 for all that work.

2 Likes

Thank u very much. I will give it a try and report back……

Hello, I tried this without success, it downloads and install all needed packages, but I get the following output:

Building in release mode
Compiling .pio\build\seeed_xiao_esp32c6\FrameworkArduinoVariant\variant.cpp.o
riscv32-esp-elf-g++: fatal error: cannot execute 'C:/Users/Heikki/.platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/13.2.0/../../../../riscv32-esp-elf/bin/as.exe': CreateProcess: No such file or directory
compilation terminated.
Compiling .pio\build\seeed_xiao_esp32c6\src\main.cpp.o
*** [.pio\build\seeed_xiao_esp32c6\FrameworkArduinoVariant\variant.cpp.o] Error 1
In file included from C:/Users/Heikki/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/bt/include/esp32c6/include/esp_bt.h:17,
                 from .pio/libdeps/seeed_xiao_esp32c6/NimBLE-Arduino/src/NimBLEDevice.h:46,
                 from src/ble.h:3,
                 from src/globals.h:66,
                 from src/main.cpp:4:
C:/Users/Heikki/.platformio/packages/framework-arduinoespressif32-libs/esp32c6/include/bt/controller/esp32c6/esp_bt_cfg.h:19:10: fatal error: syscfg/syscfg.h: No such file or directory
   19 | #include "syscfg/syscfg.h"
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
*** [.pio\build\seeed_xiao_esp32c6\src\main.cpp.o] Error 1
============================================= [FAILED] Took 16.36 seconds =============================================

Environment         Status    Duration
------------------  --------  ------------
seeed_xiao_esp32c6  FAILED    00:00:16.357

Can anyone suggest, what is the problem ?

Hi there,

So it is telling you what the issue is… WHere is the file? find it and move it to SRC or explicitly set the location.
HTH

GL :slight_smile: PJ :v:

Hello! I have been working with PlatformIO and the ESP32 for several years.
I have now purchased the Seeed XIAO ESP32-C6 and would like to program it in PlatformIO as well.
When I try to compile the program, as described in the Wiki or here, I get the following error:

Executing task in folder Test_xiao_esp32_c6: C:\Users\Entwickler.platformio\penv\Scripts\platformio.exe run --environment seeed_xiao_esp32_c6

Processing seeed_xiao_esp32_c6 (platform: GitHub - pioarduino/platform-espressif32: Espressif 32: pioarduino community platform compatible with PlatformIO; board: seeed-xiao-esp32c6; framework: arduino)

UnknownBoard: Unknown board ID ‘seeed-xiao-esp32c6’

My platformio.ini is as follow:

[env:seeed_xiao_esp32_c6]
platform = GitHub - pioarduino/platform-espressif32: Espressif 32: pioarduino community platform compatible with PlatformIO
board = seeed-xiao-esp32c6
framework = arduino

Who can help?

Hi there,

So , It has been a challenge to try and use PLIO for C6. I swear they want us to ONLY use ESP-IDF and they try hard NOT to support anything else. I for one like PLIO because the Debugger actually works, When Espressif first did the rug pull on everyone to 5.1 of IDF, the work around beside the Platform.ini proper setup was to install a Board Support Package say 3.1.1 in Arduino IDE, then when using Platform IO You could use the (use arduino IDE LIBs) and the Board package would show up in PLIO. With the C6 this AFAIK this doe NOT work anymore.
C6 sketches GIT hub
Follow the read me, and see if it yields the results.

The latest info I see on the subject , here is a seeed version of the INI,

[env:seeed_xiao_esp32_c6]
platform = https://github.com/Seeed-Studio/platform-seeedboards.git
board = seeed-xiao-c6
framework = arduino

If you prefer to use Espressif’s official PlatformIO platform, you can create a custom board definition for the XIAO ESP32C6:

  1. Create Custom Board File: Navigate to your PlatformIO boards directory (typically located at ~/.platformio/boards/) and create a new file named seeed_xiao_esp32c6.json with the following content:ESP32 Forum+1PlatformIO Community+1
{
  "build": {
    "core": "esp32",
    "mcu": "esp32c6",
    "f_cpu": "160000000L",
    "f_flash": "80000000L",
    "flash_mode": "qio",
    "variant": "esp32c6"
  },
  "connectivity": ["wifi"],
  "frameworks": ["arduino", "espidf"],
  "name": "Seeed Studio XIAO ESP32C6",
  "upload": {
    "maximum_ram_size": 524288,
    "maximum_size": 4194304,
    "require_upload_port": true,
    "speed": 460800
  },
  "url": "https://www.seeedstudio.com/XIAO-ESP32C6-p-5749.html",
  "vendor": "Seeed Studio"
}
  1. Modify platformio.ini: Update your project’s platformio.ini file as follows:PlatformIO Community+2Seeed Studio+2PlatformIO Documentation+2
[env:seeed_xiao_esp32c6]
platform = espressif32
board = seeed_xiao_esp32c6
framework = arduino
platform_packages =
  platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.2
  platformio/framework-arduinoespressif32-libs @ https://github.com/espressif/esp32-arduino-libs.git#idf-release/v5.1

This approach allows you to use the standard Espressif platform with a custom board definition tailored for the XIAO ESP32C6.

NOTE: You may want to re-install, the most recent PlatformIO installs the latest Espressif32 platform (version 6.x+), which includes ESP32C6 support:

HTH
GL :slight_smile: PJ :v:

Hello PJ_Glasso,

Thank you very much for your contribution, which was very helpful to me. With your support, I was able to get the XIAO-ESP32C6 working in PlatformIO.
Best regards,
devo

Hi there,

So Glad to hear… Good on you for Staying with it. Please mark it as the Solution so others can find it and thank you for the contribution.

Awesome
GL :slight_smile: PJ :v: