Convenience function to initialize FAT filesystem in SPI flash and register it in VFS This is an all-in-one function which does the following: - finds the partition with defined partition_label. Partition label should be configured in the partition table. - initializes flash wear levelling library on top of the given partition - mounts FAT partition using FATFS library on top of flash wear levelling library - registers FATFS library with VFS, with prefix given by base_prefix variable This function is intended to make example code more compact.
path where FATFS partition should be mounted (e.g. "/spiflash")
partition_label
label of the partition which should be used
mount_config
pointer to structure with extra parameters for mounting FATFS
wl_handle
wear levelling driver handle
Return value
- ESP_OK on success - ESP_ERR_NOT_FOUND if the partition table does not contain FATFS partition with given label - ESP_ERR_INVALID_STATE if esp_vfs_fat_spiflash_mount_rw_wl was already called - ESP_ERR_NO_MEM if memory can not be allocated - ESP_FAIL if partition can not be mounted - other error codes from wear levelling library, SPI flash driver, or FATFS drivers
Examples
esp_vfs_fat_spiflash_mount_rw_wl() is referenced by 13 libraries and example projects: