Это зависит от того, какую реализацию FAT использует ваша встроенная ОС.Если вы используете smxFS , то вам следует воспользоваться следующими преимуществами:
The DOS/Windows FAT file system is inherently not power fail safe, so smxFS
implements features to compensate for this:
1. sfs_chkdsk() API can check and fix many problems, such as cross-linked
files, lost chains, bad directory entries, and other problems. Flags specify
which types of problems to fix (or none). It indicates the results using flags
in the return value and can give detailed text information in a buffer, to
allow a human operator to correct problems. Please see the smxFS User’s Guide
for details.
2. Clean shutdown checking determines whether all files were closed and
caches flushed before the system shut down. If not, sfs_chkdsk() should be called.
Если вы ожидаете неожиданные потери мощности, вам следует рассмотреть возможность использования конденсатора или резервного аккумулятора, который позволит вамзакончить запись правильно.Вы, вероятно, захотите sfs_fflush и sfs_fclose (или, может быть, даже sfs_fclose, так как похоже, что он сбрасывает себя)
Есть другие опции файловой системы , перечисленные здесь , хотя они могут не подходитьваше приложение, поскольку не все из них могут быть прочитаны OOB с помощью компьютера.