DataFlash: Change erase size to pages to reduce memory usage. #10478
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
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.
changed the title
Change DataFlash erase size to pages to reduce memory usage.
Apr 25, 2019
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 !