FIX: fix vcu118 sd card frequency #1685
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The Chisel code is using MHz as the frequency base unit, while the C code is using Hz, so we need to convert between these two units to get the correct SPI clock frequency to drive the SD card.
The SPI clock frequency is set to "High Speed" mode (25 MHz) [1] [2], which should be supported by all modern SD cards. If the clock is not working, user should try to decrease to normal mode (12.5 MHz) by changing the macro definition in
sd.c
:before:
#deifine SPI_CLK 25000
after:
#deifine SPI_CLK 12500
The High Speed clock is tested on the SanDisk Ultra 32G HC I SD card.
Reference
[1] https://www.cactus-tech.com/wp-content/uploads/2019/03/An-Introduction-To-SD-Card-Interface.pdf
[2] https://en.wikipedia.org/wiki/SD_card#:~:text=Supports%20a%20clock%20frequency%20of,could%20transfer%20104%20MB%2Fs.
Related PRs / Issues:
Type of change:
Impact:
Contributor Checklist:
main
as the base branch?changelog:<topic>
label?changelog:
label?.conda-lock.yml
file if you updated the conda requirements file?Please Backport
?