LittleFS is an Open Source, Low Footprint, Resilient File System Designed for Tiny Devices

Most devices need to store data either configuration files, sensor data firmware updates, and while it’s in theory possible to write directly to the storage device, it’s normally not a good idea to do so due to issues such as wear, which could lead to a premature death of your storage…

LittleFS is an open source file system specifically designed for small devices such as IoT nodes for SPI NOR flash and SD card storage, and introduced in Mbed OS 5.7. The “high-integrity embedded file system” is resilient to power-cuts, supports wear-leveling, and comes in a small memory and storage footprint.

Mbed support both FAT and LittleFS, so the latter was compared to the former with the following key highlights:

  • Footprint – Code for LittleFS takes 13KB less storage than FAT, and 4KB less RAM
  • Power loss resilience – The file system has strong copy-on-write guarantees, and storage on disk is always kept in a valid state. FAT has no such resilience
  • Wear-leveling – LittleFS file system provides a form of dynamic wear leveling for systems that cannot fit a full flash translation layer. FAT has no wear-leveling capabilities.
FAT vs LittleFS RAM+ROM Footprint
FAT vs LittleFS wear-leveling demo

One of the downsides of LittleFS is that if you use (micro) SD cards for your project(s), you’ll lose compatibility with your computer, although if you run Linux there’s a FUSE wrapper that will allow you to mount littleFS in your computer.

The documentation and source code can be found on Github, with everything released under an Apache 2.0 license. Reference documentation is also available on Mbed website.

Share this:
FacebookTwitterHacker NewsSlashdotRedditLinkedInPinterestFlipboardMeWeLineEmailShare

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

ROCK Pi 4C Plus

2 Replies to “LittleFS is an Open Source, Low Footprint, Resilient File System Designed for Tiny Devices”

  1. What about timing? FatFS requires updates in several different places(FAT(s) and data at least) and it takes its time toll. How does littleFS operates in that regard?
    Thanks.

Leave a Reply

Your email address will not be published. Required fields are marked *

Khadas VIM4 SBC
Khadas VIM4 SBC