File system is full error when building file system image

I have a D1 Mini clone with 4mb of flash.
My platformio.ini file has these options:

platform = espressif8266
board = esp12e
framework = arduino
board_build.filesystem = littlefs
monitor_speed = 115200

I have a 1.5mb hex file in my project’s /data directory. When running Build Filesystem Image, I’m getting an error: File system is full.

How do you build and upload more than 1mb of data to the ESP’s flash storage?

 *  Executing task: platformio run --target buildfs --environment esp12e 

Processing esp12e (platform: espressif8266; board: esp12e; framework: arduino)
Verbose mode can be enabled via `-v, --verbose` option
PLATFORM: Espressif 8266 (3.2.0) > Espressif ESP8266 ESP-12E
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
 - framework-arduinoespressif8266 @ 3.30002.0 (3.0.2) 
 - tool-esptool @ 1.413.0 (4.13) 
 - tool-esptoolpy @ 1.30000.201119 (3.0.0) 
 - tool-mklittlefs @ 1.203.210628 (2.3) 
 - tool-mkspiffs @ 1.200.0 (2.0) 
 - toolchain-xtensa @ 2.100300.210717 (10.3.0)
LDF: Library Dependency Finder ->
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 35 compatible libraries
Scanning dependencies...
Dependency Graph
|-- LittleFS @ 0.1.0
|-- EspSoftwareSerial @ 6.12.7
Building in release mode
Building file system image from 'data' directory to .pio/build/esp12e/littlefs.bin
lfs warn:475: No more free space 158
lfs_write error(-28): File system is full.

error adding file!
*** [.pio/build/esp12e/littlefs.bin] Error 1
================================================================================ [FAILED] Took 0.73 seconds ================================================================================

Environment    Status    Duration
-------------  --------  ------------
esp12e         FAILED    00:00:00.730
=========================================================================== 1 failed, 0 succeeded in 00:00:00.730 ===========================================================================

You have all linker files that partition the available flash space into firmware, filesystem (and other smaller things) at Arduino/tools/sdk/ld at master · esp8266/Arduino · GitHub.

The documentation tells you how to use them.

For example, you can use a linker script that allows a 2 MByte filesystem with a 4MByte flash:

board_build.ldscript = eagle.flash.4m2m.ld 

(Note that there will be overhead in putting the file in a LittleFS filesystem, so the actual file limit is not exactly 2MByte, but slightly smaller)

1 Like

Thanks for pointing me in the right direction. I was able to build and then upload. Now to figure out why my sketch can’t read the file…

EDIT: fixed it. I forgot to comment out the original target in my platformio.ini file, so it was actually uploading d1_mini_lite after esp12e :slight_smile: