cancel
Showing results for 
Search instead for 
Did you mean: 

Using SDMMC with STM32L476 in 1-bit mode

Fabian Frei
Associate II
Posted on November 15, 2017 at 19:42

Hi there,

I'm trying to get the SD 1-bit  interface working on my STM32L476. I generated the code with the STM32CudeMX.

So that's my problem:

The init function ''MX_SDMMC1_SD_Init'' [1] stucks in a loop. So, I used the debugger to find where exactly the error occurs. You can see the code snippets below. function[1] calls function[2] , function[2] calls function[3] and so on.

In function [4], the call of SDMMC_CmdAppOperCommand(..)  generates the error ''SDMMC_ERROR_CMD_CRC_FAIL''. 

Any suggestions on how to solve or debug this issue any further?I have a digital analyzer, but it does not support SD protocol. The D0 line stucks at 0 V. The sd card comes fat32 formatted. 

I'm new to this protocol and did not find any good documentation / application notes / getting started sheets. So, something like that would be very helpful too.

Thanks in advance!

SNIPPETS

function [1] 


_legacyfs_online_stmicro_images_0690X0000060N06QAE.png

_______________________________________________________________________

function [2]


_legacyfs_online_stmicro_images_0690X0000060N0BQAU.png

_______________________________________________________________________

function [3]


_legacyfs_online_stmicro_images_0690X0000060MyzQAE.png

_______________________________________________________________________

function [4]


_legacyfs_online_stmicro_images_0690X0000060MvMQAU.png

#sd-card #sd-cards #hal_error #stm32 #sd-card #sdmmc
5 REPLIES 5
con3
Senior
Posted on November 26, 2017 at 07:50

I have the exact same problem! Have you been able to find a solution?

Regards,

Piet
Posted on November 27, 2017 at 09:50

No. A solution of someone else would still be appreciated...

Regards, Fabian
Posted on November 27, 2017 at 12:24

Hi Fabian, I might be able to help get past this point. Currently my power_on passes and I can retrieve parameters from the sdcard but my f_mount,etc still fails. DO you have pull-up resistors on your lines to 3.3V?

Posted on November 27, 2017 at 13:23

Hi Piet, thanks for your hint. I tried it with and without pull-up resistors. Always with the same result. On which lines did you add them?

Posted on November 27, 2017 at 13:42

Hi Fabian,

I added them to each line, ensure there 10 k resistors and ensure you've set the gpio pins as pullup in code.

Hopefully we can get these SDcard working!