If I have fatfs initialized in my CMake file as this:
Code: Select all
fatfs_create_spiflash_image(storage ../store FLASH_IN_PROJECT)Code: Select all
esp_vfs_fat_spiflash_mount_ro(BASE_PATH, "storage", &esp_vfs_fat_mount_config);Code: Select all
vfs_fat_spiflash: f_mount failed (13)Code: Select all
FR_NO_FILESYSTEM, /* (13) There is no valid FAT volume */Code: Select all
esp_vfs_fat_spiflash_mount_rw_wl(BASE_PATH, "storage", &esp_vfs_fat_mount_config, &wl_handle);The only reason why I ask is because we have some issues when the device is shutdown unexpectedly, we occasionally see the flash get corrupted. The thought is if we mount the filesystem in read-only mode which is all we need most of the time. We can then if we do need to write to the flash we can:
- unmount read-only
- mount in read/write
- do our update
- unmount read/write
- mount read-only.
We are hoping that being in read only mode most of the time, will help mitigate any issues with flash corruption due to unexpected shut down.
I've been looking at the ESP-IDF documentation and I am not seeing anywhere it is telling me I can't do what I'm trying to do.
