AnsweredAssumed Answered

SDIO 4Bit Mode, FatFS, and STM32CubeMX on STM32F401 Discovery

Question asked by Rob on Jan 20, 2015
Latest reply on Mar 30, 2015 by Rob

I’ve been struggling to get SDIO 4 Bit mode working on my STM32F401 Discovery. I can get everything working fine in SDIO 1 Bit mode.

I’ve seen similar posts on this topic but they don’t seem to help much.

I’ve modified the STM32F401 Discovery with an SD Card holder wired to the proper pin breakouts. I’ve removed all components from the board that interfere with these signals.

I use STM32CubeMX 4.5 to generate the base code for my project. All I’m trying to do at the moment is open a text file and write a string to it. Again, this works in 1 Bit Mode, but not in 4 Bit.

I’ve tried using both a 400kHz and 24MHz SDIO_CK. Neither clock speed works in 4 Bit Mode. Both clock speeds work in 1 Bit Mode.

The code seems to fail when calling HAL_SD_SendSDStatus() in stm32f4xx_hal_sd.c. This function fails when called during SD_initialize() routine. HAL_SD_SendSDStatus() returns value SD_START_BIT_ERR

I’d be very grateful to anyone who can help me troubleshoot this issue.

Best regards,