pellepl / spiffs

Wear-leveled SPI flash file system for embedded devices
MIT License
1.51k stars 403 forks source link

Help with SPIFFS_NOT_A_FS, SPIFFS_ERR_DELETED errors in test program #257

Open octoknot opened 4 years ago

octoknot commented 4 years ago

Hi spiffs, I'm having trouble with my spiffs test program, and I'm hoping someone can help.

Here's my configuration:

I am trying to mimic the "hello world" example on the "Using Spiffs" wiki page, but I don't get far:

If I set SPIFFS_USE_MAGIC to 0 (to see what will happen), I get farther:

If I try to run the test program again (withOUT erasing flash, just running the program again), it fails at the first SPIFFS_open call (with the flags SPIFFS_CREAT | SPIFFS_TRUNC | SPIFFS_RDWR), again with the SPIFFS_ERR_DELETED error.

FWIW, I have tried that test program both with and without calling SPIFFS_fflush before calling SPIFFS_close, and it did not help.

So, I am hoping someone has a suggestion about what might be wrong.

Full disclosure -- I've also been working with littlefs and have had problems there, too, so that tells me something very basic is wrong, but I can't figure it out. I can run a test program where I erase/write/re-read the flash directly through our flash driver, and that works.

Any help is appreciated! I am new to firmware development and have not worked with flash before, so no suggestion is too simple. For example, at the flash driver level, I do check the Write In Progress bit before returning to the caller, but I did not at first, so asking me if I had would have been reasonable!

crisvdn commented 1 year ago

Hi, we've been having same issues like you've reported. Getting SPIFFS_NOT_A_FS after mounting, getting SPIFFS_ERR_DELETED when opening a file. Were u able to solve this, and how?