FatFs
   HOME

TheInfoList



OR:

FatFs is a lightweight software library for microcontrollers and embedded systems that implements
FAT In nutrition, biology, and chemistry, fat usually means any ester of fatty acids, or a mixture of such compounds, most commonly those that occur in living beings or in food. The term often refers specifically to triglycerides (triple es ...
/
exFAT exFAT (Extensible File Allocation Table) is a file system introduced by Microsoft in 2006 and optimized for flash memory such as USB flash drives and SD cards. exFAT was proprietary until 28 August 2019, when Microsoft published its specificat ...
file system support. Written on pure
ANSI C ANSI C, ISO C, and Standard C are successive standards for the C programming language published by the American National Standards Institute (ANSI) and ISO/IEC JTC 1/SC 22/WG 14 of the International Organization for Standardization (ISO) and th ...
, FatFs is platform-independent and easy to
port A port is a maritime facility comprising one or more wharves or loading areas, where ships load and discharge cargo and passengers. Although usually situated on a sea coast or estuary, ports can also be found far inland, such as ...
on many hardware platforms such as 8051, PIC, AVR, ARM, Z80. FatFs is designed as
thread-safe Thread safety is a computer programming concept applicable to multi-threaded code. Thread-safe code only manipulates shared data structures in a manner that ensures that all threads behave properly and fulfill their design specifications without un ...
and is built into ChibiOS, RT-Thread, ErlendOS, and
Zephyr In European tradition, a zephyr is a light wind or a west wind, named after Zephyrus, the Greek god or personification of the west wind. Zephyr may also refer to: Arts and media Fiction Fiction media * ''Zephyr'' (film), a 2010 Turki ...
real-time operating system A real-time operating system (RTOS) is an operating system (OS) for real-time applications that processes data and events that have critically defined time constraints. An RTOS is distinct from a time-sharing operating system, such as Unix, which ...
s. Most often, FatFs is used in low-power
Embedded system An embedded system is a computer system—a combination of a computer processor, computer memory, and input/output peripheral devices—that has a dedicated function within a larger mechanical or electronic system. It is ''embedded'' ...
s where memory is limited, since the library takes up little space in RAM and program code. In the minimum version, the working code takes from 2 to 10 kB of RAM.


Overview

FatFs is designed to be a Filesystem Layer that is agnostic to the platform and storage media it is used with. This is achieved by providing a media access interface that is used to communicate with the storage device control module which is provided by the implementer. This means that FatFs can work with any physical device such as an
SD card Secure Digital, officially abbreviated as SD, is a proprietary non-volatile flash memory card format developed by the SD Association (SDA) for use in portable devices. The standard was introduced in August 1999 by joint efforts between San ...
or a
hard disk A hard disk drive (HDD), hard disk, hard drive, or fixed disk is an electro-mechanical data storage device that stores and retrieves digital data using magnetic storage with one or more rigid rapidly rotating platters coated with mag ...
on any platform that can run plain C code if the implementer provides a control module interface.


Architecture

FatFs library architecture logically separates the abstractions of the user app and the platform-dependent code. The user application and the low level disk I/O layer ( driver) must be added by the implementer. Also, the architecture of the library implies that the system can have several storage devices with different drivers and the library can work in a multi-threaded operating system. At the application level it is hidden which physical media is used. In the minimum implementation, the driver layer must support at least these 3 interfaces: * disk_status — return
block device In Unix-like operating systems, a device file or special file is an interface to a device driver that appears in a file system as if it were an ordinary file. There are also special files in DOS, OS/2, and Windows. These special files allow ...
status (not initialized, missing, protected, ready) * disk_initialize — initialize the physical disk * disk_read — read block from physical disk This level of abstraction allows implementers to write an application once, and then
port A port is a maritime facility comprising one or more wharves or loading areas, where ships load and discharge cargo and passengers. Although usually situated on a sea coast or estuary, ports can also be found far inland, such as ...
it on different platforms, changing only the implementation of the driver.


License

FatFs has its own minimalistic license similar to the
BSD license BSD licenses are a family of permissive free software licenses, imposing minimal restrictions on the use and distribution of covered software. This is in contrast to copyleft licenses, which have share-alike requirements. The original BSD li ...
. It allows usage in commercial products without disclosing the
source code In computing, source code, or simply code, is any collection of code, with or without comment (computer programming), comments, written using a human-readable programming language, usually as plain text. The source code of a Computer program, p ...
. The only condition is to keep the
copyright A copyright is a type of intellectual property that gives its owner the exclusive right to copy, distribute, adapt, display, and perform a creative work, usually for a limited time. The creative work may be in a literary, artistic, education ...
notice in case of redistribution of the source code. The conditions of FatFs license are not cover any redistributions in binary form, such as embedded code and hex files.


Projects using FatFs

* Arduino (STM32Duino) — port of Arduino platform for
STM32 STM32 is a family of 32-bit microcontroller integrated circuits by STMicroelectronics. The STM32 chips are grouped into related series that are based around the same 32-bit ARM processor core, such as the Cortex-M33F, Cortex-M7F, Cortex- ...
MCU's *
ChibiOS/RT ChibiOS/RT is a compact and fast real-time operating system supporting multiple architectures and released under a mix of the GNU General Public License version 3 (GPL3) and the Apache License 2.0 (depending on module). It is developed by Giova ...
open-source Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use the source code, design documents, or content of the product. The open-source model is a decentralized sof ...
real-time operating system A real-time operating system (RTOS) is an operating system (OS) for real-time applications that processes data and events that have critically defined time constraints. An RTOS is distinct from a time-sharing operating system, such as Unix, which ...
(RTOS) for microcontrollers *
Dreamshell The is a home video game console released by Sega on November 27, 1998, in Japan; September 9, 1999, in North America; and October 14, 1999, in Europe. It was the first sixth-generation video game console, preceding Sony's PlayStation 2, Nint ...
— a Unix-like operating system, designed for the
Sega Dreamcast The is a home video game console released by Sega on November 27, 1998, in Japan; September 9, 1999, in North America; and October 14, 1999, in Europe. It was the first sixth-generation video game console, preceding Sony's PlayStation 2, N ...
video game console *
Flipper Zero Flipper Zero is a portable Tamagotchi-like multi-functional device developed for interaction with access control systems. The device is able to read, copy, and emulate radio-frequency (RFID) tags, radio remotes, iButton, and digital access keys, ...
— open source portable multi-tool device * Marlin (firmware) — open source firmware for 3D printers and CNC machines * ESP-IDF — official IoT Development Framework for the ESP32 series SoC's * Prusa Mini — open-source firmware for low cost 3D printer * RT-Thread — open-source real-time operating system for
embedded system An embedded system is a computer system—a combination of a computer processor, computer memory, and input/output peripheral devices—that has a dedicated function within a larger mechanical or electronic system. It is ''embedded'' ...
s *
Zephyr In European tradition, a zephyr is a light wind or a west wind, named after Zephyrus, the Greek god or personification of the west wind. Zephyr may also refer to: Arts and media Fiction Fiction media * ''Zephyr'' (film), a 2010 Turki ...
— real-time operating system for embedded systems supporting multiple architectures * ErlendOS — an open source minimal UNIX-like operating system for embedded systems * EZ-Flash Omega - Family of flashcarts for the Nintendo Game Boy Advance.


References

{{Reflist Computer libraries Microcontroller software