ESP32-C3 + LittleFs + USB serial/jtag issues
Posted: Wed Aug 10, 2022 9:52 am
Hardware : ESP32-C3 AI thinker C3FN4 module with 4MB flash, using onboard USB serial/JTAG for flash and debug
Software development environment : VSC + PlatformIO + arduino framework
If I use older releases for the arduino framework e.g. 2.0.2 I get build errors for USB Serial, so 2.0.2 or earlier is not a solution.
If I user newer releases e.g. 2.0.3 I can build and flash successfully.
But with board_build.flash_mode = qio, I get boot loops.
With board_build.flash_mode = dio, I get a LittleFS mount error.
Based on this supposedly resolved issue, we need to specify flash_mode as qio
https://github.com/espressif/arduino-esp32/issues/6579
I tried specifying framework v2.0.3 in platformio.ini and this results in bootloops.
Based on this
viewtopic.php?p=85621 using qio results in bootloops so we need to specify dio
If I specify dio, the code boots but I get LittleFS mount errors.
platformio.ini
partitions.csv
I also tried this example partitions file from the link above (apparently working for them with qio and 2.0.3), no difference
I would appreciate any pointers on a working platformio.ini for an AI Thinker C3FN4 module that will resolve the boot loops and
LittleFS mounting errors while still supporting USB CDC on boot.
Thanks !
Software development environment : VSC + PlatformIO + arduino framework
If I use older releases for the arduino framework e.g. 2.0.2 I get build errors for USB Serial, so 2.0.2 or earlier is not a solution.
If I user newer releases e.g. 2.0.3 I can build and flash successfully.
But with board_build.flash_mode = qio, I get boot loops.
With board_build.flash_mode = dio, I get a LittleFS mount error.
Based on this supposedly resolved issue, we need to specify flash_mode as qio
https://github.com/espressif/arduino-esp32/issues/6579
I tried specifying framework v2.0.3 in platformio.ini and this results in bootloops.
Based on this
viewtopic.php?p=85621 using qio results in bootloops so we need to specify dio
If I specify dio, the code boots but I get LittleFS mount errors.
platformio.ini
Code: Select all
[env:esp32c3]
platform = https://github.com/tasmota/platform-espressif32/releases/download/v.2.0.3/platform-espressif32-v.2.0.3.zip
platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#2.0.3
framework = arduino
board = esp32-c3-devkitm-1
board_build.partitions = partitions.csv
board_build.flash_mode = qio
board_build.f_cpu = 80000000L
build_flags =
-DARDUINO_USB_MODE=1
-DARDUINO_USB_CDC_ON_BOOT
upload_speed = 460800
monitor_speed = 115200
upload_port = /dev/ttyACM1
monitor_port = /dev/ttyACM1
build_type = debug
monitor_filters = esp32_exception_decoder
extra_scripts = ./littlefsbuilder.py
Code: Select all
# Name, Type, SubType, Offset, Size, Flags
# App partition x 2 : 1966080 bytes
ota_0, app, ota_0, 0x10000, 0x1E0000,
ota_1, app, ota_1, , 0x1E0000,
otadata, data, ota, , 0x2000,
nvs, data, nvs, , 0x6000,
# SPIFFS partition : 163840 bytes
spiffs, data, spiffs, , 0x28000,
I also tried this example partitions file from the link above (apparently working for them with qio and 2.0.3), no difference
Code: Select all
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x5000,
otadata, data, ota, 0xe000, 0x2000,
app0, app, ota_0, 0x10000, 0x1D0000,
app1, app, ota_1, 0x1E0000, 0x1D0000,
spiffs, data, spiffs, 0x3B0000, 0x50000,
LittleFS mounting errors while still supporting USB CDC on boot.
Thanks !