Having problems with spiffs not mounting anymore

orbitcoms
Posts: 141
Joined: Fri Aug 03, 2018 10:08 pm
Location: Sydney, Australia

Having problems with spiffs not mounting anymore

Postby orbitcoms » Tue May 04, 2021 9:14 am

I am having a "strange" issue arise that has not appeared before.
My projects are created in vscode running the esp-idf extension.

Several projects use Spiffs and have been working fine.

Today I was working on a particular project and it was fine. I then switched to a wifi project and as soon as I attempted to browse to the url for the ESP, I get a spiffs not mounting error (the route path handler sets up spiffs).

So, I then go back to my other project that also uses spiffs and now that also has a spiffs error. I erased the flash and rebuilt and then it formatted the spiffs. So I built again and it still does not mount spiffs.

I copied a project to home and ran it ok, spiffs is fine. Then copied back to my office machine an spiffs issue appeared again. I tried on my own hardware (using WROOM) and also on the dev kit with WROVER. Both have same problem.

I uninstalled and reinstalled both vscode and esp-idf but cannot get rid of the problem.

The very first time I had any issues with spiffs was yesterday when the esp-idf extension was updated.

Thanks for any help to fix it or ideas to debug the issue and see what is causing this.

ESP_Minatel
Posts: 361
Joined: Mon Jan 04, 2021 2:06 pm

Re: Having problems with spiffs not mounting anymore

Postby ESP_Minatel » Tue May 04, 2021 9:34 am

Hi,

You are duplicating here: viewtopic.php?f=40&t=20721&p=75890&hilit=SPIFFS#p75890

Please, inform the ESP-IDF version you're using and some log from the monitor.

ESP_Minatel
Posts: 361
Joined: Mon Jan 04, 2021 2:06 pm

Re: Having problems with spiffs not mounting anymore

Postby ESP_Minatel » Tue May 04, 2021 9:52 am

According to your project attached on the other post, you are missing the definition of the csv file.

Code: Select all

#
# Partition Table
#
# CONFIG_PARTITION_TABLE_SINGLE_APP is not set
# CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE is not set
# CONFIG_PARTITION_TABLE_TWO_OTA is not set
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
CONFIG_PARTITION_TABLE_OFFSET=0x8000
CONFIG_PARTITION_TABLE_MD5=y
# end of Partition Table

and you need also to change the flash memory size. Here the code works!

Code: Select all

CONFIG_ESPTOOLPY_FLASHSIZE="8MB"

orbitcoms
Posts: 141
Joined: Fri Aug 03, 2018 10:08 pm
Location: Sydney, Australia

Re: Having problems with spiffs not mounting anymore

Postby orbitcoms » Tue May 04, 2021 10:57 am

The project uses WROOM32 with 4MB of flash.

I set the flash memory size in the config in vscode to 4MB.

Why would 3 different projects all start having issues with spiffs. Is there a setting in vscode that is independent?

Yesterday a colleague remote logged into my office machine to take a look. "Mysteriously" the issue did not occur when we ran the projects.

Today I had been working all day on one of the projects no problem. Then later in the day I started working on another project that uses spiffs for wifi during root route handling. The code compiled fine but as I navigated to the route (where spiffs is initialialized) I got a spiffs mount failure. I then closed the project and re-opened the one I had been working on all day without issue and now spiffs in that project stopped too. So, I erased the flash, did a full clean and re-flash but cannot get the spiffs to work any more.

I took the wifi code project home and ran on other hardware on my home machine and spiffs works fine (using the same code and config file with same flash size settings)

Next, I uninstalled vscode and esp-idf and installed again from scratch. I cleaned out my folder and renewed the project files pulling in from git. Still I cannot get spiffs running again.

I don't understand why the problem went away when someone remoted in and I watched as he simply looked at the config without changing it, save and re-build and flash. And, why it has worked all day and only stopped when I ran the wifi project (which works fine at home) and after this, none of the projects using spiffs will mount properly.

Maybe, something happened to the ESP flash that erase does not repair but something else does?

Really stumped here.

Attached shows my flash size and partition definition settings
Attachments
flash size.png
flash size.png (37.25 KiB) Viewed 11767 times
partition assign.png
partition assign.png (106.22 KiB) Viewed 11767 times

ESP_Minatel
Posts: 361
Joined: Mon Jan 04, 2021 2:06 pm

Re: Having problems with spiffs not mounting anymore

Postby ESP_Minatel » Tue May 04, 2021 11:56 am

That's odd. No clue about it.

I'll test again, but here it seems to work with no problem.

orbitcoms
Posts: 141
Joined: Fri Aug 03, 2018 10:08 pm
Location: Sydney, Australia

Re: Having problems with spiffs not mounting anymore

Postby orbitcoms » Tue May 04, 2021 9:31 pm

I don't know what to try next.

At home the code runs fine on the ESP32 WROVER 4 kit.

I brought the kit to the office this morning, moved my project to a completely new folder, rebuilt the code and again I get the spiffs error, on the hardware that works at home using the code that works at home.

So, I have tried on my own custom hardware running WROOM and 2 Development kits running WROVER and all 3 hardware have the spiffs error. And, I have tried several projects that have had NO problems with spiffs and now ALL of them have spiffs issue.

If the problem is not in the hardware of the firmware then what externally can interfere with spiffs ON THE CHIP?

As I first mentioned, this issue ONLY started to appear straight after ESP-IDF vscode extension was updated to v1.0.3 and I cannot see how this affects spiffs???

One thing I do note that I did not see in past is that when I click on icon in vscode to do full clean I get an "ebusy:resource busy or locked" error as attached.
Attachments
ebusy.jpg
ebusy.jpg (28.37 KiB) Viewed 11722 times

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Having problems with spiffs not mounting anymore

Postby WiFive » Tue May 04, 2021 10:40 pm

Are you flashing the spiffs partition with an image? Have you compared those binary images?

orbitcoms
Posts: 141
Joined: Fri Aug 03, 2018 10:08 pm
Location: Sydney, Australia

Re: Having problems with spiffs not mounting anymore

Postby orbitcoms » Tue May 04, 2021 10:43 pm

Some projects are flashing image to spiffs and others are not.

Also, how do you "compare" images?

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Having problems with spiffs not mounting anymore

Postby WiFive » Tue May 04, 2021 10:51 pm

Binary diff or hex editor or simple hash

orbitcoms
Posts: 141
Joined: Fri Aug 03, 2018 10:08 pm
Location: Sydney, Australia

Re: Having problems with spiffs not mounting anymore

Postby orbitcoms » Tue May 04, 2021 11:16 pm

I cannot read anything in spiffs, how can I compare the image in folder to spiffs?

BTW: I was wrong, my projects do have images that get copied into flash.

I just ran the esp example spiffs project and it failed to mount but then formatted the flash and runs ok.

Then I went back to my project but spiffs fails again.

Next, I created a new project that mounts spiffs but not flash image and when this runs it formats the spiffs and then mounts ok.

So, it seems the issue has to do with projects that are copying images into spiffs.

Has anything changed in the cmakelists function for flashing images?

Who is online

Users browsing this forum: Majestic-12 [Bot] and 86 guests