Skip to content

SPIFFS.begin() crashes (stops) ESP without errors and only a line of garbage in serial monitor #3030

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pjunni opened this issue Mar 9, 2017 · 7 comments

Comments

@pjunni
Copy link

pjunni commented Mar 9, 2017

Basic Infos

Hardware

Hardware: ESP-07
Core version: I don't know

Description

All I get in the serial monitor is this:

rrlaz|ela|� Œ lì b|Ž‚�ì�’r’bŒ bŒònnžlnnœâì b�pŒŽlrlrl�‚rò’nàbânbp

When I should get (if ESP not damaged):

OKOK?

Or if damaged I should get an error message or equivalent that SPIFFS begin fails. If I remove "SPIFFS.begin();" The sketch runs normally.

Settings in IDE

Module: Generic ESP8266 Module
Flash Size: 4MB
CPU Frequency: 80Mhz
Flash Mode: dio
Flash Frequency: 40Mhz
Upload Using: SERIAL
Reset Method: ck

Sketch

#include "FS.h"

void setup() {
  Serial.begin(115200);
  Serial.println("OKOK?");
  SPIFFS.begin();
}

void loop() {
}
@pjunni
Copy link
Author

pjunni commented Mar 9, 2017

Sorry to spam here. The solution was to upload with correct flash size settings in the IDE. To enable error messages and prevent this kind of issue here is one solution to the code above:

#include "FS.h"

String realSize = String(ESP.getFlashChipRealSize());
String ideSize = String(ESP.getFlashChipSize());
bool flashCorrectlyConfigured = realSize.equals(ideSize);

void setup() {
  Serial.begin(115200);
  if(flashCorrectlyConfigured) SPIFFS.begin();
  else Serial.println("flash incorrectly configured, SPIFFS cannot start, IDE size: " + ideSize + ", real size: " + realSize);
}

void loop() {
}

@pjunni pjunni closed this as completed Mar 9, 2017
@suculent
Copy link
Contributor

I have exactly the same issue even using this safety code. SPIFFS.format() works but SPIFFS.begin() crashes with nothing interesting in stacktrace.

Similar to issue #2655

@sovcik
Copy link

sovcik commented Feb 27, 2019

I recently (today) had the same issue with ESP07.
Tried with two chips to make sure it is not MC related issue.

And the result was: power supply.

Issue disappeared after adding 1mF capacitor to the circuit ...

@diegogrosmann
Copy link

diegogrosmann commented Apr 25, 2019

Tive o mesmo problema. Estava utilizando o FlashSize "1M (no SPIFFS)", alterei para "1M (192 SPIFFS)" e funcionou.

@suculent
Copy link
Contributor

suculent commented Apr 26, 2019 via email

@diegogrosmann
Copy link

O único cuidado que devemos ter é com o tamanho do SPIFFS. Se estiver usando OTA o tamanho total do bin (sketch + SPIFFS) tem que ser menor que 50% da FLASH.

The only care we should take is with the size of SPIFFS. If using OTA, the total bin size (sketch + SPIFFS) must be less than 50% of FLASH.

@suculent
Copy link
Contributor

suculent commented Apr 26, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants