Xiao ESP32C3 not usable with ESPHome for now?

Hi

I use ESPHome for my ESP devices and I wanted to use it with the Xiao ESP32C3 module I bought. Unhappy it looks like support in ESPHome for such chipset is far too basic for now :frowning: Trying just to add code for PWM output and then it doesn’t compile anymore in ESPHome :frowning:

ESPHome sketch:

esphome:
  friendly_name: esp32c3
  name: esp32c3
  platformio_options:
    board_build.flash_mode: dio  

esp32:
  board: seeed_xiao_esp32c3
  variant: esp32c3
  framework:
    type: esp-idf

wifi:
  networks:
  - ssid: !secret wifi_ssid
    password: !secret wifi_password
  - ssid: !secret wifi_puppy
    password: !secret wifi_puppy_passwd
  ap:
    ssid: $friendly_name

sensor:
  - platform: wifi_signal
    name: $name WiFi Signal
    update_interval: 60s
  - platform: uptime
    name: $name Uptime
    filters:
      - lambda: return x / 60.0;
    unit_of_measurement: minutes

logger:

ota:

#web_server:

#captive_portal:

api:

output:
  - platform: ledc
    pin: GPIO4
    id: sortie_1
  - platform: ledc
    pin: GPIO6
    id: sortie_2

light:
  - platform: monochromatic
    output: sortie_1
    name: "Light 1"
  - platform: monochromatic
    output: sortie_2
    name: "Light 2"

Errors during compile:

INFO Reading configuration /config/esphome/esp32c3.yaml…
INFO Generating C++ source…
INFO Compiling app…
Processing esp32c3 (board: seeed_xiao_esp32c3; framework: espidf; platform: platformio/espressif32 @ 5.2.0)

