-
Notifications
You must be signed in to change notification settings - Fork 2k
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
cpu/samd5x: add SD Host Controller implementation #17863
Conversation
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.
Awesome PR ! That's something I had on my todolist for ages...
I just gave it a quick look. I'll look more in details later.
tests/mtd_raw
works as expected.
I hope I can test it alongside with USB Mass storage at some point :)
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.
next round of review.
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.
Code looks good. Some comments inline. You may squash directly in the changes.
if (IS_USED(MODULE_ZTIMER_USEC)) { | ||
ztimer_sleep(ZTIMER_USEC, us); | ||
} else if (IS_USED(MODULE_ZTIMER_MSEC)) { | ||
ztimer_sleep(ZTIMER_MSEC, 1); | ||
} else { |
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 reminds me of #17330
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.
ACK. Code looks good and I trust your testing
Thank you for the review! |
Contribution description
This implements support for the SD/MMC host controller found on SAM D5x/E5x family chips.
It is based on the code from initmaker (and the accompanying blog post) with interrupt support instead of busy-waiting.
Testing procedure
Insert an SD card into the SD card slot of the
same54-xpro
tests/mtd_raw
should work:We have an internal benchmark tool that generates data records to and stores them on the SD card, there we see improvements compared to
sdcard_spi
:sdcard_spi
sam0_sdhc
Issues/PRs references