Home $5K RTOS Bundle Technical Support The Blunk Difference Contact Us


Embedded Flash File System for NOR Flash Memory

Theory of Operation

TargetFFS-NOR is a file system designed for NOR flash memory. Flash memory has qualities that are quite different from media normally used for backing store, such as hard disks, floppy disks, or magnetic tape. For best results, the architecture of a NOR flash file system must take into account the unique attributes of NOR devices. TargetFFS-NOR is designed from the ground up to use NOR flash memory as backing store.
The unique qualities of NOR flash memory include: (1) individual bits can only be altered by clearing them, bits can be set only by performing an erase operation on a large block, typically 64 KB or larger, and (2) flash devices exhibit fatigue from program/erase cycles. This wear fatigue results in manufacturers only guaranteeing proper operation for a finite number of program/erase cycles. Modern devices are typically guaranteed to withstand 1 million program/erase cycles.
Program/erase fatigue is specific to the block being cycled and the manufacturers' guarantee applies independently to each erasable block in the flash device. If one block is programmed and erased at a higher rate than others, it will have more wear and can be expected to fail first. A block that fails prematurely can affect the usability of the entire device if the file system depends on the information stored in that block.
The design of TargetFFS-NOR is very much affected by the wear leveling restriction. File systems for freely writable media typically place their control information in a fixed location and repeatedly modify this location as files and directories are created or deleted and as files expand or contract. If applied to flash, this approach would lead to uneven program/erase fatigue and premature device failure. With TargetFFS-NOR, no block is programmed and erased at a higher rate than any other block. Wear is distributed in an even fashion.
TargetFFS-NOR not only provides optimum wear leveling, it also provides data reliability. Each time the file system's state changes, new information is written to flash memory without overwriting old information, neither file system control information nor user data. After new control information is successfully written, a single bit is cleared to mark its location as the most recent copy. Clearing a single bit is an atomic operation
If an unexpected power loss occurs before the bit is cleared, upon subsequent power-up the file system reverts to its state before the most recent change. If power loss occurs after the bit is cleared, the new state changes have been successfully stored and will be used when the file system reboots. In neither case are closed files, directory structures, or files open for reading at risk. Only data written since the last synchronizing operation (fclose(), fflush(), etc.) can be lost.
This explanation simplifies many details. TargetFFS-NOR incorporates clever algorithms, diligent implementation, and months of testing to provide a reliable, reentrant file system whose use of flash media for the backing store is invisible to the application layer.