-
Notifications
You must be signed in to change notification settings - Fork 3k
DataFlash: Change erase size to pages to reduce memory usage. #10478
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
@chrissnow, thank you for your changes. |
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.
This change is surprising, as I wasn't aware of the fact you could erase a page. Is this supported on all dataflash components?
Yes. All devices support page erases. |
All right then, so this is definitely a good change. Approving. |
@chrissnow Where can I verify this detail? |
@0xc0170
It seems the docs need an update too, it states it's I2C for a start! Though I can't go through every revision of every device, I'm pretty confident that any AT45 will be fine, small page erases are the main reason to choose DataFlash ! |
CI started |
Test run: FAILEDSummary: 2 of 11 test jobs failed Failed test jobs:
|
Are those CI issues related to this PR? |
I don't think so. CI job restarted |
@chrissnow can you rebase this PR? I am seeing unrelated error in the dynamic memory usage (new to me), I would restart testing |
aa93f0f
to
b09c007
Compare
b09c007
to
157debf
Compare
@0xc0170 rebased, made a bit of a mess with git but should be ok now. |
CI restarted |
Internal CI fault, restarted |
It again failed to checkout the branch, I restarted |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
@chrissnow Can you add release notes for this functionality change? (section in your first comment here). |
@0xc0170 Release notes added, Is this roughly the sort of thing you were after? |
Thanks , yes |
Description
DataFlash supports page erases, this means that FATFS can use smaller sector sizes and therefore less memory for buffers since read-modify-write can be done in smaller chunks (there are 8 pages to a block)
It would be possible to optimise erases by erasing blocks or sectors where possible but this is not implemented.
This also means that when using non binary pages sizes that you do not exceed FF_MAX_SS of 4096 with 4224 on 16 and 32Mb devices. (DataFlash actually has 264b/528b per page)
Pull request type
Release Notes
Previously the DataFlash driver exposed the minimum erase size as blocks which are typically 4K, DataFlash however supports page erases as small as 256B.
This change implements page erases which will lower RAM requirements for buffers.
Since this has no relation to any file system and lowers the minimum erase size it should not cause issues with devices with existing data stored on them, however a format of FatFs in future may end up with smaller sectors by default, which will further reduce RAM requirements.