How to fix error 148 from "pio run -t buildfs"?

Hi guys,
In the PlatformIO Core CLI the command pio run -t buildfs completed with:

Building in release mode
Warning! '-Wl,-T' option for specifying linker scripts is deprecated. Please use 'board_build.ldscript' option 
in your 'platformio.ini' file.
Building file system image from 'Data' directory to .pio\build\esp12e\spiffs.bin
*** [.pio\build\esp12e\spiffs.bin] Error 148

Searching didn’t help. The only mention is for different ESP module type. My platformio.ini:

[env:esp12e]
platform = espressif8266
board = esp12e
framework = arduino
build_flags = -Wl,-Teagle.flash.4m.ld

Please, advise:

  1. How to get rid of the warning?
  2. What is ‘error 148’ and how to fix it?

See right there in the output

And in the docs.

Just replace

build_flags = -Wl,-Teagle.flash.4m.ld

with

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

As you can read in

The linkerscript eagle.flash.4m.ld provides 0 bytes of space for a file system. So building the file system will fail. The 4m1m.ld script assumes a 4MB flash and allocates 1MB for SPIFFS.

1 Like

Thank you!
Indeed both problems came from the same line in platformio.ini.