Skip to content

Commit 3883a17

Browse files
committed
Merge branch 'fix/fatfs_f_mount_immediately_after_formatting_v5.2' into 'release/v5.2'
fix(vfs): FATFS mount immediately after format if mount failed (v5.2) See merge request espressif/esp-idf!32380
2 parents 1c73a8f + 46ed6c8 commit 3883a17

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

components/fatfs/vfs/vfs_fat_sdmmc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ static esp_err_t s_f_mount(sdmmc_card_t *card, FATFS *fs, const char *drv, uint8
135135
}
136136

137137
ESP_LOGW(TAG, "mounting again");
138-
res = f_mount(fs, drv, 0);
138+
res = f_mount(fs, drv, 1);
139139
if (res != FR_OK) {
140140
err = ESP_FAIL;
141141
ESP_LOGD(TAG, "f_mount failed after formatting (%d)", res);

components/fatfs/vfs/vfs_fat_spiflash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ static esp_err_t s_f_mount_rw(FATFS *fs, const char *drv, const esp_vfs_fat_moun
100100
ESP_RETURN_ON_FALSE(fresult == FR_OK, ESP_FAIL, TAG, "f_mkfs failed (%d)", fresult);
101101

102102
ESP_LOGI(TAG, "Mounting again");
103-
fresult = f_mount(fs, drv, 0);
103+
fresult = f_mount(fs, drv, 1);
104104
ESP_RETURN_ON_FALSE(fresult == FR_OK, ESP_FAIL, TAG, "f_mount failed after formatting (%d)", fresult);
105105
}
106106
return ESP_OK;

0 commit comments

Comments
 (0)