-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
ESP8266 flash write cycle limit #1147
Comments
I have this problem too. And in native C (not only in lua module). |
On lua, does the module reset? If so, then can you provide the output of node.bootreason() and the contents of the mapfile that was output by the build..... |
I have other observation(suspicion). With SPIFFS_DGB. I saw next picture.
All static but except "free blocks".
"free blocks" have leaks. It is happened if we run timer once and reset device. Sorry for my bad grammar. |
I'm trying to debug this issue -- I suspect that it is another alignment error. It turns out that the current version of spiffs from the master repo has a (difference) alignment error in it. Unfortunately, I'm finding it difficult to build the nodemcu flavor of spiffs with the testcases. I'm trying to build it on my linux system. The other option would be to move to the newer version of spiffs and move it over, being careful not to edit most of the files (to make it easy to bring new patches over in the future). Thoughts? |
For what it's worth, in my experience, it pays off in the long run to bite the bullet in these cases, meaning go to the newer spiffs version, and pave the way for easier upgrades later. |
I suspect that you are right -- but this will require significant testing. I'm reluctant to do this in a hurry. The good news is that there are some changes in the base source to deal with systems that have alignment constraints. |
I try same code with dev branch for 30 hours. I wrote over then 1000000 cycle. Dev branch have no error for this issue. |
I found my fix: pellepl/spiffs@7c54937 My spiffs before fail on spiffs_gc_check when fs.free_blocks < 3. |
I suggest to take over the bug fix for pellepl/spiffs@7c54937 |
My feeling is that we want to take the real spiffs master code rather than cherry-picking individual commits. However, the spiffs code currently fails the spiffs self-tests when using our settings for block/sector/page sizes. I filed a ticket: pellepl/spiffs#77 for them to investigate. |
With the new master code, the lua code above runs for over 6300 iterations before I got bored. This would seem to be an improvement! There will be a PR for this fix soon. |
Philip, the OP quoted 6800 as the failure point. |
The 6800 was with one file, it was 3400 with two files as in the sample code (or at least that is what I understood) |
There is a format change in the latest version of spiffs. I was thinking of binding the spiffsimg code much more tightly to the nodemcu code -- making it use the same set of sources so that we are assured that it is binary compatible. |
I ran the test for 32000 cycles -- still working fine! |
Philip, have a look at my luac.cross patch. This works the issue of how to dual use, in ESP and on host. |
Fixes #1164 and thus also #1150, #1149, #1147 and #898. * Move to latest version of SPIFFS * Add SPIFFS porting layer for NodeMCU * Add option to delete output if it doesn't fit * Change FLASHSIZE to be in bits by default: default 4mb 32mb * Add SPIFFS_MAX_FILESYSTEM_SIZE override * Add notes on SPIFFS_FIXED_LOCATION * Add 1M boundary * Include the current version of the LICENSE
Fixed by #1226. |
I have a problem with ESP8266 12E and 12F series about write commands. When I need to write data to the flash in ESP8266 it only allows to around 6800 times with (w+) command. I am using both integer and float and lastest and previous firmwares but nothing changes. An example simple code is below. With ESPlorer I run the codes and when both test1 lua and test2 lua reaches to 3400 file system starts to reset the module. I only activate module by formatting it. If I use just one file it reaches around 6800 cycle of writing. With (a+) command and 2 files I only managed to write up to total 13600 number somehow. Then again a format is needed. I do not how to erase and where to erase flash form lua file. Any help would be appreciated.
The text was updated successfully, but these errors were encountered: