
If you need to use long filenames (LFN), enable the CONFIG_FATFS_LONG_FILENAMES option. The filesystem uses 8.3 filenames format (SFN) by default.

Use paths starting with the path prefix passed to esp_vfs_register() (for example, "/sdcard/hello.txt"). For more information, see FatFs documentation.Ĭall the C standard library and POSIX API functions to perform such actions on files as open, read, write, erase, copy, etc. Path prefix where to mount the filesystem (e.g., "/sdcard", "/spiflash")Ī variable which will receive the pointer to the FATFS structureĬall ff_diskio_register() to register the disk I/O driver for the drive number used in Step 1.Ĭall the FatFs function f_mount, and optionally f_fdisk, f_mkfs, to mount the filesystem using the same drive number which was passed to esp_vfs_fat_register().

This allows mapping of FatFs drives to physical disks at runtime. Although the library can be used directly, many of its features can be accessed via VFS using the C standard library and POSIX API functions.Īdditionally, FatFs has been modified to support the runtime pluggable disk I/O layer. ESP-IDF uses the FatFs library to work with FAT filesystems.
