LittleFS is a flash system designed for embedded systems; LittleFS File System was developed to work on devices with only a limited amount of RAM and storage for microcontrollers.
LITTLEFS is the exact library ESP32 builds uses, while LittleFS is used by ESP8266 builds. If you are trying to build an Arduino sketch using LittleFS, you will experience the “fatal error: littlefs.h: no such file or directory” error. It indicates that your build is complaining that LITTLEFS is missing, which means you need to install the library, per iangray001.
So, If you attempt to build an application that uses LittleFS as its LittleFS files system, you are bound to encounter the following error message:
fatal error: littlefs.h: no such file or directory
Why am I seeing the Fatal Error: Littlefs.h: No such File or Directory?
- You haven’t installed The Little Library.
- The little Library is not part of your sketch.
- The Little Library is not compatible with your device.
Ways to fix Fatal Error: Littlefs.h: No such File or Directory
Here’s how to fix Fatal error: littlefs.h: no such file or directory Error.
- Install LittleFS library.
- Add the LittleFS Library into your Sketch.
- Check if the LittleFS Library is compatible with your board.
#1. Install LittleFS
You can use Arduino Library Manager to install LittleFS library:
- Open Arduino IDE and the Sketch.
- Include Library.
- Tap on Manage Libraries.
- In the search box; type “littles” and click Enter.
- The LittleFS Library will be listed in the results list.
- Open the Library, and click on the Install button.
Once the Library is installed, you can now use it in your drawings with no errors
#2. Add LittleFS Library to your sketch
It does not end at just installing the LittleFS Library, you have to also incorporate it into your Sketch.
Using Sketch to do this; Include Library plus LittleFS; and this code line will be included in your design :
This will help you include LittleFS Library to your sketch.
#3. Ensure that LittleFS library is compatible with your Board
You can use LittleFS library with various Arduino boards, such as Arduino Mega, Arduino UNO, Arduino Mega, and Arduino Nano.
But not all Arduino Boards are compatible with LittleFS, and this can cause the “fatal error: littlefs.h: no such file or directory” when running a motherboard not identified as compatible with your system. However, you can resolve the issue by using a compatible motherboard.
If you are using an incompatible board with LittleFS, then you have to use a compatible board instead.
Find boards that are compatible with LittleFS on Github.
As a last resort, contact LittleFS Github Support Forum for help, if these few hacks do not work for you.
I am an experienced tech and innovation writer. It’s been 2 years+ I started writing at Terecle, covering mostly Consumer electronics and Productivity. In my spare time, I enjoy reading and learning the latest happenings around the tech ecosystem.