-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
[Feature Req] Auto-detect SPIFFS/partition layout #6679
Comments
Very interesting Flash size: WiFi settings addresses is independently computed by nonos-sdk-fw's by a similar way. There's nothing to do here. The only symbols that we use and defined by flash chip size / menu configuration are put to
|
Those WiFi settings addresses, are they computed at compile time, or run time? |
The logic in the python script is there to respect |
SPIFFS does not have anything like a FSINFO block. It also happily mounts things which only nominally look like a SPIFFS FS. And there is no sane way of telling where a SPIFFS FS ends. I would say the only sane and proper thing here is the partition layout stuff EPS32 and other chips already use. |
@TD-er what you're asking doesn't make sense to me.
Given this, and previous comments, I'm closing this. If we're missing the point, please clarify. |
The main problem is that the location of SPIFFS is defined at compile time, but it would be great if we can override this at run time. My point is, that it would be a great feature to have the SPIFFS defined not only at compile time, but also at run time. |
Flash size and other flash-relative configuration in the menu is necessary for:
|
how does SPIFFS know where FS starts? |
|
@JAndrassy saif:
I said:
There are pre-calculated ld scripts based on the menu options (board variant, FS size). The symbols are defined in there and get linked during build. |
yes, yes, it clicked in my head a little later :-) |
This symbol could be replaced by another one computed at run time from a fixed-address configuration structure. |
Actually after internal dicussion, it is today possible for a user to instantiate manually the FS with different start/end addresses. Arduino/cores/esp8266/spiffs_api.cpp Lines 138 to 143 in 6e51ef0
Arduino/libraries/LittleFS/src/LittleFS.cpp Line 192 in 6e51ef0
So if we have an internal core API offering the same calculation as what we have in the python script, we could dynamically process EEPROM_START. Then a pre-compiled sketch would not anymore depend on flash size (the FS size or start address and page size would be stored into a table indexed by flash size). @TD-er would you be ready to translate the python logic to the core api ? |
What is the current Python code used for generating the Eagle files? |
python code: #6679 (comment)
no,
possible, or: A default table can be implemented, giving FS size according to Flash size. Lines 1303 to 1333 in 6e51ef0
1MB: 64KB FS 2MB: 64KB FS 4MB: 2MB FS 8MB: 6MB FS 16MB: 14MB FS 512K: 32KB FS edit: That could be a default table. Other table (like no-fs-table) could be used by user. One particular sketch (like ESP-Easy) would select one table among the many. edit2: a new entry in "flash size" menu would be available: "sketch defined" where when selected, user would need to create missing symbols (possibly from the default tables described above). Symbols are: (_FS_SIZE, _FS_PAGE, _FS_BLOCK). eeprom size is constant, and location can be calculated from flash size. |
@TD-er In fact there's no need to port python code. |
If we can generate it, why then use a table? Why not compute it? |
I see two reasons:
|
The reason I asked is because of binary size. |
@TD-er Would these changes help with your release process ? |
@d-a-v I hope so, but I haven't yet made a build with ESPEasy using these changes. |
@TD-er Are you still interested in this feature ? |
Yes! I will try to make a test build for it ASAP. (hopefully on Monday...) |
For ESPEasy I have a lot of builds defined.
The number of builds can be more than halved by not having separate builds for 1M, 2M, 4M etc.
Lately I also added test builds for 4M2M layout (4M flash, 2M SPIFFS) and when rolled out to other build definitions the number of build environments will increase even more.
Also the chance of loading the wrong image on a node does increase with all these options.
Would it be possible to have the sketch detect the flash size and detect the location of the SPIFFS, instead of hard-coded in the build?
Then I can add a number of best practice offsets for different setups and chose the best one based on the found hardware when a SPIFFS has to be created (or LittleFS) and when there is one already present just use that one.
This will remove all the flash size related builds and make it just about selecting the processor + set of plugins you want.
If this is already possible, where can I find information on how to set it?
I guess the core libraries also need some fixed offsets for things like WiFi settings and the EPROM area. So these should then also be auto-probed and offer some function call to query their locations.
The text was updated successfully, but these errors were encountered: