ESP32S3 : FAT FileSystem :

ThomasESP32
Posts: 191
Joined: Thu Jul 14, 2022 5:15 am

ESP32S3 : FAT FileSystem :

Postby ThomasESP32 » Fri Feb 03, 2023 10:26 am

Good Morning,

I am reading Espressif documentation concerning the FAT FileSystem component.
In this document, it is written that the FatFS has been extended with API functions that register
the disk I/O driver at runtime.

Could you please explain me what is a disk I/O driver and what is it used for please ?

Best regards,

Thomas TRUILHE

ThomasESP32
Posts: 191
Joined: Thu Jul 14, 2022 5:15 am

Re: ESP32S3 : FAT FileSystem :

Postby ThomasESP32 » Fri Feb 03, 2023 11:23 am

Good Morning,

I would like to use FAT FileSystem or SPIFFS in order to access files located in the internal SPI Quad SPI FLASH memory of a

ESP32-S3-WROOM1 module.

Is it possible using this library please ?
Could you please tell me if the FAT FileSystem includes CRC calculation/check mecanisms for the files ?

Is it possible using FAT FileSystem to access files located in the internal SPI Flash memory of the ESP32-S3-WROOM1 module
and at the same time to access files located in an external SPI Flash Memory ?

Maybe usingVirtual FileSystem component ?

Best regards,

Thomas TRUILHE

MicroController
Posts: 1136
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: ESP32S3 : FAT FileSystem :

Postby MicroController » Thu Feb 16, 2023 8:53 pm

The standard FatFs library expects to be compiled against ONE implementation of its "Media Access Interface", which is a handful of functions expected to implement low-level block device access (e.g. disk_read(...) to read and disk_write(...) to write blocks to/from a device) which FatFs then uses, see http://elm-chan.org/fsw/ff/00index_e.html

Using the static functions of the Media Access Interface, FatFs, out of the box, does not support dynamic use of multiple different (kinds of) block devices. ESP-IDF provides this feature by allowing you to register at runtime multiple different block devices, bind them to "mount points" and use the FAT file system on every one of them.

This way, FAT in flash memory is possible, but not a good idea. Consider using SPIFFS as an alternative better suited for flash. Then, via abstraction by VFS, your application can just work with files, regardless of the underlying FAT-, SPIFFS- or any other filesystem.

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

Re: ESP32S3 : FAT FileSystem :

Postby ESP_Sprite » Fri Feb 17, 2023 6:27 am

Actually, we have an optional wear leveling layer between fatfs and the 'raw' flash that alleviates a lot of the issues. If you don't need specifically flash FAT, then something like littlefs or spiffs might be a better option indeed though.

MicroController
Posts: 1136
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: ESP32S3 : FAT FileSystem :

Postby MicroController » Fri Feb 17, 2023 9:29 am

ESP_Sprite wrote:
Fri Feb 17, 2023 6:27 am
If you don't need specifically flash, ...
Did you mean "specifically FAT"?

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

Re: ESP32S3 : FAT FileSystem :

Postby ESP_Sprite » Sat Feb 18, 2023 12:34 am

MicroController wrote:
Fri Feb 17, 2023 9:29 am

Did you mean "specifically FAT"?
Whoops, yes. I edited it.

Who is online

Users browsing this forum: leschge and 166 guests