I posted here already, but got no reply. I think this sub-forum is more applicable. Maybe my old thread could be merged with this one? Meanwhile, I will duplicate the question in the hopes that someone can help me with my issue.
I was trying to use the littleFS filesystem on an Adafruit Feather ESP32-S3 (using PlatformIO). The filesystem uploads without complaints, but I cannot successfully access the files. I tried the same code (just exchanged the board in the PlatformIO ini) with the Unexpected Maker FeatherS3 board and it works like a charm.
The program I used is just a small test. There is a "test.tx" file inside a "data" folder. I am trying to read the content ("Hello") and print it to the serial port.
Test-program (main.cpp in VS Code):
Code: Select all
#include <Arduino.h>
#include "LittleFS.h"
static volatile uint32_t last_print_ms{millis()};
void setup()
{
Serial.begin(115200);
if (!LittleFS.begin())
{
Serial.println("An Error has occurred while mounting LittleFS");
return;
}
}
void loop()
{
if (millis() - last_print_ms >= 2000)
{
last_print_ms = millis();
File file = LittleFS.open("/test.txt", "r");
if (!file)
{
Serial.println("Failed to open file for reading");
return;
}
Serial.println("File Content:");
while (file.available())
{
Serial.write(file.read());
}
file.close();
}
}
Code: Select all
[env:adafruit_feather_esp32s3]
platform = espressif32
board = adafruit_feather_esp32s3
; board = um_feathers3
board_build.filesystem = littlefs
monitor_speed = 115200
framework = arduino
Code: Select all
Processing adafruit_feather_esp32s3 (platform: espressif32; board: adafruit_feather_esp32s3; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/adafruit_feather_esp32s3.html
PLATFORM: Espressif 32 (6.1.0) > Adafruit Feather ESP32-S3 2MB PSRAM
HARDWARE: ESP32S3 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-builtin, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
- framework-arduinoespressif32 @ 3.20007.0 (2.0.7)
- tool-esptoolpy @ 1.40500.0 (4.5.0)
- tool-mklittlefs @ 1.203.210628 (2.3)
- toolchain-riscv32-esp @ 8.4.0+2021r2-patch5
- toolchain-xtensa-esp32s3 @ 8.4.0+2021r2-patch5
LDF: Library Dependency Finder -> https://BANNED/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 33 compatible libraries
Scanning dependencies...
Dependency Graph
|-- LittleFS @ 2.0.0
Building in release mode
Building FS image from 'data' directory to .pio\build\adafruit_feather_esp32s3\littlefs.bin
/test.txt
============================================================================================================== [SUCCESS] Took 1.11 seconds ==============================================================================================================
Code: Select all
Processing adafruit_feather_esp32s3 (platform: espressif32; board: adafruit_feather_esp32s3; framework: arduino)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/adafruit_feather_esp32s3.html
PLATFORM: Espressif 32 (6.1.0) > Adafruit Feather ESP32-S3 2MB PSRAM
HARDWARE: ESP32S3 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-builtin, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
- framework-arduinoespressif32 @ 3.20007.0 (2.0.7)
- tool-esptoolpy @ 1.40500.0 (4.5.0)
- tool-mkfatfs @ 2.0.1
- tool-mklittlefs @ 1.203.210628 (2.3)
- tool-mkspiffs @ 2.230.0 (2.30)
- toolchain-riscv32-esp @ 8.4.0+2021r2-patch5
- toolchain-xtensa-esp32s3 @ 8.4.0+2021r2-patch5
LDF: Library Dependency Finder -> https://BANNED/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 33 compatible libraries
Scanning dependencies...
Dependency Graph
|-- LittleFS @ 2.0.0
Building in release mode
Building FS image from 'data' directory to .pio\build\adafruit_feather_esp32s3\littlefs.bin
/test.txt
Looking for upload port...
Auto-detected: COM9
Forcing reset using 1200bps open/close on port COM9
Waiting for the new upload port...
Uploading .pio\build\adafruit_feather_esp32s3\littlefs.bin
esptool.py v4.5
Serial port COM9
Connecting...
Chip is ESP32-S3 (revision v0.1)
Features: WiFi, BLE
Crystal is 40MHz
MAC: 70:04:1d:cd:d3:74
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Flash will be erased from 0x00310000 to 0x003fffff...
Compressed 983040 bytes to 1221...
Writing at 0x00310000... (100 %)
Wrote 983040 bytes (1221 compressed) at 0x00310000 in 6.1 seconds (effective 1286.4 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
================================================================================================ [SUCCESS] Took 16.12 seconds ================================================================================================