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

uSDHC support #119

Open
AstraLuma opened this issue Jul 10, 2022 · 4 comments
Open

uSDHC support #119

AstraLuma opened this issue Jul 10, 2022 · 4 comments

Comments

@AstraLuma
Copy link

I'm not seeing code for the uSDHC/SDIO peripheral found in the RT1062.

Add this please?

@AstraLuma
Copy link
Author

I might end up doing this myself, but I'm pretty new to both rust and rust embedded, and I've got other stuff going on right now.

@mciantyre
Copy link
Member

mciantyre commented Jul 11, 2022

Happy to help answer any questions here.

Related:

@mciantyre
Copy link
Member

Cherry-picking ideas from a downstream issue.

If you're interested in FAT file systems, take a look into embedded-sdmmc. Maybe there's a way to implement the BlockDevice trait for the uSDHC peripheral.

Also note that embedded-sdmmc already has some kind of SPI support. Here's the BlockSpi adapter, which provides a default BlocKDevice implementation. That might already play well with imxrt-hal's SPI drivers, so the "SD over SPI" problem might already be solved.

@ameliamariecollins
Copy link

ameliamariecollins commented Mar 15, 2023

I'm not sure if this is common knowledge, but I stumbled across a recipe to "misuse" the pins of the onboard SD card to allow use of simple 3-wire SPI:

Pin 44 (CLK) → SCK
Pin 45 (CMD) → PICO (SDO from the controller's point of view)
Pin 43 (DAT0) → POCI (SDI from the controller's point of view)
Pin 46 (DAT3) → CS

This worked somehow. In fact it worked at 25MHz over jumpers in a breadboard. Or perhaps not — it might have been honoring the choice of pin functions, but bit-banging the SPI signals. After all, it doesn't even line up with LPSPI1's ALTs. (I was running CircuitPython on the Teensy4.1 at the time.)

We shall do better, of course. But there was no QSPI support at the time and I really, really wanted to get at that card.

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

No branches or pull requests

3 participants