Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.2k
esp32: auto-detect the SPI flash size and automatically size the filesystem#17337
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Signed-off-by: Damien George <damien@micropython.org>
And remove the ESP32_GENERIC_S3-FLASH_4M variant, because it's no longerneeded.Signed-off-by: Damien George <damien@micropython.org>
An observation and suggestions. It took me a long time to understand how variants worked, and what options there are for configuration as there is little documentation, other than in comments in individual make and header files, and in PR comments such as this, which are hard to find later. In this case there is a new macro defined, that can be overridden, and that is clearly described here. I think it would be very helpful to add that to the Documentation, on a common or port level. |
Summary
Currently in the esp32 port the size of the SPI flash must be configured at build time, eg 4MiB, 8MiB, etc. Also, the esp32 partition table must be configured at build time, which depends on the size of the SPI flash. A bigger flash means more can be allocated to the user filesystem.
This PR makes it so the SPI flash size is automatically determined at runtime, and the filesystem size is automatically set to take up as much room as possible.
This works by:
vfs
partition from the esp32 partition table (only nvs, phy_init and firmware remains in the partition table).autofs
partition which takes up the flash from 2MiB up to the end of flash.This allows simplifying a lot of board configurations, and removing some board variants that just change the flash size.
It's also fully backwards compatible, in the following sense:
vfs
orffat
partitions as the filesystem.Eventually this mechanism will be extended:
Testing
Tested with ESP32_GENERIC on a board with 4MiB of flash, and ESP32_GENERIC_S2 on a board with 16MiB flash. The filesystem size was correctly detected.
Trade-offs and Alternatives
MICROPY_BOARD_STARTUP
macro.