-
Notifications
You must be signed in to change notification settings - Fork 4
Description
@marcuschangarm I thought I would switch to you driver rather than mine and noticed a few issues, not all are directly related to your driver though.
You are using block erase rather than page erase, is the improvement in erase time worth the overhead of a larger read modify write? I'm thinking that with mbed people will be storing small files or making small changes to files?, fatfs will also need a 8x larger buffer which wont be good on smaller targets.
This also means that 16mbit and above in 528b the sector size for fatfs is greater than 4096 which is the largest that is supported.
Another odd problem is that if you use 512\528 with a 16mbit device and try and format without specifying the AU it fails.
https://github.com/ARMmbed/mbed-os/blob/20d93bf78d5172b6a0f1c1065058d641e4e0f2e1/features/filesystem/fat/ChaN/ff.cpp#L4172-L4174
results in FAT16 as the result since nclst = 0x1000
yet this then fails here as there is not enough sectors for FAT16
https://github.com/ARMmbed/mbed-os/blob/20d93bf78d5172b6a0f1c1065058d641e4e0f2e1/features/filesystem/fat/ChaN/ff.cpp#L4204-L4207
and returns
FR_MKFS_ABORTED
if you format with an AU of 2
FATFileSystem::format(&flash,2)
It will succeed with FAT12
Also with the default SPI speed of 40M the lowest bit is missed on the LPC1768 resulting in a shift right on all SPI reads. 8M works fine though. (I didn't try higher).
cc @geky