TargetFAT™ Embedded FAT File System
Overview
TargetFAT is a widely-used, robust, high-performance, DOS/Win-compatible, flash-friendly embedded FAT file system.
Features
Standards compliant. Provides POSIX and Standard C compatible API and behavior, except for features not supported by the FAT format, such as links and access protections. Includes numerous extensions designed for embedded systems use.
Compatible with Windows/DOS FAT file systems for easy file exchange using flash drives or SD Cards.
Supports FAT12, FAT16, and FAT32. Within the allowed ranges for each FAT type, the cluster size can be manually assigned or use default values. The theoretical limit for FAT32, the format that supports the largest volume size, is 2TB.
Optional long file name support (VFAT) and UTF8 file name support. Proven Unicode support with large base of Far East users.
High I/O performance. Streaming read and write throughput is approximately the same as the underlying I/O speed of the backing media.
Supports concurrent use of multiple volumes. Volumes can be installed at start up, or added, mounted, unmounted, and deleted during operation.
Reentrant. Designed for multitasking environments. Per-volume access semaphores allow independent concurrent access to multiple volumes by multiple tasks.
Guaranteed file system integrity across unexpected shutdowns. Only data written after the most recent synchronization can be lost. Closed files, directory structures, files open for reading are never at risk. Performs automatic power-fail recovery during mount.
Flash friendly. Supports background reclamation of ‘dirty’ flash sectors when used with Blunk’s flash translation layers, by polling vclean() from a low priority task. Supports TRIM (which deletes unused FTL mappings) for efficient flash garbage collection.
Supports raw flash memory via Blunk’s flash translation layers for NAND and NOR flash. For optimal performance, the sector size can be the natural page size of the underlying flash. TargetFAT supports 512, 1024, 2048, and 4096 byte sectors.
Supports managed NAND devices via Blunk’s smart media managers for CompactFlash, eMMC devices, SD cards, and USB flash drives. Supports hard drives as well.
Optional volume-level encryption. If used, all data on backing media is encrypted.
Optional per-task Current Working Directories. The CWD is specified using two 32-bit values that are stored by the application. TargetFAT writes them in chdir() and reads them when resolving relative paths. If they are stored in a task-specific way, each task has its own CWD.
Binary image tool creates preformatted volume image files for pre-production programming of flash devices using automated programmers from Data I/O, BP Microsystems, etc.
Shares common API library and CWD implementation with TargetXFS (Unix like), TargetRFS (RAM), and TargetZFS (compressed read-only images), interworking seamlessly with these file systems.
Configurable RAM footprint. Set cluster/sector cache sizes. Include free/dirty cluster bit maps for higher performance and faster power-fail recovery or exclude them for smaller RAM footprint. Set FAT_BASIC_MODE mode to reduce code footprint.
Configuration #1 #2 #3 Volume Size 128MB 256MB 512MB Cluster Count 65,399 65,467 130,812 Cluster Size 2,048 4,096 4096 FAT Type FAT16 FAT16 FAT32 Cached Clusters 2 4 4 Cached FAT Sectors 12 22 44 Cached Root Sectors 2 5 N/A FAT_BASIC_MODE Yes No No Code Footprint 58KB 66KB 66KB RAM Footprint 29KB 49KB 74KB Table shows code and RAM size for example configurations. Full details in manual.
Includes APIs for accessing and modifying a volume’s Master Boot Record, reading or setting the volume label, and to support volume access by a remote host via USB.
Extensive scripted testing of error handling, multitasking reentrancy, memory allocation failure, powerfail recovery, and regression tests ensure reliability. Tested on big and little-endian CPUs. Automated continuous 24⁄7 powerfail recovery testing on physical hardware.
Used in consumer electronics and industrial products worldwide for over twenty years, including millions of cell phones and other devices.
Includes sample applications that exercise the file system’s Standard C and POSIX APIs, and optional command line shell (“cd”, “ls”, “mkdir”, “pwd”, etc,) that may be extended with user commands.
For efficient DMA use, all buffers passed to the driver are aligned on CPU cache line boundaries.
Developed using TargetOS™-Lite, Blunk’s free RTOS. Easily ported to other RTOSes or used in polled mode, without a kernel.
Source code is 100% Standard C and has been tested using PC-lint and multiple Standard C compilers, including GCC.
Royalty-free license. Includes complete source code, sample applications, sample drivers, user’s manual, and one year of technical support. Electronic delivery via customer-specific web portal.