Unable to use the "official" SPIFFS wrapper

kurtzweber
Posts: 53
Joined: Tue Jan 10, 2017 1:09 pm

Unable to use the "official" SPIFFS wrapper

Postby kurtzweber » Fri Dec 15, 2017 12:47 pm

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!
Attachments
spiffs_example_main.c
(1.9 KiB) Downloaded 7 times
spiffs_content.txt
(1 MiB) Downloaded 4 times

kurtzweber
Posts: 53
Joined: Tue Jan 10, 2017 1:09 pm

Re: Unable to use the "official" SPIFFS wrapper

Postby kurtzweber » Mon Dec 18, 2017 8:39 am

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!

User avatar
loboris
Posts: 307
Joined: Wed Dec 21, 2016 7:40 pm

Re: Unable to use the "official" SPIFFS wrapper

Postby loboris » Mon Dec 18, 2017 4:19 pm

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.

kurtzweber
Posts: 53
Joined: Tue Jan 10, 2017 1:09 pm

Re: Unable to use the "official" SPIFFS wrapper

Postby kurtzweber » Tue Dec 19, 2017 9:06 am

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

User avatar
loboris
Posts: 307
Joined: Wed Dec 21, 2016 7:40 pm

Re: Unable to use the "official" SPIFFS wrapper

Postby loboris » Tue Dec 19, 2017 9:47 am

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.

Who is online

Users browsing this forum: No registered users and 7 guests