platformio / platform-espressif8266

Espressif 8266: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/espressif8266
Apache License 2.0
325 stars 219 forks source link

SPIFFs is not working on staging version #115

Closed debsahu closed 5 years ago

debsahu commented 5 years ago

platformio.ini:

[env:nodemcuv2]
build_flags =
;  -D PIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH
  -Wl,-Teagle.flash.4m.ld
; platform = espressif8266@1.8.0
platform = https://github.com/platformio/platform-espressif8266.git#feature/stage
; platform = https://github.com/platformio/platform-espressif8266.git
board = nodemcuv2
framework = arduino
board_build.flash_mode = dio
upload_speed = 115200
monitor_speed = 115200
upload_resetmethod = nodemcu

The following code compiles and works on esp8266-arduino v2.5.0-beta2, esp8266-arduino git and esp8266-arduino v2.4.2 versions. On PIO, following code works on espressif8266@1.8.0 and platform-espressif8266.git, but does not work on platform-espressif8266.git#feature/stage

main.cpp:

#include <FS.h>

void setup()
{
  Serial.begin(115200);
  Serial.println();
  Serial.println("---------------------------");
  Serial.println("Starting SPIFFs");
  if (SPIFFS.begin())
  {
    Dir dir = SPIFFS.openDir("/");
    while (dir.next())
    {
      String fileName = dir.fileName();
      size_t fileSize = dir.fileSize();
      if (Serial)
        Serial.printf("FS File: %s, size: %dB\n", fileName.c_str(), fileSize);
    }

    FSInfo fs_info;
    SPIFFS.info(fs_info);
    if (Serial)
    {
      Serial.printf("FS Usage: %d/%d bytes\n", fs_info.usedBytes, fs_info.totalBytes);
      Serial.println("SPIFFs started");
      Serial.println("---------------------------");
    }
  }
}

void loop()
{
}
mcspr commented 5 years ago

[env:nodemcuv2] build_flags = ; -D PIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH -Wl,-Teagle.flash.4m.ld

ld file that you are using has no spiffs. see comments here (as documentation suggests): https://github.com/esp8266/Arduino/blob/master/tools/sdk/ld/eagle.flash.4m.ld https://github.com/esp8266/Arduino/blob/master/tools/sdk/ld/eagle.flash.4m1m.ld https://github.com/esp8266/Arduino/blob/master/tools/sdk/ld/eagle.flash.4m2m.ld https://github.com/esp8266/Arduino/blob/master/tools/sdk/ld/eagle.flash.4m3m.ld

debsahu commented 5 years ago

omg, that was a such an amatuer mistake on my part! thank you.

jaromanda commented 5 years ago

It's not so much an amateur mistake as you think, since the eagle.flash.4m.ld file used to specify 3M spiffs