2017-10-03 08:53 AM
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 ...
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.
(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
2017-10-03 09:10 AM
Hello
Frohlich.Mat
,Please check your hardware configuration referring to the related
and the 'Getting started with STM32F7 Series MCU hardware development'.Kind Regards,
Imen.
2017-10-04 07:42 AM
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.
Edit : The clock signal is also affected by the ''capacitive effect'' only when the host and slave try to communicate :
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
2017-10-05 07:33 AM
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
2017-11-24 07:34 AM
@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.
2017-12-29 03:25 AM
I am also getting the same issue, any solutions?
2018-07-09 04:37 AM
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
2018-07-09 08:50 AM
>>Any one find-out the Solution
I have working SDIO/SDMMC on F7 platforms.
2023-07-21 11:32 AM
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
2024-10-10 01:09 AM
I have the same issue with a STM32F411...
Do we have any clue on what is happening ?
Vincent