-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Updater class corrupting FS uploads by setting flash mode byte in 1st sector #6880
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
Comments
Can you try with spiffs, too? Should be the same, as far as the uploader knows it's just bits. |
As stated, SPIFFs (and firmware) uploads work just fine. |
@earlephilhower
|
Very strange indeed. Have you uploaded a smaller FS (say, 1M)? I'm thinking if it's data corruption like that, then the FS size itself would not impact things. Might also be the Updater patching in something that it shouldn't (like it does when patching in ROM size in app images). |
Arduino/cores/esp8266/Updater.cpp Lines 326 to 347 in a738884
Looks like the Updater class is always potentially corrupting the first sector of a FS upload. SPIFFS doesn't check its structures very much (if at all) when mounting, so it might just ignore this. The flashmode change update needs to be predicated on |
Configured as a Lolin D1 (4MB flash), with FS:2MB, which I'd expect to be a common config for a more common board, since it should allow OTA updates for both code and FS. Similar results:
|
Changed title to underlying problem, @mike-s123, so that the changelist will be more meaningful. Thanks for the hex dump, it pinpointed this very quickly! |
Fixes esp8266#6880 The updater was patching in the proper flashmode configuration byte for all uploads, apps and filesystems. This ended up corrupting one byte on every FS upload. Change updated to only patch theflashmode if it is doing an app.
@mike-s123 please try out the PR in #6891 and report back. Now the 1 byte change should only happen to applications, not filesystems. |
Works for me. Thanks, Earle. |
Fixes #6880 The updater was patching in the proper flashmode configuration byte for all uploads, apps and filesystems. This ended up corrupting one byte on every FS upload. Change updated to only patch theflashmode if it is doing an app.
Basic Info
Platform
Settings in IDE
Problem Description
Uploading a large (~14MB) LittleFS image via ESP8266HTTPUpdateServer doesn't work (i.e. LittleFS.open() fails and the sketch can not open/read files).
Uploading the same image using USB and esptool.py (either manually or with the IDE uploader) works fine. Then, uploading the same image using OTA causes failure.
With an identically sized SPIFFs image, both USB and OTA uploads work fine. OTA firmware uploads work fine.
This has been 100% repeatable.
using esptool.py (this works, OTA doesn't)
The text was updated successfully, but these errors were encountered: