ESP32-S3 Issue with LittleFS
00:17 17 Sep 2024

I'm trying to build a sketch in Arduino IDE with LittleFS to work on my ESP32-S3. and got an error about corrupted LittleFS

My code:

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
void setup() {
  if (!LittleFS.begin()) {
      Serial.println("LittleFS mount failed, formatting...");
      if (LittleFS.format()) {
          Serial.println("LittleFS formatted successfully.");
          if (LittleFS.begin()) {
              Serial.println("LittleFS mounted successfully.");
          } else {
              Serial.println("Failed to mount LittleFS after formatting.");
          }
      } else {
          Serial.println("Failed to format LittleFS.");
      }
  } else {
      Serial.println("LittleFS mounted successfully.");
  }
}

Output:

ESP-ROM:esp32s3-20210327 Build:Mar 27 2021 rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT) SPIWP:0xee mode:DIO, clock div:1 load:0x3fce3818,len:0x109c load:0x403c9700,len:0x4 load:0x403c9704,len:0xb50 load:0x403cc700,len:0x2fd0 entry 0x403c98ac E (4444) esp_littlefs: ./managed_components/joltwallet__littlefs/src/littlefs/lfs.c:1369:error: Corrupted dir pair at {0x0, 0x1} E (4445) esp_littlefs: mount failed, (-84) E (4448) esp_littlefs: Failed to initialize LittleFS E (9188) task_wdt: esp_task_wdt_reset(763): task not found

How can I troubleshoot this?

By the way, I don't have this problem with ESP32-WROOM-32 with the same sketch file. Should I use something else to reach the goal ?

esp32 arduino-esp32