Skip to content

Mounting SPIFFS failed on ESP32-C3 #7582

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
meibao-real opened this issue Dec 12, 2022 · 8 comments
Closed
1 task done

Mounting SPIFFS failed on ESP32-C3 #7582

meibao-real opened this issue Dec 12, 2022 · 8 comments
Labels
Status: Awaiting triage Issue is waiting for triage

Comments

@meibao-real
Copy link

Board

ESP32-C3FN4

Device Description

Nothing Attached

Hardware Configuration

no

Version

latest master (checkout manually)

IDE Name

PlatformIO

Operating System

Windows 10

Flash frequency

40Mhz

PSRAM enabled

no

Upload speed

115200

Description

Hello,Attempts to mount a LittleFS filesystem fails on ESP32-C3...
and ,, I noticed that there was a similar problem #6579 but when I set it to the QIO mode, it still did not work
and the platformio.ini content is:

; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[env:airm2m_core_esp32c3]
platform = espressif32
board = airm2m_core_esp32c3
framework = arduino
board_build.partitions = partition.csv
monitor_speed = 115200
board_build.flash_mode = qio
board_build.f_cpu = 160000000L
board_build.filesystem = littlefs
monitor_filters = esp32_exception_decoder
lib_deps = 
	bblanchon/ArduinoJson@^6.19.4
	arduino-libraries/NTPClient@^3.2.1
	mathertel/OneButton@^2.0.3
	h2zero/NimBLE-Arduino@^1.4.0
	knolleary/PubSubClient@^2.8

use partition.csv content is:

# Name,   Type, SubType, Offset,    Size,   Flags
nvs,      data, nvs,     0x9000,    0x3000,
phy_init, data, phy,     ,          0x1000,

factory,  app,  factory, ,          3M,

spiffs,   data, spiffs,  ,          0xF0000,

Sketch

#include "SPIFFS.h"
#include "FS.h"

void setup() {
    SPIFFS.begin(false, "/spiffs", 5, NULL);
    File file = SPIFFS.open("/spiffs/config.txt", FILE_READ);
    if(!file){
        Serial.println("There was an error opening the file for writing");
        return;
    }
}

Debug Message

E (198) SPIFFS: mount failed, -10025
[   194][E][SPIFFS.cpp:89] begin(): Mounting SPIFFS failed! Error: -1
[   194][E][vfs_api.cpp:24] open(): File system is not mounted
There was an error opening the file for writing

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.
@meibao-real meibao-real added the Status: Awaiting triage Issue is waiting for triage label Dec 12, 2022
@felmue
Copy link

felmue commented Dec 12, 2022

Hello @amibk

I think this line board_build.filesystem = littlefs in your platformio.ini file sets the filesystem up as littlefs and I don't think you can mix it with SPIFFS unless I am mistaken.

Thanks
Felix

@meibao-real
Copy link
Author

Hello @amibk

I think this line board_build.filesystem = littlefs in your platformio.ini file sets the filesystem up as littlefs and I don't think you can mix it with SPIFFS unless I am mistaken.

Thanks Felix

Hello @felmue ,
I deleted this line and tried again, but SPIFFS still doesn't work
Thanks

@lbernstone
Copy link
Contributor

Are you uploading a filesystem? If not, then you need to initialize the fs on first boot (SPIFFS.begin(true);)

@meibao-real
Copy link
Author

Are you uploading a filesystem? If not, then you need to initialize the fs on first boot (SPIFFS.begin(true);)

yeah,i did, and SPIFFS.begin in first line, SPIFFS.begin(false, "/spiffs", 5, NULL); that first line
thanks

@lbernstone
Copy link
Contributor

Does the SPIFFS example work?

@meibao-real
Copy link
Author

Does the SPIFFS example work?

Oh heck.. this demo is working, i create new project in PlatformIO IDE,no partition,no upload filesystem image , but it's working , dont why...

@meibao-real
Copy link
Author

SPIFFS is OK, the problem has been solved, and the problem is platformio.ini file configure error,sorry

@TiagoMagSilva
Copy link

Hi @meibao-real. You said the problem was solved but you did not show how you did it. Can you, please help me? I'm having the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Awaiting triage Issue is waiting for triage
Projects
None yet
Development

No branches or pull requests

4 participants