-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Make SPIFFS be an integer number of blocks #5989
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
Conversation
boards.txt.py simply calculated the end and start using flash sizes, but in cases where an 8K page was used (>512KB SPIFFS), this could leave a 4K half-block left at the end of SPIFFS. mkspiffs and the SPIFFS code uses integer division to calculate the maximum block number, so it worked fine in practice and the code simply ignored the extra, fractional block. Now actually take block size into account when calculating the end of SPIFFS, ensuring no fractional blocks are passed in. Does not result in data loss on pre-existing SPIFFS filesystems.
Ensure that no SPIFFS_block in the LD files is modified from the original to endure correct backwards compatibility
Could this also be the reason why I was not able to make a working 16M/14M SPIFFS layout with 32k block size? |
@TD-er that's pretty unlikely. Everything just integer divides the size which always rounds down, so the extra blocks at the end of space would never be touched or used. This specific change should be a no-op functionally, and only affect the "code aesthetics" by keeping all input values consistent. |
@earlephilhower in order to fix conflicts, can you regenerate |
#6537 will un-breaking this... |
Fixes #3621
boards.txt.py simply calculated SPIFFS end and start using flash sizes, but
in cases where an 8K page was used (>512KB SPIFFS), this could leave a
4K half-block left at the end of SPIFFS.
mkspiffs and the SPIFFS code uses integer division to calculate the
maximum block number, so it worked fine in practice and the code simply
ignored the extra, fractional block.
Now actually take block size into account when calculating the end of
SPIFFS, ensuring no fractional blocks are passed in. Does not result in
data loss on pre-existing SPIFFS filesystems.