Skip to content
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

Add disk storage support (SD cards) #2584

Merged
merged 8 commits into from
Nov 15, 2022
Merged

Conversation

mikee47
Copy link
Contributor

@mikee47 mikee47 commented Nov 14, 2022

This PR extends the Storage system to support block-based devices such as SD cards.

Storage sizes have been changed from uint32_t to storage_size_t. Default operation is unchanged, but this allows 64-bit offsets to be used to support devices greater than about 4GB.

The existing SDCard library has been taken and reworked extensively with added GNU/Linux source code to handle MBR/GPT partitioning. The result is the DiskStorage base library, which is then used by the SdStorage library to provide specific SD card support, currently using SPI.

Optional buffering for block devices is included to support other filing systems. LittleFS appears to work but Spiffs doesn't - it requires erased sectors to be 0xFF which is fundamentally incompatible.

Finally, the FatIFS library has been added, using the current version of Chan's fatfs library. There are some minor modifications in the code to fix time handling and simplify use.

Testing for these libraries has been implemented by verifying generated filesystem images using standard GNU/Linux tools.

@slaff slaff added this to the 4.7.0 milestone Nov 15, 2022
@slaff slaff merged commit 71983c5 into SmingHub:develop Nov 15, 2022
@mikee47 mikee47 deleted the feature/fatifs branch November 15, 2022 20:14
@slaff slaff mentioned this pull request Dec 6, 2022
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants