Commit Graph

4 Commits (c31929669265b51abd2d3a5102a161fdcf77108d)

Author SHA1 Message Date
neilt6 f0e0545737 [FATFileSystem] Updated FatFs to R0.11a & fixed sync bug
Updated ChaN FatFs to R0.11a, and implemented Raghid Mardini's sync bug
fix.
2015-11-24 14:18:32 -07:00
neilt6 2a49d8bf99 [FATFileSystem] Updated FatFs to R0.11
Updated the internal FatFs library to R0.11. Minor changes were made to
FATFileSystem and FATDirHandle in order to accommodate API changes.
2015-07-07 14:41:05 -06:00
Olivier Martin 2251b0267d libraries/fs: Added logic to transparently sync written file
fflush() does not do anything in mbed library. The only time the file
was flushed was when it was closed.
For some applications (eg: data logger), files are never closed. It
means when the power went off all the written data were lost.
Actually, they were not lost; they were written into the non-volatile
storage. But the file header was not aware of these new data (its
file information such as file size were not updated).

There is no easy way to retarget fflush() for mbed. So, the workaround
is to fflush (eg: 'sync' in the ChaN terminology) periodically
while writting new data.

The frequency can be changed by the user into ffconf.h.
By default, the updated file will be synced for every new sector (generally
for every 512 bytes). Another available option is to sync for every
new cluster (in my use case, the cluster was 8 sectors long).
2014-02-21 09:57:23 +00:00
Emilio Monti 5c20760685 Initial commit of the mbed libraries and tools 2013-02-18 15:32:11 +00:00