FatFs

Last updated
FatFs
Developer(s) ChaN
Initial releaseFebruary 26, 2006;17 years ago (2006-02-26)
Stable release
R0.15 / 2022
Repository Releases archive
Written in ANSI C
Platform Intel 8051, PIC, AVR, ARM, Z80
Type Embedded systems software
License Own license, similar to BSD
Website elm-chan.org

FatFs is a lightweight software library for microcontrollers and embedded systems that implements FAT/exFAT file system support. [1] 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, and Zephyr real-time operating systems. [2]

Contents

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. [3]

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. [4] 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 Architecture layers scheme FatFs Architecture.jpg
FatFs Architecture layers scheme

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. [4] :11 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: [4] :14

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. [5]

License

FatFs has its own minimalistic license [6] similar to the BSD license. It allows usage in commercial products without disclosing the source code. [4] :12 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

Related Research Articles

<span class="mw-page-title-main">Open Firmware</span> Standard for computer bootstrap code

Open Firmware is a standard defining the interfaces of a computer firmware system, formerly endorsed by the Institute of Electrical and Electronics Engineers (IEEE). It originated at Sun Microsystems, where it was known as OpenBoot, and has been used by vendors including Sun, Apple, IBM and ARM. Open Firmware allows the system to load platform-independent drivers directly from a PCI device, improving compatibility.

<span class="mw-page-title-main">UEFI</span> Operating system software specification

UEFI is a set of specifications written by the UEFI Forum. They define the architecture of the platform firmware used for booting and its interface for interaction with the operating system. Examples of firmware that implement these specifications are AMI Aptio, Phoenix SecureCore Tiano, TianoCore EDK II and InsydeH2O.

Filesystem in Userspace (FUSE) is a software interface for Unix and Unix-like computer operating systems that lets non-privileged users create their own file systems without editing kernel code. This is achieved by running file system code in user space while the FUSE module provides only a bridge to the actual kernel interfaces.

<span class="mw-page-title-main">FreeRTOS</span> Real-time operating system

FreeRTOS is a real-time operating system kernel for embedded devices that has been ported to 35 microcontroller platforms. It is distributed under the MIT License.

Azure RTOS ThreadX is a highly deterministic, embedded real-time operating system (RTOS) programmed mostly in the language C.

The NSLU2 is a network-attached storage (NAS) device made by Linksys introduced in 2004 and discontinued in 2008. It makes USB flash memory and hard disks accessible over a network using the SMB protocol. It was superseded mainly by the NAS200 and in another sense by the WRT600N and WRT300N/350N which both combine a Wi-Fi router with a storage link.

<span class="mw-page-title-main">.NET Micro Framework</span> Open source .NET platform

The .NET Micro Framework (NETMF) is a .NET Framework platform for resource-constrained devices with at least 512 kB of flash and 256 kB of random-access memory (RAM). It includes a small version of the .NET Common Language Runtime (CLR) and supports development in C#, Visual Basic .NET, and debugging using Microsoft Visual Studio. NETMF features a subset of the .NET base class libraries, an implementation of Windows Communication Foundation (WCF), a GUI framework loosely based on Windows Presentation Foundation (WPF), and a Web Services stack based on Simple Object Access Protocol (SOAP) and Web Services Description Language (WSDL). NETMF also features added libraries specific to embedded applications. It is free and open-source software released under Apache License 2.0.

A Bluetooth stack is software that is an implementation of the Bluetooth protocol stack.

<span class="mw-page-title-main">ChibiOS/RT</span> Real-time operating system

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. It is developed by Giovanni Di Sirio.

Amiga support and maintenance software performs service functions such as formatting media for a specific filesystem, diagnosing failures that occur on formatted media, data recovery after media failure, and installation of new software for the Amiga family of personal computers—as opposed to application software, which performs business, education, and recreation functions.

<span class="mw-page-title-main">ESP8266</span> System-on-a-chip microcontroller model with Wi-Fi

The ESP8266 is a low-cost Wi-Fi microchip, with built-in TCP/IP networking software, and microcontroller capability, produced by Espressif Systems in Shanghai, China.

Zephyr is a small real-time operating system (RTOS) for connected, resource-constrained and embedded devices supporting multiple architectures and released under the Apache License 2.0. Zephyr includes a kernel, and all components and libraries, device drivers, protocol stacks, file systems, and firmware updates, needed to develop full application software.

MicroPython is a software implementation of a programming language largely compatible with Python 3, written in C, that is optimized to run on a microcontroller.

<span class="mw-page-title-main">Apache Mynewt</span> Real-time operating system

Apache Mynewt is a modular real-time operating system for connected Internet of things (IoT) devices that must operate for long times under power, memory, and storage constraints. It is free and open-source software incubating under the Apache Software Foundation, with source code distributed under the Apache License 2.0, a permissive license that is conducive to commercial adoption of open-source software.

Mongoose OS is an Internet of Things (IoT) Firmware Development Framework available under Apache License Version 2.0. It supports low power, connected microcontrollers such as: ESP32, ESP8266, TI CC3200, TI CC3220, STM32. Its purpose is to be a complete environment for prototyping, development and managing connected devices.

Zerynth is a software implementation of the Python programming language for programming microcontrollers. It targets 32-bit microcontroller platforms and is designed to mix Python with C code. It connects the microcontrollers to the Cloud for developing Internet of Things (IoT) products.

<span class="mw-page-title-main">Flipper Zero</span> Multi-tool electronic device

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, along with a GPIO interface. It was first announced in August 2020 through the Kickstarter crowdfunding campaign, which raised $4.8M. The first devices were delivered to backers 18 months after completion of the crowdfunding campaign. The device's user interface embodies a pixel-art dolphin virtual pet. The interaction with the virtual pet is the device's core game mechanic. The usage of the device's functions defines the appearance and emotions of the pet.

References

  1. Ivan Cibrario Bertolotti (2016). Embedded Software Development; The Open-Source Approach. Tingting Hu. p. 361. ISBN   9781466593930. OCLC   932464067.
  2. Yi Qiu (2020). The design and implementation of the RT-thread operating system. Xiong Puxiang, Tianlong Zhu. p. 361. ISBN   9780367554866. OCLC   1197810565.
  3. "FatFs Memory Usage comparison table". elm-chan.org. Retrieved 2022-06-17.
  4. 1 2 3 4 "Developing applications on STM32Cube with FatFs" (PDF). STMicroelectronics . Retrieved 22 June 2022.
  5. Beningo, Jacob (2017). Reusable Firmware Development; A Practical Approach to APIs, HALs and Drivers. p. 255. ISBN   9781484232972. OCLC   1484232976.
  6. "FatFs License". elm-chan.org. Retrieved 2022-06-17.
  7. "FatFs Library description on Arduino platform documentation". Arduino Official Website. Retrieved 2022-06-17.
  8. "FAT Filesystem Support - ESP32 - — ESP-IDF Programming Guide latest documentation". docs.espressif.com. Retrieved 2022-06-27.
  9. "FatFs File System Configuration in rt-thread operating system". www.rt-thread.io. Retrieved 2022-06-26.