Skip to content
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

spiffsimg and the firmware config out of sync #3095

Closed
TerryE opened this issue May 8, 2020 · 2 comments
Closed

spiffsimg and the firmware config out of sync #3095

TerryE opened this issue May 8, 2020 · 2 comments
Assignees
Labels

Comments

@TerryE
Copy link
Collaborator

TerryE commented May 8, 2020

Expected behaviour

spiffsimg should always be able to generate a SPIFFS image which can be loaded and read by the firmware.

Actual behaviour

As part of the SDK 3.0 changes, I tidied up the startup code which mounts the SPIFFS drops to a small block size if the file system is <32Kb, rather than <128Kb, but didn't carry this into spiffsimg. Oops.

Scope of work

  • I need to change this small BS to large BS to be consistent in both. Any recommendations on which?
  • The latest spiffs source has some minor tweaks, I can carry these across at the same time.
  • There are deep sleep applications (LFS only) where it makes sense to not mount any SPIFFS, so the startup should now tolerate a zero length SPIFFS partition.
  • Integration of spiffs remake into root Makefile. @HHHartmann, has the default behaviour of the make changed? I noticed that the root make no longer seems to update spiffsimg?

I just want a broad OK from the other committers before I raise this PR as the core element is a bugfix..

@TerryE TerryE added the bugfix label May 8, 2020
@TerryE TerryE self-assigned this May 8, 2020
@pnkowl
Copy link

pnkowl commented May 8, 2020

The latest spiffs source has some minor tweaks, I can carry these across at the same time.

I periodically run into SPIFFS "file" corruption issues. Is that something that might be applicable here? I am working on the "ticket" now. The beginning goes something like this

`problem

  • files go missing
  • files are truncated
  • files are altered

Supplied cases show this occurs when all SPIFFs pages have been written once.
For a 4MB module, this usually takes awhile.
When the firmware is updated or SPIFFs is formatted, the risk clock is reset.

As I understand it, when no SPIFFs pages are free, but are either used or deleted, a garbage collection operation must be performed to free the deleted pages. Sometimes this results in

  • truncated files (deleted pages)
  • deleted index or object lookup pages (data is there but filename page is gone)
  • corrupted pages (modified data file bytes at the beginning or end of a page boundary)
    `
    I have captured a sequence of module images (4MB each) illustrating this behavior. Demonstrated with a 32KB file either FTPed or serial uploaded. Corruption symptoms are slightly different, but corrupted all the same. Effect is repeatable across modules (e.g. ESP8266 Nodemcu V0.9 and Wemos D1 mini). I have seen this across firmware builds, LFS builds and time.

@pnkowl pnkowl mentioned this issue May 18, 2020
@TerryE
Copy link
Collaborator Author

TerryE commented Aug 22, 2020

This is really a duplication of #2943 raised by @albarrett Alex Barret, so let me close this and continue the discussion there.

@TerryE TerryE closed this as completed Aug 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants