Page 1 of 2

How to use virtual file system.?

Posted: Wed Apr 19, 2017 6:57 am
by rahul.b.patel
Hello,
I have a requirement of implementing file system for given flash partition location. It will be great help if I can have a demo example of how to use virtual file system in ESP32 to store file in spi flash, also how other options like spiffs or nvs can be used for the same if possible.

Thank You.

Re: How to use virtual file system.?

Posted: Wed Apr 19, 2017 3:01 pm
by perryc
I got a port of the LUA's SPIFFS component running under ESP-IDF-V2.0 last week so finally have a spiffs based vfs. It's still relatively untested but msg me if you'd like a link to clone the project. There is supposed to be a official version coming from espressif but we were getting desperate so hacked something together.

Perry

Re: How to use virtual file system.?

Posted: Thu Apr 20, 2017 6:57 am
by rahul.b.patel
Thank you Perry for fast reply. I also have cloned LUA's SPIFFS component but still can't create file using "SPIFFS_creat()". I am getting -10000 error code in return though i got SPIFF_mount successfully. If you have created file successfully with SPIFFS, can you please provide me steps for the same.

Thank You.

Re: How to use virtual file system.?

Posted: Fri Apr 21, 2017 2:50 pm
by perryc
check prv msg. Code needs some cleanup and moving to github then the masses can have at it.

Re: How to use virtual file system.?

Posted: Sat Apr 22, 2017 4:09 am
by rahul.b.patel
I found the issue, I didn't update the partition table for spiffs. Its working now.

Re: How to use virtual file system.?

Posted: Wed May 03, 2017 8:14 am
by Fugazi
Do you have some example code for this - just attempting the same myself , help would be useful ! :)

Thanks

Re: How to use virtual file system.?

Posted: Fri May 12, 2017 11:24 pm
by mjmorrison
I have a related question around SPIFFS vs NVS partition.

I have been using a partition table like this for a while

```
nvs, data, nvs, 0x9000, 0x4000
phy_init, data, phy, 0xd000, 0x1000
otadata, data, ota, 0xe000, 0x2000
ota_0, app, ota_0, 0x10000, 1M
ota_1, app, ota_1, , 1M
spiffs, data, nvs, , 1M
```

Recently changed nvs to SPIFFS because I saw that it was an option... Are there any functional differences between the two partition types?

Re: How to use virtual file system.?

Posted: Mon May 15, 2017 11:09 pm
by jgfrmesp
Hi,

I tried to use the spiffs code of the esp32+lua project plus the spiffs code of kolban.
However, no joy. The code compiles, but the file seems not to to be saved.
I can not read it back.

Is it possible to share a working setup of vfs/spiffs?

Thanks,

-- Jaap

Re: How to use virtual file system.?

Posted: Tue May 16, 2017 4:25 am
by rahul.b.patel
Hello Jaap,

Tell me if I have not got it right, you have problem in creating file when using vfs with spiffs right..? and spiffs alone work properly or you have problem with spiffs also.?
Because I have spiffs mounting is working properly but when I use spiffs with vfs I cant create file with vfs.

Thanks.

Re: How to use virtual file system.?

Posted: Tue May 16, 2017 7:15 am
by jgfrmesp
Yes, that precisely the case. Spiffs raw (so without vfs) works fine.
As soon as I use the vfs part (I used the code at https://github.com/nkolban/esp32-snippe ... vfs/spiffs)m I can not read the file back (I can not see if it is written in the first place).

Best,

Jaap