This is a Arduino library, but you’re using the ESP-IDF framework. These are not compatible to each other.
It seems to me that you’re trying to use a ESP32-C3 board with Arduino instead of the ESP-IDF SDK. Using the new Arduino 2.0 core which supports C3 board is an open issue (https://github.com/platformio/platform-espressif32/issues/619), and due to the war, we can’t expect anything there at the moment, but should instead pray for the developers to get out of this alive.
However, other uses have made custom platform extensions that can help you. I currently recommend for you using the
platform = https://github.com/Jason2866/platform-espressif32.git
board = esp32-c3-devkitm-1
framework = arduino
platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git
lib_deps = adafruit/Adafruit NeoPixel@^1.10.4
(Requires Git to be installed).
Be aware, this installs the bleeding edge platform and Arduino core, which might have bugs.
(I currently don’t recommend using the version at https://github.com/platformio/platform-espressif32/issues/619#issuecomment-1002306803 because
String.replace() has a bug that makes it unusable).
platformio.ini and a
I can compile successfully.
|-- <Adafruit NeoPixel> 1.10.4
Building in release mode
Retrieving maximum program size .pio\build\esp32-c3-devkitm-1\firmware.elf
Checking size .pio\build\esp32-c3-devkitm-1\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [ ] 2.8% (used 9216 bytes from 327680 bytes)
Flash: [= ] 13.0% (used 170118 bytes from 1310720 bytes)
Creating esp32c3 image...
Merged 2 ELF sections
Successfully created esp32c3 image.
=======================[SUCCESS] Took 4.54 seconds =======================
Note: After saving the new
platformio.ini, PlatformIO will do a task refresh in which it downloads the new platform. This will take a few minutes to complete, depending on the internet and Github connection speed. Before the task refreshing has not finished, one should not press the Build button.
Note 2: If you already created a ESP-IDF project, then PlatformIO may have create CMakeLists.txt and
src/main.c etc. for you. You can delete these files and only create src/main.cpp with the code above.