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

Fix SDIO hardware flow control errata #577

Merged
merged 3 commits into from
Feb 18, 2023
Merged

Conversation

chemicstry
Copy link
Contributor

Using SDIO above 12 MHz causes clock glitches, which result in CRC errors (at least in embassy-stm32). In this HAL, the CRC error is not caught and write silently fails without changing any bytes on SD card.

Section from STM32F42xx and STM32F43xx Errata sheet:

2.13.1 SDIO HW flow control

Description
When enabling the HW flow control by setting bit 14 of the SDIO_CLKCR register to ‘1’,
glitches can occur on the SDIOCLK output clock resulting in wrong data to be written into
the SD/MMC card or into the SDIO device. As a consequence, a CRC error will be reported
to the SD/SDIO MMC host interface (DCRCFAIL bit set to ‘1’ in SDIO_STA register).

Workaround
None.

Note: Do not use the HW flow control. Overrun errors (Rx mode) and FIFO underrun (Tx mode)
should be managed by the application software.

AFAIK, this affects all SDIOv1 peripherals including the F1 family, and possibly others.

I'm not sure about the CRC error not getting caught, but this PR at least fixes the chip errata.

It is broken and causes SDIO clock glitches resulting in CRC errors.
@burrbull
Copy link
Member

please, add errata link inside PR

src/sdio.rs Outdated Show resolved Hide resolved
@burrbull
Copy link
Member

Thanks
bors r+

@bors bors bot merged commit 4a06fc8 into stm32-rs:master Feb 18, 2023
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