Code: Select all
# Name, Type, SubType, Offset, Size
nvs, data, nvs, 0x9000, 0x4000
otadata, data, ota, 0xd000, 0x2000
phy_init, data, phy, 0xf000, 0x1000
ota_0, 0, ota_0, 0x10000, 0x150000,
ota_1, 0, ota_1, 0x160000, 0x150000,
dcu, data, fat, 0x310000, 0x90000,
Code: Select all
W (302) vfs_fat_spiflash: f_mount failed (13)
I (312) vfs_fat_spiflash: Formatting FATFS partition, allocation unit size=4096
E (322) vfs_fat_spiflash: s_f_mount_rw(99): f_mkfs failed (14)
E (322) test_fatfs: Failed to mount FATFS (ESP_FAIL)
Code: Select all
static const char *TAG = "test_fatfs";
const char *base_path = "/spiflash";
static wl_handle_t s_wl_handle = WL_INVALID_HANDLE;
void test_fatfs_init(void)
{
const esp_vfs_fat_mount_config_t mount_config = {
.max_files = 4,
.format_if_mount_failed = true,
.allocation_unit_size = CONFIG_WL_SECTOR_SIZE
};
esp_err_t err = esp_vfs_fat_spiflash_mount_rw_wl(base_path, "dcu", &mount_config, &s_wl_handle);
if (err != ESP_OK) {
ESP_LOGE(TAG, "Failed to mount FATFS (%s)", esp_err_to_name(err));
return;
}
Thank you!