Page 1 of 1

Arduino Framework not available for C3 devkit on PlatformIO

Posted: Wed Feb 02, 2022 8:20 am
by jdu_30
Hi,
sorry if that's a newby question but I was looking for a way to select Arduino Framework on Platform IO with a ESP32-C3-DevkitM-1 board.
For other ESP32 boards, I can select either ESPIDF or Arduino Framework. But, here, only the ESPIDF Framework is available.
That said, on the documentation here:
https://docs.espressif.com/projects/ard ... rted-soc-s
we can see ESP-C3 is currently supported by Arduino-EPS32 project.

And on the installation tutorial, we can see the C3 requires the "dev" package, and not the "released" one.
https://docs.espressif.com/projects/ard ... lling.html
That is probably for Arduino Development software, and there is nothing more described for PlatformIO.

Has somebody the solution to setup PlatformIO in order to be able to use Arduino Framework for this chip?
Best regards
Julien

Re: Arduino Framework not available for C3 devkit on PlatformIO

Posted: Thu Feb 03, 2022 3:03 am
by xien551
For IDF,
4.2 not support C3,
4.3 support C3, but S3 is not very well.
4.4 support C3 and S3, not support H.

I guess that the Arduino Frame work is based on IDF, but version is low, for example 4.2.
You can contact ESP to rebuilt the Arduino with IDF 4.4, which is also support S3.

The above is just a guess, may be wrong, hope to help you

Re: Arduino Framework not available for C3 devkit on PlatformIO

Posted: Thu Feb 03, 2022 10:19 am
by pataga
I forget where I found this workaround for ESP32-C3 (try Googling) , but this platformio.ini works for an ESP32-C3M module. I am using a custom partitions.csv local to the project :

Code: Select all

[env:esp32c3]
platform = https://github.com/platformio/platform-espressif32.git#feature/idf-master
platform_packages = 
	toolchain-riscv-esp
	framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32
	platformio/tool-esptoolpy @ ~1.30100
framework = arduino
board = esp32dev
board_build.mcu = esp32c3
board_build.variant = esp32c3
board_build.f_cpu = 80000000L
board_build.f_flash = 80000000L
board_build.flash_mode = qio
board_build.arduino.ldscript = esp32c3_out.ld
board_build.partitions = partitions.csv 
build_unflags = 
	-DARDUINO_ESP32_DEV
	-DARDUINO_VARIANT="esp32"
build_flags = 
	-DARDUINO_ESP32C3_DEV
	-DARDUINO_VARIANT="esp32c3"

lib_deps =
    AsyncElegantOTA
    AsyncTCP
    https://github.com/me-no-dev/ESPAsyncWebServer.git

upload_port = /dev/ttyUSB*
upload_speed = 460800
monitor_port = /dev/ttyUSB*
monitor_speed = 115200
build_type = debug
monitor_filters = esp32_exception_decoder

extra_scripts = ./littlefsbuilder.py
There are still some issues, the risc-v toolchain has a build error in AsyncTCP (ambiguous type, easily fixed) that the ESP32 toolchain does not call out.

Also opening a websocket connection causes a crash (Load Access error?), same project build for ESP32 works without issues.