-
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
Don't allocate flash to SPIFFS that is reserved by the system. #3260
Conversation
Thanks Philip! |
My concern here is that this area hasn't been reserved or used by the system since SDK 2.x. Since SDK 3.0, the system used the areas defined in the PT. See user_main.c:L81-83. I did check at the time of testing this that SDK now uses the However if I am right this fix won't fix anything. I've just checked Wemos D1 mini pro that I've been testing on for a few weeks using So the bottom line is that I can't see how this change has anything to do with #3208, unless our code is still dicking around with the non PT locations. Sorry. BTW w.e.f SDK 3.0, this area isn't reserved by the system so this title is misleading. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not merge or restart using SDK 2.x features until we have bottomed this issue. Thanks.
@TerryE What was interesting is that when this happened, the old contents of the last 12k (I was only saving 12k) did include my SSID and password, and then, when it stopped working, the SSID and password was gone. Also I I do Something is certainly writing to that area, and there is strong evidence for something reading from that area. |
@pjsg, as mentioned in #3148, I have been doing continuous ongoing testing related to the SPIFFS, I also started experiencing the problem of the failing WiFi connection. Both the failures (SPIFFS related corruption & disappearing files and WiFi connection) happened at least once every 24 hours. I have implemented your suggested change, since then none of the long time present problems have been observed so far. I will report if it changes. |
@pjsg Philip We have 3 reserved system partitions: What I don't understand is why we should also move the other two back since we have validated that the SDK correctly uses the current versions. My suggestion is that we only move the SP partition back. We also need to check the I will prepare and push an update along these lines, so please post back here if you disagree and then we can open this debate for resolution, before doing the change. |
I don't have any evidence that it is using the 2 pages before the last 3
for anything. I just assumed (yes, I know) that if they screwed up the
system parameter area, they probably screwed up the other areas as well. If
those areas do seem to be mapped down low, then that is great.
…On Mon, Aug 31, 2020 at 11:38 AM Terry Ellison ***@***.***> wrote:
@pjsg <https://github.com/pjsg> Philip We have 3 reserved system
partitions: RF_CAL,PHY_DATA and SYSTEM_PARAMETER . We moved these to the
"dead" region before the firmware, that is 0xB000 - 0xFFFF back when we did
the 2.x to 3.0 upgrade; the pros and cons were debated then on the issue
and PR. I accept that I made a mistake in not including WiFi connection
tests in my testing at the time and so I missed the fact that the SDK /
BIOS code for the WiFi fixed the SP are as the last 3 pages in the flash,
so we need to accept and implement this move.
What I don't understand is why we should also move the other two back
since we *have* validated that the SDK correctly uses the current
versions.
My suggestion is that we only move the SP partition back. We also need to
check the node.setpartitiontable() and nodemcu-partition.py code to make
sure that these still work. We also need to check that this interplays well
with the RFcal initialisation code ad the flash size reset.
I will prepare and push an update along these lines, so please post back
here if you disagree and then we can open this debate for resolution,
before doing the change.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3260 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALQLTKS3RYNX4WMWK56243SDO7U7ANCNFSM4QPHBT7Q>
.
|
It was very easy to miss, as Espressif stated in the first documentation of partition table that SYSTEM_PARAMETER partition has to be declared and can have custom address. But in "Notes" section of README they state that SYSTEM_PARAMETER partition has fixed address - very inconsistent. |
No, I don't think the other two are screwed up. These partitions are updated as per the PT, and there is no evidence that the corresponding high pages are touched. As @galjonsfigur points out, the documentation states: " Even if we do move the SP partition back to end of flash, we still need to keep the PT valid and my code assumes that (and also validates that) the individual partitions are in ascending address and are non-overlapping, so we need to resort and update the PT to avoid side-effects. I've made the changes and tested the load + node functions.
|
Fixes #3208
dev
branch rather than formaster
.This PR just subtracts the 20k reserved memory from the end of the flash before setting up the SPIFFS partition. This also explains why the contents of SPIFFS would get corrupted on the dev branch.
The downside of this change is that this will trigger a SPIFFS reformat (if you didn't have a fixed size spiffs). However, that is a good thing as it will no longer overwrite important stuff.