Page 1 of 1

[Answered] FAT File system support into flash memory ...

Posted: Tue Jan 10, 2017 4:42 am
by kolban
I see that we have (as of the date of this post) a new component that provides FatFs file system support. I also note that this appears to provide first class support for micro SD cards. The purpose of this posting is to inquire about support for FatFs mapped onto SPI flash memory. Is that a supported/viable operation? Should we be using SPIFFs instead?

If FatFs mapped to SPI flash memory is an option, do we have the disk-io mapping modules for ESP32 available?

Re: FAT File system support into flash memory ...

Posted: Tue Jan 10, 2017 6:13 am
by ESP_igrr
I haven't added flash support for diskio yet mostly because i want to test it along with flash encryption feature, and this needs some time. I will do this post-2.0, which will be released very soon.

Re: FAT File system support into flash memory ...

Posted: Tue Jan 10, 2017 6:16 am
by ESP_Sprite
At the moment, it's not supported yet. You can in theory plunk a FAT partition on the SPI flash pretty easily if you only implement read-only support. Write support is harder, because the sector size of flash is 4K and I don't think that works nicely with FAT. Also, FAT is made for hard disks, which don't really care if the same sector is overwritten thousands of times. Flash does care, and plunking FAT on a flash directly can wear it out pretty quickly. To compensate for that, you'd have to create a flash translation layer... and at that point you're probably better off using a designated flash-capable filesystem like spiffs.

Re: [Answered] FAT File system support into flash memory ...

Posted: Tue Feb 07, 2017 6:32 am
by kolban
Thank you sir. Please see the following thread ... http://esp32.com/viewtopic.php?f=13&t=239

This thread asks about recommendations for "which" implementation of SPIFFS we should be using in an ESP32 environment. If I am understanding correctly, the generic SPIFFS implementation found here https://github.com/pellepl/spiffs is the master ... however, if I get the story, it leaves as an exercise to the reader the mapping to read and write flash memory. An implementation such as https://github.com/whitecatboard/Lua-RT ... nts/spiffs seems to be working ... but it is part of a much bigger project.

What I'm wondering out loud is ... given the value of SPIFFS, is there a recommended "component" implementation that we (the ESP32 community) can circle around as the "go to" SPIFFS implementation for ESP32?