With the latest version of the espressif32 platform, my project becomes too big for the default partition layout, so I switched to min_spiffs.csv.
The problem is that LittleFS.begin
fails on a c3 (using board = esp32-c3-devkitc-02
) while it works on an esp32doit-devkit-v1
board.
Both have 4MB of flash so I don’t understand what the problem is.
For the time being I’m using platform = espressif32@6.9.0
so the project fits in the default partition layout.
The latest official available espressif32 platform is 6.10.0 which provides Arduino 2.0.17.
The latest available Espressif32 Arduino is 3.2.0 by the community platform pioarduino/platform-espressif32
platform = https://github.com/pioarduino/platform-espressif32/releases/download/54.03.20/platform-espressif32.zip
How does it fail? Do you have any error messages?
By latest I mean the one without any specifier, i.e platform = espressif32
instead of platform = espressif32@6.9.0
but I see now that I didn’t update to 6.10.0 in the PIO home, so when building it uses PLATFORM: Espressif 32 (51.3.6+sha.ec17486)
Now I’m not near the board and in a hurry to get it working I didn’t take note of the error I don’t remember if it was “bad magic” or “corrupted”.
using 6.10.0 the project fits in the default partition layout
You can choose one of the existing partition layouts or specify a custom partition layout
https://docs.platformio.org/en/latest/platforms/espressif32.html#partition-tables
Yes, but the problem was that using min_spiffs.csv and that version of the platform (51.3.6+sha.ec17486
(*)) littlefs wouldn’t initialize on the c3.
(*) I don’t know where it came from, maybe when, a while ago, I tried to compile a project for a c3 supermini, which eventually I deployed with esphome. Now I uninstalled it to avoid problems in the future.
This is using 6.10.0 and min_spiffs.csv
ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0x1 (POWERON),boot:0xe (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd5810,len:0x438
load:0x403cc710,len:0x90c
load:0x403ce710,len:0x2624
entry 0x403cc710
E (215) esp_core_dump_flash: Core dump data check failed:
Calculated checksum='e71b59�Accepted new float value -273.00 for /simultemp
Accepted new float value 0.00 for /temp
Accepted new float value 0.00 for /boiler
Accepted new string value off for /boiler
Accepted new int value 0 for /fan
Accepted new string value off for /fan
E (292) esp-tls: [sock=48] connect() error: Host is unreachable
E (294) TRANSPORT_BASE: Failed to open a new connection: 32772
E (294) MQTT_CLIENT: Error transport connect
[ 287][I][ESP32MQTTClient.cpp:204] printError(): ERROR TYPE: MQTT_ERROR_TYPE_TCP_TRANSPORT
[ 306][I][ESP32MQTTClient.cpp:208] printError(): ERROR CODE: MQTT_ERROR_TYPE_NONE
[ 313][I][ESP32MQTTClient.cpp:409] onEventCallback(): mqtt://192.168.43.1:1883 disconnected (0.313000s)
[ 2922][I][ArduinoOTA.cpp:141] begin(): OTA server at: truminus.local:3232
IP address 192.168.43.80
E (2939) esp_littlefs: ./components/esp_littlefs/src/littlefs/lfs.c:1367:error: Corrupted dir pair at {0x0, 0x1}
E (2940) esp_littlefs: mount failed, (-84)
E (2944) esp_littlefs: Failed to initialize LittleFS
[ 2939][E][LittleFS.cpp:98] begin(): Mounting LittleFS failed! Error: -1
**** cannot start LittleFS
I did an “upload”, then “build filesystem image”, then “upload filesystem image”, so you think I should have done an “erase flash and upload”?
The fact is, I followed the same procedure (without “erase flash and upload”) for both esps and it worked with the esp32-wroom.
In any case I’ll try again in case I missed some step (I don’t have a c3 nearby right now).
It’s actually esphome that installed that version I know because, when I compiled an esphome project, I saw it pulling the version that I uninstalled.
Nevermind, now I always put the version in platformio.ini.