cancel
Showing results for 
Search instead for 
Did you mean: 

stm32f7 SDIO not initializing

Mathieu Frohlich
Associate II
Posted on October 03, 2017 at 17:53

Hi,

I'm having trouble getting SDIO to work on a STM32F767 based project. I used the exemple provided in the CubeMX repo to try a dummy read/write, but the initialization process stall in the SD_PowerON() function.

After some debugging, i found out that I get random error messages :

SDMMC_ERROR_CMD_RSP_TIMEOUT

SDMMC_ERROR_COM_CRC_FAILED

SDMMC_ERROR_UNSUPPORTED_FEATURE

I tried dozens of clock configurations with no success, so I went on to inspect the CMD pin during initialization. Clearly there's a problem, but I have no idea what could be the reason.

Here is the whole frame from the start of the initialization process until it returns to the error. We can clearly see that the CMD function from the host is clean (at the beginning at least). But the SD Card as trouble bringing the line down when it answer. There is some sort of capacitive effect going on ...

0690X00000608ScQAI.png

And here I zoomed to the CMD55 frame, I saw a screenshot of it in another post and apparently the line should be brought low by the card immediatly after the end of the CMD, but I can see that it doesn't, not until after the first high state.

0690X00000608PdQAI.png

(Note that the yellow channel is totally unrelated, and I didn't probe the clock because I need another pair of hand, if it would be helpful I can try !).

It's only a guess but it looks like a hardware problem ... Could it be a bad positioning of the pull up resistor ? Or some sort of EMC problem ? Grounding ? Note that I have 3 prototypes of the board, I tried on every board and the problem is always the same.

If you need some code snippet I'll be happy to provide it !

Thanks a lot for your help !

Cheers,

Mathieu

9 REPLIES 9
Imen.D
ST Employee
Posted on October 03, 2017 at 18:10

Hello

Frohlich.Mat

,

Please check your hardware configuration referring to the related

http://www.st.com/content/ccc/resource/technical/document/datasheet/group3/c5/37/9c/1d/a6/09/4e/1a/DM00273119/files/DM00273pdf/jcr:content/translations/en.DM00273pdf

and the

http://www.st.com/content/ccc/resource/technical/document/application_note/b0/5c/ba/b2/cb/10/41/dd/DM001645pdf/files/DM001645pdf/jcr:content/translations/en.DM001645pdf

'Getting started with STM32F7 Series MCU hardware development'.

Kind Regards,

Imen.

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Posted on October 04, 2017 at 14:42

Hi Imen,

Thanks a lot for your quick reply !

I checked both the datasheet and the AN4661 before routing the PCB, actually this card is the third prototype of my project, which already contains 4 SPIs IC (one is running at full speed), USB FS and HS and several UART ... Everything else works perfectly fine.

The trace are all between 47mm and 56mm length so the skew should be very low, beside, the initialization code runs at 400kHz so it shouldn't be the cause of the problem, or am I wrong ?

Trace impedance is indeed incorrect, it's closer to 100Ohm than 50, could it be the cause ?

I saw that some people put a 27Ohm resistor in series with the data lines to improve signal integrity, should I try that ?

Here is a screenshot of the routing between the MCU and card holder, note that I ''cleaned'' it so that you can see properly the routes. In the actual designs there is a lot more components around it, but the lines are surrounded with a ground plane.

0690X00000608TPQAY.png

Edit : The clock signal is also affected by the ''capacitive effect'' only when the host and slave try to communicate :

0690X00000608QWQAY.png

Looks like the SD card can't ''flush'' to ground properly ?

I'll try all I can think of this afternoon, any other input are warmly welcomed !

Thanks,

Mathieu

Mathieu Frohlich
Associate II
Posted on October 05, 2017 at 16:33

Well ... I tried adding series resistor of different values, changing the pullup resistors, disconnecting someother components to see if there was some sort of interference ... Nothing works. I guess it's a capacitance problem, I'd love to be certain of it though before redesigning a new prototype, any advice still welcome !

Cheers,

Mathieu

Jesper Post
Associate
Posted on November 24, 2017 at 16:34

@Mathieu Frohlich, did you find a solution to this problem? I'm experiencing exactly the same issue on my STM32L496, also with code based on CubeMx.

Posted on December 29, 2017 at 11:25

I am also getting the same issue, any solutions?

Posted on July 09, 2018 at 13:37

Hello there

Any one find-out the Solution 

I'm facing the same problem here

at CMD55 I'm getting SDMMC_ERROR_COM_CRC_FAILED 

 error

Posted on July 09, 2018 at 15:50

>>Any one find-out the Solution 

I have working SDIO/SDMMC on F7 platforms.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
becbs
Associate

I am getting the same problem on STM32u575...

I am using this code with no RTOS and no ThreadX.
https://github.com/STMicroelectronics/STM32CubeU5/tree/main/Projects/STM32U575I-EV/Applications/FileX/Fx_File_Edit_Standalone




vbesson
Senior

I have the same issue with a STM32F411...

Do we have any clue on what is happening ? 

Vincent