Using FatFS without wear leveling

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

Using FatFS without wear leveling

Postby kolban » Thu Aug 17, 2017 5:11 am

When we use FatFS, I find that we normally use:

esp_vfs_fat_spiflash_mount

This provides an excellent convenience for building a FAT file system that is accessible via Posix APIs on an ESP-IDF partition that leverages wear leveling. Excellent.

However I believe it has a draw back ... and that is we can't (by any known/easy recipe) create a pre-built FAT image that can be brought into flash memory. For example, if I wanted to use a file system that is read-only (eg. a Web Server) then I don't know of a recipe that will allow me to build my image in Linux and flash it into storage for immediate "use" as a read-only file system.

If I am understanding another part of the story, we can bypass wear leveling and go "straight" to flash storage using the recipe:

* esp_vfs_fat_register
* ff_diskio_register
* f_mount

However, I am not finding any samples that would appear to use this technique.

My question thus comes in a couple of parts:

1. Is there a recipe we can use to build the content of a file system and then write that to flash for immediate use?
2. Is there a sample for using the lower-level FatFS APIs in an ESP32 environment that would apparently not leverage wear leveling and hence (maybe) provide the ability to create external images that could be written to flash for immediate use?
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

jame113
Posts: 19
Joined: Fri Dec 25, 2020 4:47 am

Re: Using FatFS without wear leveling

Postby jame113 » Sun Aug 08, 2021 4:33 am

Have you found a way to solve this problem?
Thanks a lot

Who is online

Users browsing this forum: AdsBot [Google] and 130 guests