question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

v5.1.0 broked something related to LittleFS and SPIFFS with TinyPICO board... works in Arduino IDE.

See original GitHub issue

This is a small code sample that read and write to Little FS on ESP32.

#include "WiFi.h"
#include <FS.h>
#include <LittleFS.h>

void setup() {
  Serial.begin(115200);
  // Set WiFi to station mode and disconnect from an AP if it was previously connected
  WiFi.mode(WIFI_STA);
  WiFi.disconnect();
  delay(100);
  Serial.println("Setup done");
  if (!LittleFS.begin(true)) {
    Serial.println("Formatted");
  } else {
    Serial.println("Formatteddd");
    LittleFS.format();
  }
  File file = LittleFS.open("/prova.txt", "w");
  //Write to the file
  file.print("dsadasdsa");
  delay(1);
  //Close the file
  file.close();
  Serial.println("wrote");
  File file2 = LittleFS.open("/prova.txt", "r");
  if (!file2) {
    Serial.println("No Saved Data!");
  }
  Serial.println(file2.read());
}

void loop() {
  Serial.println("scan start");

  // WiFi.scanNetworks will return the number of networks found
  int n = WiFi.scanNetworks();
  Serial.println("scan done");
  if (n == 0) {
    Serial.println("no networks found");
  } else {
    Serial.print(n);
    Serial.println(" networks found");
    for (int i = 0; i < n; ++i) {
      // Print SSID and RSSI for each network found
      Serial.print(i + 1);
      Serial.print(": ");
      Serial.print(WiFi.SSID(i));
      Serial.print(" (");
      Serial.print(WiFi.RSSI(i));
      Serial.print(")");
      Serial.println((WiFi.encryptionType(i) == WIFI_AUTH_OPEN) ? " " : "*");
      delay(10);
    }
  }
  Serial.println("");

  // Wait a bit before scanning again
  delay(5000);
}

if I use a TinyPICO board, this small snippet fails reading writing LittleFS when using espressif32@5.1.0 it works well when using espressif32@5.0.0

I noticed that the only way to make it work with espressif32@5.1.0 is to use board_build.flash_mode = qio instead of board_build.flash_mode = dio

but this does not have sense to me.

when using espressif32@5.0.0 that snippet works with both QIO and DIO.

the problem happen on TinyPICO board only, it does not happen on LolinD32 or other ESP32 boards I have.

Same snipped always works well with Arduino IDE when using Core 2.0.4.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:29 (20 by maintainers)

github_iconTop GitHub Comments

1reaction
Jason2866commented, Aug 17, 2022

@valeros Perfect! Thx, for your great support 😃

1reaction
valeroscommented, Aug 17, 2022

@cyberman54 Just run pio platform update espressif32 in the IDE terminal.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Platform-espressif32 v5.1.0 and bootloop - #21 by sblantipodi
With Arduino IDE it prints “Formatted” and it works as expected. With PlatformIO I see this in the console: E (322) SPIFFS: mount...
Read more >
#203 SPIFFS vs LITTLEFS for ESP32 & ESP8266 ... - YouTube
#203 SPIFFS vs LITTLEFS for ESP32✓ & ESP8266✓ (not Arduino UNO ❌). Watch later. Share. Copy link. Info. Shopping. Tap to unmute.
Read more >
ESP8266 Arduino Core Documentation - Read the Docs
8 Guide to PROGMEM on ESP8266 and Arduino IDE ... Note that some boards and modules (ESP-12ED, NodeMCU 1.0) also break out pins...
Read more >
Coding Examples — TinyPICO
TinyPICO ships with MicroPython v1.10 pre flashed and some code to flash random colours on the APA102, so you know it's working when...
Read more >
Is SPIFFS Upload Broken... Again? - Arduino Forum
I now find I can open the files, but all reads return all data as 0xff. It is not the board, as I've...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found