ESP8266 SPIFFS and LittleFS FileSystems

The ESP8266 devices from Espressif, allow for files to be embedded into a filesystem, which is in the same flash chip as your program.

As these share the same memory space, the size allocated to your filesystem depends both the size of the Flash Chip, and the program embedded.

Detailed Information about the sizes of Chips and Filesystems is available on the ESP8266 File System Page.

 

Adding Files to the FileSystem

This is the same for both mechanisms:

1) Create a sub-folder in your project root, called "data"

2) Add any files you want to be uploaded to SPIFFS to this folder

 

SPIFFS

Warning Icon SPIFFS Note:

NOTE - SPIFFS is no longer maintained, and will be deprecated in future versions of the ESP8266 toolset.

To Perform a SPIFFS Upload:

1) Add code to your sketch to mount, and use the SPIFFS FileSystem (See Examples > 

2) Select the relevant Flash Size Board Option for your Chip + FileSystem Usage

3) Upload your SPIFFS Image from vMicro > Publish Server Data Files (spiffs)

4) Upload your Sketch as Normal


LittleFS

LittleFS is the successor to the SPIFFS system, and is still actively maintained, offering speed advantages over the SPIFFS system when used on-chip.

Visual Micro will automatically switch to LittleFS when the SPIFFS tools are no longer found.  See the next section to force your project to use LittleFS instead of SPIFFS.

Force LittleFS

Add a Local Board.txt by right clicking the project in the Solution Explorer > Add > Local Board.txt

Add the below text to the file, and Save.  The project will now use the LittleFS system instead of SPIFFS.

# Force LittleFS Usage for ESP8266
runtime.tools.mkspiffs.path=notTheToolYoureLookingFor 

To Perform a LittleFS Upload:

1) Add code to your sketch to mount, and use the LittleFS FileSystem (See ESP8266 Examples > LittleFS)

2) Select the relevant Flash Size Board Option for your Chip + FileSystem Usage

3) Upload your SPIFFS Image from vMicro > Publish Server Data Files (spiffs)

4) Upload your Sketch as Normal

 

Further Information

All methods accessible for both File Systems and their usage can be found in the ESP8266 Documentation here