Jump to content
Sign in to follow this  

Robust FAT12/FAT16/FAT32/VFAT File System

Recommended Posts

Why ? I needed a file system for a SDCARD where I could do low latency logging for some of my projects. There did not seem to be one fitting the bill. 


What ? RFAT is a FAT file system that is mean to be robust and fast, rather than to focus on the smallest possible size.



Here the quick link to the source for the impatient: https://github.com/BizzaBoy/RFAT



Now to some details. The source includes a port for the TM4C123GXL Launchpad, along with support for RobG's Color TFT BP. There is a simple, trivial example included that writes out 32MB of data to a file in 512 byte chunks, giving about 2MB/sec throughput with a 20MHz SPI bus.


The system makes full use of the CRC checking available, which means the communication path to the SDCARD is fully protected, along with logic to retry faulted transfers again. There is a transaction safe mode which makes the file system power fail safe. Of course there is VFAT support (i.e. long file names), plus UTF8 file names, if needed. The memory consumption is nicely controllable via various FAT/DIR/DATA cache options from 512 bytes to 2048 bytes. Besides the TM4C123 port, there is a simulation path, so that the API along with a SDCARD can be simulated on say a Linux host. Statistics counters are included to allow detailed analysis and cache finetuning. 


For low latency logging one can pre-allocate files, which means that during the real logging there are no further SDCARD accesses other than the data write accesses.


The API is modeled after the ANSI-C library and mirrors various commercial and freely available alternatives.



- Thomas



Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...