Flash partition errors - how to fix corect size

Hi,
I am working on external Flash partition, all works fine but:

  • I simulate problem, power was off when some files were open/during data writing
  • now the drive free capacity is 4MB, but is empty and should show 13MB as I declare
    Is there any tool to check status and fix partition if necessary?
    Regards

Hi,
fs.reformat() theoretically solve the problem but this is poor work around,
I do not want to lose existing data on Flash.
Regards

I'm not aware of any chkdsk/fsck function in mbed FAT filesystem implementation. If you need that sort of resilience then you may wish to use littlefsv2 mbed-os/storage/filesystem/littlefsv2 at master · ARMmbed/mbed-os · GitHub