cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L4R7ZI SDMMC clock polarity wrong?

Johannes
Senior

Hello

I have tried to run a microSD on STM32L4R7ZI and run code from CubeMX 4.26.1 to access the microSD card.

According to SDCard Physical Layer spec the card clock should have a rising edge to signal a valid bit clocked into the card.

0690X000006CAlmQAG.png

But STM32L4 generates a falling edge. This is an image of the card clock and command line just at the beginning of "CMD0" "010000..."

0690X000006CAlrQAG.png

The frequency is correct at 400KHz, but the polarity seems to be wrong .

Is this true? I am wondering, If I am the first one, experiencing that...

Johannes

4 REPLIES 4

Read out and check content of SDMMC registers, especially SDMMC_CLKCR.

Do you use any transceiver/level conversion?

JW

Perhaps we can also bump up the scale here so we can see if the data is valid 5ns before the clock edge

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

I have not used any level translation nor a transceiver

0690X000006CGy7QAG.png

I needed to add U704 (inverter) to the schematic. Only in this configuration, I was able to get the SDCard running. Now it runns perfectly. There was a slight error in the code generation of CubeMX. It generated a faulty callback function. But after having this corrected, the SDCard works properly.

Can't say I've had an issue with the L4Rx DISCO or NUCLEO SDMMC but haven't hung a logic analyser on them either.​

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