HARDWARE: ESP32C3 160MHz, 320KB RAM, 4MB Flash

  • framework-espidf @ 3.40402.0 (4.4.2)
  • tool-cmake @ 3.16.4
  • tool-ninja @ 1.7.1
  • toolchain-esp32ulp @ 2.35.0-20220830
  • toolchain-riscv32-esp @ 8.4.0+2021r2-patch3
    Reading CMake configuration…
    LDF: Library Dependency Finder → Library Dependency Finder (LDF) — PlatformIO latest documentation
    No dependencies
    Compiling /data/esp32c3/.pioenvs/esp32c3/src/main.o
    Linking /data/esp32c3/.pioenvs/esp32c3/firmware.elf
    /data/cache/platformio/packages/toolchain-riscv32-esp/bin/…/lib/gcc/riscv32-esp-elf/8.4.0/…/…/…/…/riscv32-esp-elf/bin/ld: /data/esp32c3/.pioenvs/esp32c3/src/esphome/components/api/api_connection.o: in function std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)': /data/cache/platformio/packages/toolchain-riscv32-esp/riscv32-esp-elf/include/c++/8.4.0/bits/basic_string.h:6011: undefined reference to esphome::light::LightState::make_call()’
    /data/cache/platformio/packages/toolchain-riscv32-esp/bin/…/lib/gcc/riscv32-esp-elf/8.4.0/…/…/…/…/riscv32-esp-elf/bin/ld: /data/esp32c3/.pioenvs/esp32c3/src/esphome/components/api/api_connection.o: in function esphome::api::APIConnection::light_command(esphome::api::LightCommandRequest const&)': /config/esphome/.esphome/build/esp32c3/src/esphome/components/api/api_connection.cpp:375: undefined reference to esphome::light::LightCall::set_state(bool)’
    /data/cache/platformio/packages/toolchain-riscv32-esp/bin/…/lib/gcc/riscv32-esp-elf/8.4.0/…/…/…/…/riscv32-esp-elf/bin/ld: /config/esphome/.esphome/build/esp32c3/src/esphome/components/api/api_connection.cpp:377: undefined reference to esphome::light::LightCall::set_brightness(float)' /data/cache/platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: /config/esphome/.esphome/build/esp32c3/src/esphome/components/api/api_connection.cpp:379: undefined reference to esphome::light::LightCall::set_color_mode(esphome::light::ColorMode)’
    /data/cache/platformio/packages/toolchain-riscv32-esp/bin/…/lib/gcc/riscv32-esp-elf/8.4.0/…/…/…/…/riscv32-esp-elf/bin/ld: /config/esphome/.esphome/build/esp32c3/src/esphome/components/api/api_connection.cpp:381: undefined reference to esphome::light::LightCall::set_color_brightness(float)' /data/cache/platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: /config/esphome/.esphome/build/esp32c3/src/esphome/components/api/api_connection.cpp:383: undefined reference to esphome::light::LightCall::set_red(float)’
    /data/cache/platformio/packages/toolchain-riscv32-esp/bin/…/lib/gcc/riscv32-esp-elf/8.4.0/…/…/…/…/riscv32-esp-elf/bin/ld: /config/esphome/.esphome/build/esp32c3/src/esphome/components/api/api_connection.cpp:384: undefined reference to esphome::light::LightCall::set_green(float)' /data/cache/platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: /config/esphome/.esphome/build/esp32c3/src/esphome/components/api/api_connection.cpp:385: undefined reference to esphome::light::LightCall::set_blue(float)’
    /data/cache/platformio/packages/toolchain-riscv32-esp/bin/…/lib/gcc/riscv32-esp-elf/8.4.0/…/…/…/…/riscv32-esp-elf/bin/ld: /config/esphome/.esphome/build/esp32c3/src/esphome/components/api/api_connection.cpp:388: undefined reference to esphome::light::LightCall::set_white(float)' /data/cache/platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: /config/esphome/.esphome/build/esp32c3/src/esphome/components/api/api_connection.cpp:390: undefined reference to esphome::light::LightCall::set_color_temperature(float)’
    /data/cache/platformio/packages/toolchain-riscv32-esp/bin/…/lib/gcc/riscv32-esp-elf/8.4.0/…/…/…/…/riscv32-esp-elf/bin/ld: /config/esphome/.esphome/build/esp32c3/src/esphome/components/api/api_connection.cpp:392: undefined reference to esphome::light::LightCall::set_cold_white(float)' /data/cache/platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: /config/esphome/.esphome/build/esp32c3/src/esphome/components/api/api_connection.cpp:394: undefined reference to esphome::light::LightCall::set_warm_white(float)’
    /data/cache/platformio/packages/toolchain-riscv32-esp/bin/…/lib/gcc/riscv32-esp-elf/8.4.0/…/…/…/…/riscv32-esp-elf/bin/ld: /config/esphome/.esphome/build/esp32c3/src/esphome/components/api/api_connection.cpp:396: undefined reference to esphome::light::LightCall::set_transition_length(unsigned long)' /data/cache/platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: /config/esphome/.esphome/build/esp32c3/src/esphome/components/api/api_connection.cpp:398: undefined reference to esphome::light::LightCall::set_flash_length(unsigned long)’
    /data/cache/platformio/packages/toolchain-riscv32-esp/bin/…/lib/gcc/riscv32-esp-elf/8.4.0/…/…/…/…/riscv32-esp-elf/bin/ld: /config/esphome/.esphome/build/esp32c3/src/esphome/components/api/api_connection.cpp:400: undefined reference to esphome::light::LightCall::set_effect(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' /data/cache/platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: /config/esphome/.esphome/build/esp32c3/src/esphome/components/api/api_connection.cpp:401: undefined reference to esphome::light::LightCall::perform()’
    /data/cache/platformio/packages/toolchain-riscv32-esp/bin/…/lib/gcc/riscv32-esp-elf/8.4.0/…/…/…/…/riscv32-esp-elf/bin/ld: /data/esp32c3/.pioenvs/esp32c3/src/esphome/components/api/api_connection.o: in function esphome::api::APIConnection::send_light_state(esphome::light::LightState*)': /config/esphome/.esphome/build/esp32c3/src/esphome/components/api/api_connection.cpp:314: undefined reference to esphome::light::LightState::get_traits()’
    /data/cache/platformio/packages/toolchain-riscv32-esp/bin/…/lib/gcc/riscv32-esp-elf/8.4.0/…/…/…/…/riscv32-esp-elf/bin/ld: /config/esphome/.esphome/build/esp32c3/src/esphome/components/api/api_connection.cpp:329: undefined reference to esphome::light::LightState::supports_effects()' /data/cache/platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: /config/esphome/.esphome/build/esp32c3/src/esphome/components/api/api_connection.cpp:332: undefined reference to esphome::light::LightState::get_effect_nameabi:cxx11
    /data/cache/platformio/packages/toolchain-riscv32-esp/bin/…/lib/gcc/riscv32-esp-elf/8.4.0/…/…/…/…/riscv32-esp-elf/bin/ld: /data/esp32c3/.pioenvs/esp32c3/src/esphome/components/api/api_connection.o: in function std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()': /data/cache/platformio/packages/toolchain-riscv32-esp/riscv32-esp-elf/include/c++/8.4.0/bits/basic_string.h:657: undefined reference to esphome::light::LightState::get_traits()’
    /data/cache/platformio/packages/toolchain-riscv32-esp/bin/…/lib/gcc/riscv32-esp-elf/8.4.0/…/…/…/…/riscv32-esp-elf/bin/ld: /data/esp32c3/.pioenvs/esp32c3/src/esphome/components/api/api_connection.o: in function esphome::api::APIConnection::send_light_info(esphome::light::LightState*)': /config/esphome/.esphome/build/esp32c3/src/esphome/components/api/api_connection.cpp:351: undefined reference to esphome::light::LightState::supports_effects()’
    /data/cache/platformio/packages/toolchain-riscv32-esp/bin/…/lib/gcc/riscv32-esp-elf/8.4.0/…/…/…/…/riscv32-esp-elf/bin/ld: /config/esphome/.esphome/build/esp32c3/src/esphome/components/api/api_connection.cpp:354: undefined reference to esphome::light::LightState::get_effects() const' /data/cache/platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: /data/esp32c3/.pioenvs/esp32c3/src/esphome/core/controller.o: in function esphome::Controller::setup_controller(bool)’:
    /config/esphome/.esphome/build/esp32c3/src/esphome/core/controller.cpp:23: undefined reference to esphome::light::LightState::add_new_remote_values_callback(std::function<void ()>&&)' /data/cache/platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: /data/esp32c3/.pioenvs/esp32c3/src/main.o: in function esphome::monochromatic::MonochromaticLightOutput::write_state(esphome::light::LightState*)’:
    /config/esphome/.esphome/build/esp32c3/src/esphome/components/monochromatic/monochromatic_light_output.h:20: undefined reference to esphome::light::LightState::current_values_as_brightness(float*)' /data/cache/platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: /config/esphome/.esphome/build/esp32c3/src/esphome/components/monochromatic/monochromatic_light_output.h:21: undefined reference to esphome::output::FloatOutput::set_level(float)’
    /data/cache/platformio/packages/toolchain-riscv32-esp/bin/…/lib/gcc/riscv32-esp-elf/8.4.0/…/…/…/…/riscv32-esp-elf/bin/ld: /data/esp32c3/.pioenvs/esp32c3/src/main.o: in function setup()': /config/esphome/.esphome/build/esp32c3/src/main.cpp:198: undefined reference to esphome::ledc::next_ledc_channel’
    /data/cache/platformio/packages/toolchain-riscv32-esp/bin/…/lib/gcc/riscv32-esp-elf/8.4.0/…/…/…/…/riscv32-esp-elf/bin/ld: /data/esp32c3/.pioenvs/esp32c3/src/main.o: in function std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()': /data/cache/platformio/packages/toolchain-riscv32-esp/riscv32-esp-elf/include/c++/8.4.0/bits/basic_string.h:657: undefined reference to esphome::ledc::next_ledc_channel’
    /data/cache/platformio/packages/toolchain-riscv32-esp/bin/…/lib/gcc/riscv32-esp-elf/8.4.0/…/…/…/…/riscv32-esp-elf/bin/ld: /data/esp32c3/.pioenvs/esp32c3/src/main.o: in function setup()': /config/esphome/.esphome/build/esp32c3/src/main.cpp:199: undefined reference to vtable for esphome::ledc::LEDCOutput’
    /data/cache/platformio/packages/toolchain-riscv32-esp/bin/…/lib/gcc/riscv32-esp-elf/8.4.0/…/…/…/…/riscv32-esp-elf/bin/ld: /config/esphome/.esphome/build/esp32c3/src/main.cpp:199: undefined reference to vtable for esphome::ledc::LEDCOutput' /data/cache/platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: /config/esphome/.esphome/build/esp32c3/src/main.cpp:200: undefined reference to vtable for esphome::ledc::LEDCOutput’
    /data/cache/platformio/packages/toolchain-riscv32-esp/bin/…/lib/gcc/riscv32-esp-elf/8.4.0/…/…/…/…/riscv32-esp-elf/bin/ld: /config/esphome/.esphome/build/esp32c3/src/main.cpp:200: undefined reference to vtable for esphome::ledc::LEDCOutput' /data/cache/platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: /config/esphome/.esphome/build/esp32c3/src/main.cpp:202: undefined reference to esphome::ledc::next_ledc_channel’
    /data/cache/platformio/packages/toolchain-riscv32-esp/bin/…/lib/gcc/riscv32-esp-elf/8.4.0/…/…/…/…/riscv32-esp-elf/bin/ld: /config/esphome/.esphome/build/esp32c3/src/main.cpp:203: undefined reference to esphome::output::FloatOutput::set_zero_means_zero(bool)' /data/cache/platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: /data/esp32c3/.pioenvs/esp32c3/src/main.o: in function .L0 ‘:
    /data/cache/platformio/packages/toolchain-riscv32-esp/riscv32-esp-elf/include/c++/8.4.0/bits/std_function.h:676: undefined reference to esphome::ledc::next_ledc_channel' /data/cache/platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: /data/esp32c3/.pioenvs/esp32c3/src/main.o: in function setup()’:
    /config/esphome/esp32c3.yaml:30: undefined reference to esphome::ledc::next_ledc_channel' /data/cache/platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: /config/esphome/esp32c3.yaml:31: undefined reference to esphome::output::FloatOutput::set_zero_means_zero(bool)’
    /data/cache/platformio/packages/toolchain-riscv32-esp/bin/…/lib/gcc/riscv32-esp-elf/8.4.0/…/…/…/…/riscv32-esp-elf/bin/ld: /config/esphome/esp32c3.yaml:33: undefined reference to esphome::light::LightState::LightState(esphome::light::LightOutput*)' /data/cache/platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: /config/esphome/esp32c3.yaml:57: undefined reference to esphome::light::LightState::set_restore_mode(esphome::light::LightRestoreMode)’
    /data/cache/platformio/packages/toolchain-riscv32-esp/bin/…/lib/gcc/riscv32-esp-elf/8.4.0/…/…/…/…/riscv32-esp-elf/bin/ld: /config/esphome/esp32c3.yaml:57: undefined reference to esphome::light::LightState::set_default_transition_length(unsigned long)' /data/cache/platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: /data/esp32c3/.pioenvs/esp32c3/src/main.o: in function esphome::ledc::LEDCOutput::LEDCOutput(esphome::InternalGPIOPin*)’:
    /config/esphome/.esphome/build/esp32c3/src/esphome/components/ledc/ledc_output.h:18: undefined reference to esphome::light::LightState::set_flash_transition_length(unsigned long)' /data/cache/platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: /data/esp32c3/.pioenvs/esp32c3/src/main.o: in function setup()’:
    /config/esphome/esp32c3.yaml:57: undefined reference to esphome::light::LightState::set_gamma_correct(float)' /data/cache/platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: /data/esp32c3/.pioenvs/esp32c3/src/main.o: in function esphome::output::FloatOutput::FloatOutput()’:
    /config/esphome/.esphome/build/esp32c3/src/esphome/components/output/float_output.h:31: undefined reference to esphome::light::LightState::add_effects(std::vector<esphome::light::LightEffect*, std::allocator<esphome::light::LightEffect*> > const&)' /data/cache/platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: /data/esp32c3/.pioenvs/esp32c3/src/main.o: in function esphome::ledc::LEDCOutput::set_frequency(float)’:
    /config/esphome/.esphome/build/esp32c3/src/esphome/components/ledc/ledc_output.h:21: undefined reference to esphome::light::LightState::LightState(esphome::light::LightOutput*)' /data/cache/platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: /data/esp32c3/.pioenvs/esp32c3/src/main.o: in function esphome::ledc::LEDCOutput::LEDCOutput(esphome::InternalGPIOPin*)’:
    /config/esphome/.esphome/build/esp32c3/src/esphome/components/ledc/ledc_output.h:18: undefined reference to esphome::light::LightState::set_restore_mode(esphome::light::LightRestoreMode)' /data/cache/platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: /data/esp32c3/.pioenvs/esp32c3/src/main.o: in function setup()’:
    /config/esphome/esp32c3.yaml:83: undefined reference to esphome::light::LightState::set_default_transition_length(unsigned long)' /data/cache/platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: /data/esp32c3/.pioenvs/esp32c3/src/main.o: in function esphome::output::FloatOutput::FloatOutput()’:
    /config/esphome/.esphome/build/esp32c3/src/esphome/components/output/float_output.h:31: undefined reference to esphome::light::LightState::set_flash_transition_length(unsigned long)' /data/cache/platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: /data/esp32c3/.pioenvs/esp32c3/src/main.o: in function esphome::ledc::LEDCOutput::LEDCOutput(esphome::InternalGPIOPin*)’:
    /config/esphome/.esphome/build/esp32c3/src/esphome/components/ledc/ledc_output.h:18: undefined reference to esphome::light::LightState::set_gamma_correct(float)' /data/cache/platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: /data/esp32c3/.pioenvs/esp32c3/src/main.o: in function esphome::ledc::LEDCOutput* esphome::Application::register_componentesphome::ledc::LEDCOutput(esphome::ledc::LEDCOutput*)’:
    /config/esphome/.esphome/build/esp32c3/src/esphome/core/application.h:132: undefined reference to esphome::light::LightState::add_effects(std::vector<esphome::light::LightEffect*, std::allocator<esphome::light::LightEffect*> > const&)' /data/cache/platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld: /data/esp32c3/.pioenvs/esp32c3/src/main.o:(.rodata._ZTVN7esphome13monochromatic24MonochromaticLightOutputE[_ZTVN7esphome13monochromatic24MonochromaticLightOutputE]+0xc): undefined reference to esphome::light::LightOutput::create_default_transition()’
    collect2: error: ld returned 1 exit status
    *** [/data/esp32c3/.pioenvs/esp32c3/firmware.elf] Error 1
    ========================= [FAILED] Took 12.64 seconds =========================

Someone else with same issues ?

Thanks

Vincèn