Skip to content

Adam5Wu/ESPVFATFS

Repository files navigation

ESPVFATFS

Build Status GitHub issues GitHub forks License

FATFS on internal flash for ESP8266 Arduino

Purpose

ESP8266 is a nice little device, capable of running nearly full featured Web server, providing relatively rich user experiences.

Some versions of device has up to 16MB of internal flash storage, which can pretty much hold all resources it needs to serve, making it a self-contained, ultra-portable Web server.

However, currently Arduino for ESP8266 provides only SPIFFS as backing file system, which lacks several important features:

  • Real directories
  • Long file names
  • File modification time

Inspired by the ESP8266 MicroPython project, this library provides a wrapper to use FatFs on the internal flash storage of ESP8266, which resolves the above mentioned limitations.

Implemented Features

  • Standard file system features:
    • Real directories
      • Relative path operations
    • Long file names
    • File modification time
    • File truncation
  • Multi-partition support: Up to 4 partitions, great storage management flexibility
  • TRIM command support: Improves write performance
    • In-memory clear sector cache: Reduces unnecessary erases
    • Background erase: Significantly improves TRIM responsiveness

How to use

Install the library - clone this repo into the "libraries" folder in your Arduino projects (found in your home / document directory).

(Re)start the Arduino, open up the example from menu [File] - [Examples] - [ESP VFATFS] - [FATFS_Init]

WARNING: Running the demo code, or more generally, calling VFATFS.begin(), will automatically reformat your designated flash storage area into FAT file system. All your pre-existing data WILL BE LOST! Please backup before proceed.

WARNING 2: Conversely, after you have mounted VFATFS, calling SPIFFS.begin() will automatically reformat your designated flash storage area into SPIFSS file system. All your pre-existing data WILL BE LOST! Please backup before proceed.

Current implementaiton has been tested on ESP-12 module with 4MB flash. It works with either "3MB SPIFFS" or "1MB SPIFFS", and you will get a FAT file system with corresponding sizes.

Bugs / Suggestions?

No problem, just let me know by filing issues.

About

FATFS for ESP8266 Arduino

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published