SPIFFS fails to mount when compiled/flashed on one PC but not on another?

Hi

I have since long a laptop with 1.8.19 IDE installed.
It also has since some time 2.2.1 IDE installed.

I can program an ESP32 Devkit C v4.0 module with either of the IDE's on this PC and it works fine.
The ESP also has a SPIFFS and some data are uploaded to SPIFFS with 1.8.19 IDE data upload plugin. It works fine.

The laptop is running windows 10.

Then I have a new laptop with windows 11 and IDE 2.2.1 installed. I have copied my project form the old laptop to the new, and have the same boards and libraries installed, afaik.

It works fine compiling the project on the new laptop and download works to, but the ESP does not run. The log is as below.

It seems the SPIFFS is the problem and the ESP is rebooted because the SPIFFS fails to mount.

The Partition Scheme is set the same on both laptops, 4 MB with spiffs (1.2Mb App/1.5Mb spiffs).

One thing I notice is that the log below says "mode:DIO" but the IDE is set to Flash Mode "QIO". It is however the same on both the old and the new laptop. Changing to Flash Mode DIO on the new laptop does not make any difference.

If I first flash on old laptop both SW and data, the ESP will work fine.
If I then flash SW on new laptop the ESP will not work.
If I then flash on old laptop again, just SW, then the ESP will work fine again, the data on the SPIFFS is still there despite the mounting issue after flash on the new laptop.

I also tried the SPIFFS_Test.ino compiled and flashed from the new laptop and that worked fine. Test completed as expected.

And then, if I flash my software from the new laptop, it does not cause "SPIFFS mount failed", then that part works, but the software does not function as intended, since the SPIFFS data has been overwritten by the SPIFFS_Test.ino sw.

Rewriting the SPIFFS data on the old laptop, and then reseting the EPS, will again cause the mount failure. Reflashing the SW on the old laptop gets it working again.

Any ideas what I am missing, what could be causing this issue?

#include <SPIFFS.h>

void setup() {

  Serial.begin(115200);

  while (!Serial)
    ;

  ESP_LOGI("INFO", "Starting...");
   
  if (!SPIFFS.begin()) {
    ESP_LOGE("ERROR", "Can't open SPIFFS!");
    delay(5000);
    ESP.restart();
  }

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1344
load:0x40078000,len:13964
load:0x40080400,len:3600
entry 0x400805f0
[ 44][I][vp22.ino:178] setup(): [INFO] Starting...
E (41) SPIFFS: mount failed, -10025
[ 45][E][SPIFFS.cpp:89] begin(): Mounting SPIFFS failed! Error: -1
[ 47][E][vp22.ino:185] setup(): [ERROR] Can't open SPIFFS!
ets Jul 29 2019 12:21:46

Hi @Thomasx. I just gave it a try with your sketch and a Seeed Studio XIAO ESP32-C3 board and SPIFFS.begin() was successful. I am not completely confident that I followed the same procedure as you though. Please provide detailed step-by-step instructions we can follow to reproduce the fault. Don't leave any step out even if it seems obvious to you.


I'm also going to ask you to post the full verbose output from an upload using each of the IDE versions. Hopefully we might be able to spot some relevant difference between the two that will allow us to identify the cause.


:exclamation: This procedure is not intended to solve the problem. The purpose is to gather more information.


Please do this:

  1. Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
    The "Preferences" dialog will open.
  2. Check the box next to "Show verbose output during: ☐ compilation" in the "Preferences" dialog.
  3. Check the box next to Show verbose output during: ☐ upload.
  4. Click the "OK" button.
  5. Attempt an upload, as you did before.
  6. Wait for the upload to finish.
  7. Right click on the black "Output" panel at the bottom of the Arduino IDE window.
  8. From the context menu, click Copy All.
  9. Open a forum reply here by clicking the "Reply" button.
  10. Click the <CODE/> icon on the post composer toolbar.
    This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
    Code block icon on toolbar
  11. Press the Ctrl+V keyboard shortcut (Command+V for macOS users).
    This will paste the compilation output into the code block.
  12. Move the cursor outside of the code block markup in the forum post composer.
  13. Now repeat the process described above, but this time using the other PC.
  14. Click the "Reply" button to post the output.

In case the output is longer than the forum software will allow to be added to a post, you can instead save it to a .txt file and then attach that file to a reply here:

  1. Open any text editor program.
  2. Paste the copied output into the text editor.
  3. Save the file in .txt format.
  4. Open a forum reply here by clicking the "Reply" button.
  5. Click the "Upload" icon (image) on the post composer toolbar:
    Upload icon on toolbar
    A dialog will open.
  6. In the dialog, select the .txt file you saved.
  7. Click the "Open" button.
  8. Click the "Reply" button to publish the post.

Alternatively, instead of using the "Upload" icon on the post composer toolbar as described in steps (5) - (7) above, you can simply drag and drop the .txt file onto the post composer field to attach it.

Hi @ptillisch

Thanks for your response.

I will look into this and get back with a response right away.

Hi @ptillisch

Here are the logs from two runs, both using the new IDE 2.2.1, one on my old laptop and one on my new.
It seems there is some kind of version difference somewhere, because the "new" log shows the following, while the old does not

esptool.py v4.5.1
Creating esp32 image...
Merged 1 ELF section
Successfully created esp32 image.

IDE221_uPesyESP32WroomDevKit_OldLaptop.txt (2.0 MB)
IDE221_uPesyESP32WroomDevKit_NewLaptop.txt (2.2 MB)

Is there a possibily that you don't have the same core version on both computers ?

You mean the version of the ESP32 Boards Manager library?

Perhaps that's the issue. Will check it up .

Thanks!

Hi @Thomasx. Did you get a chance to check. I also suspected the cause of the different results might have been a difference in the installed versions of the sketch dependencies. The verbose upload output you provided will show the versions and I planned to analyze it, but won't bother if you have already identified the difference.

Yes, it seems it was due to different versions of the board package.

Thanks for the update. Nice job on identifying the cause of the different results!

Regards,
Per

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.