Jump to content
Sign in to follow this  
GrumpyOldPizza

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×