cancel
Showing results for 
Search instead for 
Did you mean: 

NUCLEO-L476RG SDMMC problem

MSzab.2
Associate

Hi everyone,

I am starting using the STM32 to store data on MicroSD card over the SDMMC port. My board is a NUCLEO-L476RG. CubeIDE version is 1.6.1 and CubeMX is 6.2.1.

My MicroSD card is a basic 2GB model, it works perfectly well when connected through card reader to a PC.

I was going by this YouTube tutorial: https://www.youtube.com/watch?v=I9KDN1o6924

Configured it the same way, didn't work. Looked at this forum, added DMA, interrupts and internal pull-ups, lowering the clock, still nothing.

It fall into Error Handler() when it tries to format the card. If I disable the formatting and go straight to creating a file, again, it falls into the Error Handler().

Here are the SDMMC settings:

0693W00000AMQtzQAH.png0693W00000AMQsyQAH.png0693W00000AMQtkQAH.png0693W00000AMQtVQAX.png 

Here are the FATFS settings:

0693W00000AMQtBQAX.png0693W00000AMQuJQAX.png0693W00000AMQuEQAX.png 

Here is the detection pin and clock settings:

0693W00000AMQtlQAH.png0693W00000AMQuTQAX.png 

And here is the piece of the code. I use simple variable to tell me, where the routine fell into the error handler.

0693W00000AMQuYQAX.png

1 REPLY 1
andrelongo85
Associate II

Hi There,

I had the same issue. Did you managed to solve it?

Cheers,

Andrea