Lolin D1 Mini Pro with 16MB flash / esp8266fs SPIFFS upload tool / Bad upload

Lolin D1 Mini Pro with 16MB flash / esp8266fs SPIFFS upload tool / Bad upload

I'm using a (genuine) Wemos Lolin D1 Mini Pro with 16MB flash and am having extreme difficulty loading a set of 4 files (windows reports 2.02 MB total size) into it's SPIFFS files system using the ide add-in tool esp8266fs-plugin (ver 0.3.0). I'm using the arduino esp core version 2.4.1.

The symptoms are that the the sketch which attempts to list the files found in the SPIFFS file system either (a) finds only one of the files in the set or (b) for some reason, there is a long pause during the SPIFFS.begin() phase where it is presumably reformatting the file system and, of course, then reports an empty file system.

I've also tried loading the sketch with "Erase All Flash Contents" option to clean things out and have tried using a SPIFFS.format() statement in the sketch but neither has helped.

Here is the output from the esp8266fs:

[SPIFFS] data   : C:\Users\6v6gt\Documents\Arduino\ESP8266\spiffs_test-Aide_v0.02\data
[SPIFFS] size   : 15340
[SPIFFS] page   : 256
[SPIFFS] block  : 8192
/RenateFuczik_v0.03.b.trk

/RenateFuczik_v0.03.wav

/text1.txt

/text2.txt

[SPIFFS] upload : C:\Users\6v6gt\AppData\Local\Temp\arduino_build_964227/spiffs_test-Aide_v0.02.spiffs.bin
[SPIFFS] address: 0x100000
[SPIFFS] reset  : nodemcu
[SPIFFS] port   : COM7
[SPIFFS] speed  : 256000

Uploading 15708160 bytes from C:\Users\6v6gt\AppData\Local\Temp\arduino_build_964227/spiffs_test-Aide_v0.02.spiffs.bin to flash at 0x00100000

................................................................................ [  0% ]

................................................................................ [  1% ]

etc. etc.
............................................................                     [ 100% ]

It looks OK. I have 15M SPIFFS selected in the boards properties. The size of the image it has built looks OK (15708160) which is the difference between the spiffs_start (0x100000) and spiffs_end (0xFFB000) determined from the boards.txt file.

The sketch which I run is here :

/*
   based on: https://circuits4you.com/2018/01/31/example-of-esp8266-flash-file-system-spiffs/


   ESP8266 SPIFFS Basic Reading and Writing File

   v0.02 16MB test

*/

#include <ESP8266WiFi.h>
#include <FS.h>   //Include File System Headers



void setup() {
  delay(1000);
  Serial.begin(115200);
  Serial.println();

  // stop attempts to build wifi connection
  WiFi.disconnect();
  WiFi.mode(WIFI_OFF);

  delay(1000) ;


  //Initialize File System
  Serial.println("SPIFFS.begin() . . . ");
  if (SPIFFS.begin())
  {
    Serial.println("SPIFFS Initialize....ok");
  }
  else
  {
    Serial.println("SPIFFS Initialization...failed");
  }

  //Format File System
#if 0  // commented out to endif !!
  Serial.println("SPIFFS.format() . . . ");
  if (SPIFFS.format())
  {
    Serial.println("File System Formated");
  }
  else
  {
    Serial.println("File System Formatting Error");
  }
#endif
  /*
    struct FSInfo {
      size_t totalBytes;
      size_t usedBytes;
      size_t blockSize;
      size_t pageSize;
      size_t maxOpenFiles;
      size_t maxPathLength;
    };
  */
  Serial.println(F("SPIFFS filesystem. Info"));
  FSInfo fs_info;
  SPIFFS.info(fs_info);
  Serial.printf( "Tot: (%d), Used: (%d), block: (%d), page: (%d), maxOpen: (%d), maxPath: (%d)   \r\n",
                 fs_info.totalBytes  ,  fs_info.usedBytes  ,  fs_info.blockSize  ,  fs_info.pageSize  ,  fs_info.maxOpenFiles  ,  fs_info.maxPathLength  ) ;


  delay(1000) ;

  Dir dir ;
  Serial.println(F("SPIFFS filesystem. Dumping directory ..."));
  dir = SPIFFS.openDir("/");
  while (dir.next()) {
    String str = "" ;
    // fn = String( dir.fileName() ) ;
    str += dir.fileName();
    str += " / ";
    str += dir.fileSize();
    str += "\r\n";

    Serial.print(str);
    Serial.println() ;
  }
  Serial.println("end of setup()");
}

void loop() {
  Serial.println("in loop()" ) ;
  delay(2000) ;

}

and delivers this output (in the case where one of the four files is found) :

SPIFFS.begin() . . . 
SPIFFS Initialize....ok
SPIFFS filesystem. Info
Tot: (14900866), Used: (1823515), block: (8192), page: (256), maxOpen: (5), maxPath: (32)   
SPIFFS filesystem. Dumping directory ...
/RenateFuczik_v0.03.b.trk / 2580

end of setup()
in loop()
in loop()
etc. etc.

In the the other case, there is a long wait (minutes) at the SPIFFS.begin() stage.
The only odd thing I see in the output is the total size of the SPIFFS file system reported by the sketch is significantly smaller than the size of the image loaded by the esp8266fs tool.
This effect seems to be independent of the upload speed.

Any ideas on how to trouble shoot this ?

Edit. If I select a board file for the equivalent device with only 4MB of flash, it works fine, but that is no solution as I require more than 3MB of SPIFFS.

I believe I can answer my own question:

If I interpret the ESP8266 Arduino Github release process correctly, the issue of 16MB Flash support has been "penciled in" for platform release 2.6.0 (the current release is 2.4.2).
The boards.txt to support this is already in the current release, it just doesn't work if you use a 16MB option.

Maybe 16MB Flash (or more) will be usable sooner from the ESP32 arduino platform and, if so, I'll move to that for my current project.