1 year, 5 months ago.

FileSystem : LitteFS vs FatFS


im running the LitteFS example program from

when i use litteFS, i can n-times reset the device and except for the first time, the device can mount the sd card as normal and increments the numbers.

the same example used with fatFS though can't mount the filesystem when i reset the device after running the example and writing the numbers file, and formats de sd card every time i reset.

do you have an idea why the program is not able to detect that the sd card has already a fat filesystem on it and write to it?

Comment on this question

1 Answer

1 year, 5 months ago.

AFAIK that is exactly the point behind LittleFS. With FAT you have a not-so-low chance that the power off corrupted your filesystem. Therefore after restart it cannot mount and has to reformat. You could enhance your test to perform a clean shutdown (via some command over UART for example) or by unmounting the file system right after doing some writing. In that case it should still be intact after restart. Anyway: that "restriction"/risk is one of the (if not THE) reason for introducing LittleFS.

Yes this is true of course if i would reset the decice while mounted.. but this is not the case.. i let it format fat, let the example run (write the demo file), unmount... and now i reset the device. Here the fs shluld not be corrupt...

posted by jibba jibba 14 Jan 2018

To post an answer, please log in.