espressif / arduino-esp32

Arduino core for the ESP32
GNU Lesser General Public License v2.1
13.61k stars 7.41k forks source link

filesystemStart() results in: "E (1121) SPIFFS: mount failed, -10025" #5786

Open ArminJo opened 3 years ago

ArminJo commented 3 years ago

Hardware:

Board: ESP32-CAM Core Installation version: 2.0.0 IDE name: Eclipse / Sloeber Computer OS: Windows 10

2021-10-20 18_59_55-Properties for ESP32_Cam

Description:

Running Code

            filesystemStart();
            loadPrefs(SPIFFS);

on a fresh ESP32-CAM results in:

Camera init succeeded
OV2640 camera module detected
E (1121) SPIFFS: mount failed, -10025
ets Jul 29 2019 12:21:46

rst:0x8 (TG1WDT_SYS_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)

I would expect to see the serial output SPIFFS Mount failed, this can happen on first-run initialisation. and not a watchdog reset.

void filesystemStart(){
  while ( !SPIFFS.begin(FORMAT_SPIFFS_IF_FAILED) ) {
    // if we sit in this loop something is wrong; 
    // if no existing spiffs partition exists one should be automagically created.
    Serial.println("SPIFFS Mount failed, this can happen on first-run initialisation.");
    Serial.println("If it happens repeatedly check if a SPIFFS partition is present for your board?");
    for (int i=0; i<10; i++) {
      flashLED(100); // Show SPIFFS failure
      delay(100);
    }
    delay(1000);
    Serial.println("Retrying..");
  }
  Serial.println("Internal filesystem contents");
  listDir(SPIFFS, "/", 0);
}

After uploading the Arduino example "SPIFFS_Test", the same code runs fine!!!

OV2640 camera module detected
Internal filesystem contents
Listing SPIFFS directory: /
VojtechBartoska commented 2 years ago

Hello @ArminJo, is this still valid? If yes, can you please test this on v2.0.3-RC1?

ArminJo commented 2 years ago

OK, but how can I remove the Spiffs data written by the Arduino example "SPIFFS_Test"? I do not have any "fresh" ESP-Cam any more.

lbernstone commented 2 years ago

https://docs.espressif.com/projects/esptool/en/latest/esp32/esptool/basic-commands.html#erase-flash-erase-flash-erase-region esptool.py is usually located in %AppData%\Arduino15\packages\esp32\tools on Windows.

ArminJo commented 2 years ago

Hi, the reset has gone, but the return of the SPIFFSFS::begin(bool formatOnFail is always true, so I still do not see my error message SPIFFS Mount failed, this can happen on first-run initialisation. The output shows now:

E (1121) SPIFFS: mount failed, -10025
cam_hal: EV-EOF-OVF
cam_hal: EV-EOF-OVF
cam_hal: EV-VSYNC-OVF
cam_hal: EV-EOF-OVF
cam_hal: EV-EOF-OVF
cam_hal: EV-EOF-OVF
cam_hal: EV-EOF-OVF
cam_hal: EV-EOF-OVF
cam_hal: EV-EOF-OVF
cam_hal: EV-EOF-OVF
cam_hal: EV-VSYNC-OVF
cam_hal: EV-EOF-OVF
cam_hal: EV-EOF-OVF
cam_hal: EV-EOF-OVF
cam_hal: EV-EOF-OVF
cam_hal: EV-EOF-OVF
cam_hal: EV-EOF-OVF
cam_hal: EV-VSYNC-OVF
cam_hal: EV-EOF-OVF
cam_hal: EV-EOF-OVF
cam_hal: EV-VSYNC-OVF
cam_hal: EV-EOF-OVF
cam_hal: EV-VSYNC-OVF
cam_hal: EV-EOF-OVF
Internal filesystem contents
Listing SPIFFS directory: /
Preference file /esp32cam-preferences.json not found; using system defaults.