Page 1 of 1

Unable to use the "official" SPIFFS wrapper

Posted: Fri Dec 15, 2017 12:47 pm
by kurtzweber
Hi!

I'm trying to use the official SPIFFS wrapper included in the latest framework but my program doesn't work... In the past I used the loboris implementation without any problems.

My source folder contains only one file (readme.txt) with a line in it:

Image

First I prepared the image using the latest mkspiffs by igrr, https://github.com/igrr/mkspiffs - the image is attached to this post (renamed to .txt):

Code: Select all

./mkspiffs.exe -c ../spiffs_content/ -b 4096 -p 256 -s 0x100000 ../spiffs_content.bin
then I uploaded the image to the flash memory of my devboard:

Code: Select all

python $IDF_PATH/components/esptool_py/esptool/esptool.py --chip esp32 --port COM12 --baud 115200 write_flash -z 0x180000 ../spiffs_content.bin
The custom partition table for my program is:

Image

In my program I only mount the partition, check if the file exists and - if so - try to print its content.
Everything works fine, but when I try to read the file content, I always get EOF.

The source code of the program is attached, when I run it the partition table seems correct:

Image

and it can mount the partition and find the file:

Image

Thanks!

Re: Unable to use the "official" SPIFFS wrapper

Posted: Mon Dec 18, 2017 8:39 am
by kurtzweber
Hi

during the weekend I reworked the program to use the spiffs hal from loboris and everything works fine... I had to use its version of mkspiffs too... this evening I'll post the modified program... so it seems the official wrapper doesn't work for me, anyone was able to use it successfully?

thanks!

Re: Unable to use the "official" SPIFFS wrapper

Posted: Mon Dec 18, 2017 4:19 pm
by loboris
The "official" SPIFFS driver actually works very well.
Some changes are needed to make mkspiffs work with latest esp-idf spiffs changes (meta data & mtime support).

I've prepared the example application with modified mkspiffs, it will be pushed to GitHub probably tomorrow.

Re: Unable to use the "official" SPIFFS wrapper

Posted: Tue Dec 19, 2017 9:06 am
by kurtzweber
Hi loboris,

first of all thanks a lot for your work: with your code I was able to complete my project!
It sounds strange to me that Espressif included a SPIFFS wrapper in its IDF 3.0 but at the moment there's no mkspiffs compatible...

for Espressif guys: my suggestion is to include also the mkspiffs tool in the official framework, to have a "certified" version we can use

Re: Unable to use the "official" SPIFFS wrapper

Posted: Tue Dec 19, 2017 9:47 am
by loboris
The (small?) problem with mkspiffs is that many spiffs settings are configurable via menuconfig and mkspiffs build process has to use sdkconfig.h to make the spiffs image with correct settings. The mkspiffs has to be rebuild whenever the configuration changes, and there is no easy way to do it automaticaly.
With changes I've made, you have to manually copy the sdkconfig.h to the mkspiffs build directory (include subdirectory), then rebuild with make, taking care that the correct OS build tools are used, not the ones from xtensa-esp32-elf.
You can get the modified mkspiffs here.

I don't think mkspiffs will ever be included in esp-idf. It's just a tool which is not necessary for spiffs driver to function.

Re: Unable to use the "official" SPIFFS wrapper

Posted: Mon Feb 12, 2018 10:26 am
by Pravin
Hi Loboris,

I am also facing the similar problem. Your ESP32_TFT_library program works for me successfully but I am facing similar problem as Kurtzweber that ESP32 mkspiffs not working as expected.

If I use ESP32 SPIFFS & mkspiffs then I am able to see correct file size but not able to read the file.
Does others face the similar problem ?
If someone is successful, can we give the correct steps i.e partition table, commands used mkspiffs, esptool.py

Thanks & Regards,
PraviN

Re: Unable to use the "official" SPIFFS wrapper

Posted: Sun Feb 18, 2018 12:31 am
by bdelarre
I'm also seeing the same issue with current mkspiffs at revision 1693a95 and release/v3.0 of esp-idf. Can mount the filesystem, can open the file, but every read results in 0 bytes and EOF state.

Re: Unable to use the "official" SPIFFS wrapper

Posted: Sun Feb 18, 2018 12:42 am
by bdelarre
Ignore me, having one of those days...

Seems this is working fine on revisions as described above, the thing that threw me is that the base path used when initializing the spiffs mount, in my case /spiffs seems to count towards the maximum name length defined by SPIFFS_OBJ_NAME_LEN. I had a path which was exactly 32 characters once you included the base path.

Shortening my path names seems to have fixed it.