FatFs

FatFs is a lightweight software library for microcontrollers and embedded systems that implements FAT/exFAT file system support. Written on pure ANSI C, FatFs is platform-independent and easy to port on many hardware platforms such as 8051, PIC, AVR, ARM, Z80. FatFs is designed as thread-safe and is built into ChibiOS, RT-Thread, ErlendOS, and Zephyr real-time operating systems.

Most often, FatFs is used in low-power Embedded systems 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 or a hard disk 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:


 * — return block device status (not initialized, missing, protected, ready)
 * — initialize the physical disk
 * — read block from physical disk

This level of abstraction allows implementers to write an application once, and then port it on different platforms, changing only the implementation of the driver.

License
FatFs has its own minimalistic license similar to the BSD license. It allows usage in commercial products without disclosing the source code. The only condition is to keep the copyright 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 MCU's
 * ChibiOS/RT — open-source real-time operating system (RTOS) for microcontrollers
 * Dreamshell — a Unix-like operating system, designed for the Sega Dreamcast video game console
 * Flipper Zero — 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 systems
 * Zephyr — 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.