cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7A3 - problems with SDcard

PMath.4
Senior III

I'm trying to use a SDcard on a STM32H7A3ZI and hitting a roadblock. Everything in the initialisation wotks until the SD_SendSDStatus function in stm32h7xx_hal_sd.c. This fails as it never sees __HAL_SD_GET_FLAG(hsd, SDMMC_FLAG_RXFIFOHF) and always times out with SDMMC_FLAG_DTIMEOUT.

I've tried this using the code generated by STM32CubeIDE and also the example program for the STM32H7B23-discovery board and the result is exactly the same in both cases. This happens before the driver switches to 4bit parallel mode and while it is running with the slow clock.

Many SDMMC commands have suceeded correctly by this point and the card details have been read apparently successfully. The card and socket have been tested using an F4

All ideas appreciated.

4 REPLIES 4
Jcout.1
Associate II

Hi!

Same problem on my side. Did you find a solution?

I am working on STM32H755

PMath.4
Senior III

The problem was electrical. Make sure there is no pullup on the clock signal. Use 47K pullups on the data and cmd lines. 10K is too strong.

Should be viable. Wouldn't rely on CubeMX, port over known working HAL example​

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

Many thanks for your answers. Since the problem should come from electrical point of point, I have made some verifications about the board.

I use a Nucleo H755 for my tests and the pin PC8 is not linked between the MCU and the test point…..(maybe due to a problem of my board ?). For sure, I would never receive anything from this pin.

I have changed to SDMMC2 ans now it works!