I wrote About one year before a lot of Projects with ESP8266 using SPIFFS. Now I want to update a little bit, but SPIFFS doesn’t work anymore. Using Expressif8266 Version 1.8.0 all is ok, but with upgrade to 2.2.2 the same Code Fails. Not mounted and no Format is possible…
#include <FS.h> … if (SPIFFS.begin()) { … } else{
** Serial.println(F("\nSPIFFS not mounted."));**
** SPIFFS.format();**
** }**
you are right, thanks. Now it’s ok, but in case of upload files with OTA in into the filesystem comes the error
Update error: ERROR[10]: Magic byte is wrong, not 0xE9 ?
Former i used the build_flags = -Wl,-Tesp.flash.2m.ld and there was place for spiffs!!! with the same name „flash.2m“.
/* Flash Split for 2M chips /
/ sketch 1019KB /
/ spiffs 1004KB /
/ eeprom 20KB */
MEMORY
{
dport0_0_seg : org = 0x3FF00000, len = 0x10
dram0_0_seg : org = 0x3FFE8000, len = 0x14000
iram1_0_seg : org = 0x40100000, len = 0x8000
irom0_0_seg : org = 0x40201010, len = 0xfeff0
}
PROVIDE ( _SPIFFS_start = 0x40300000 );
PROVIDE ( _SPIFFS_end = 0x403FB000 );
PROVIDE ( _SPIFFS_page = 0x100 );
PROVIDE ( _SPIFFS_block = 0x2000 );
INCLUDE “…/ld/eagle.app.v6.common.ld”
I use the 2MB linker file, that all my chips have the same filesystem
Then the file content must have been changed during revisions, hm. But every other file with the format xMB.ld has 0 SPIFFS, see eagle.flash.4m.ld or eagle.flash.1m.ld. Maybe the 2MB was inconsistent and fixed.
Back in mid-late 2018, when they (ESP8266 Arduino core developers) started using the board generator script to create the ld scripts, and also provide a few more default configurations (another 7 or so IIRC), there was only the one 2M ld script, and it defined a ~1MB SPIFF partition. There are now five, with the one which matches your old functionality being eagle.flash.2m1m.ld: