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

User avatar
kolban
Posts: 510
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

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

Postby kolban » Tue Jan 10, 2017 4:42 am

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?
Last edited by kolban on Tue Jan 10, 2017 2:22 pm, edited 1 time in total.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

ESP_igrr
Posts: 265
Joined: Tue Dec 01, 2015 8:37 am

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

Postby ESP_igrr » Tue Jan 10, 2017 6:13 am

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.

ESP_Sprite
Posts: 420
Joined: Thu Nov 26, 2015 4:08 am

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

Postby ESP_Sprite » Tue Jan 10, 2017 6:16 am

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.

User avatar
kolban
Posts: 510
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

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

Postby kolban » Tue Feb 07, 2017 6:32 am

Thank you sir. Please see the following thread ... 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?
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

Who is online

Users browsing this forum: Lucas.Hutchinson and 2 guests