You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
readBytes on a SPIFFS file causes reboot (with no error messages) - but only when exactly 52 bytes are read. The file is the same in all case (a "config" file named "/conf").
Dozens of other (shorter AND longer) strings work perfectly and have done for weeks.
The only thing I can think of is that my SPIFFS memory area has become corrupted somehow and that some historic "footprint" of a bad 52-byte file is lying around and keeps getting re-used when the same length string is written again.
Settings in IDE
Module: WeMos D1 R2 & Mini
Flash Size: 4MB (1M SPIFFS)
CPU Frequency: 80Mhz
Upload Using: SERIAL
How to further diagnose or fix? I have reuploaded my SPIFFS image (which does NOT include the /conf file) many times using the IDE (1.8.3) tool, as well as automatically on boot via ESPhttpUpdate. After each such re-upload, I then use my config web page to write the file, which appears to be written fine. Upon next reboot, the problem of the 52-byte read appears.
I'm going to try one more thing and that is to change the SPIFFS size and try the whole process again, unless someone has any other ideas?
The text was updated successfully, but these errors were encountered:
philbowles
changed the title
Bizarre SPIFFS readBytes crash - only when exactly 52 byes read
Bizarre SPIFFS readBytes crash - only when exactly 52 bytes read
Sep 30, 2017
@philbowles You are mallocing 53 bytes for your buff, and I count 53 chars in your printout. Aren't you forgetting the null term? You should allocate n+1, and probably also do buff[n] = 0; after reading (index right after your read data).
Also, why are you reading into an alloced char * only to assign to a String, when you can call f.readString() directly?
Closing due to usage error (see #3655 ). If after you fix the errors you still see an issue, please revisit or open a new issue, and also please provide a MCVE.
I changed the SPIFFS size to 4M (3M SPIFFS) uploaded SPIFFS image using IDE ...same problem. Will now look into reformatting the SPIFFS area and starting again...
Basic Infos
Hardware
Hardware: Wemos D1 Mini
Core Version: 2.3.0
Description
readBytes on a SPIFFS file causes reboot (with no error messages) - but only when exactly 52 bytes are read. The file is the same in all case (a "config" file named "/conf").
Dozens of other (shorter AND longer) strings work perfectly and have done for weeks.
The only thing I can think of is that my SPIFFS memory area has become corrupted somehow and that some historic "footprint" of a bad 52-byte file is lying around and keeps getting re-used when the same length string is written again.
Settings in IDE
Module: WeMos D1 R2 & Mini
Flash Size: 4MB (1M SPIFFS)
CPU Frequency: 80Mhz
Upload Using: SERIAL
Sketch
Debug Messages
Here's a working Example:
Here's another:
And a 3rd:
But as soon as the same file containing exactly 52 bytes is read:
There are no other messages: no boot reason code, nothing but the gibberish and then my setup() routine running again.
I'm convinved it's a SPIFFS corruption as the same code running on a NodeMCU v0.9 shows:
How to further diagnose or fix? I have reuploaded my SPIFFS image (which does NOT include the /conf file) many times using the IDE (1.8.3) tool, as well as automatically on boot via ESPhttpUpdate. After each such re-upload, I then use my config web page to write the file, which appears to be written fine. Upon next reboot, the problem of the 52-byte read appears.
I'm going to try one more thing and that is to change the SPIFFS size and try the whole process again, unless someone has any other ideas?
The text was updated successfully, but these errors were encountered: