Showing results for 
Search instead for 
Did you mean: 

SDIO + DMA with micro SD card freezes at f_mount



I have a Nucleo-L476RG development board that I am evaluating for my applications. I am trying to test SDIO + DMA interface with a 32 GB Class 4 HC micro SD card. I have followed the tutorial at to setup the code. I have checked and verified that I have connected all the wire correctly between my Nucleo-L476RG board and the sd card adapter See the attached code with this issue. The code can detect the card because in line 24 of fatfs_platform.c my sd detect pin is read high. However, while mounting the sd card using f_mount(&SDFatFS, SDPath, 1) the code enters the while loop in line 3961 of stm32l4xx_hal_sd.c file and stays in the loop hence freezing my f_mountMy hsd->Instance->STA has a value of 0x200, what state does that value correspond to? Looking for some suggestions on how to proceed

Senior II

The fact that the code gets stuck in the while loop in the stm32l4xx_hal_sd.c file suggests that there might be an issue with the SDIO communication or initialization.

The value 0x200 in hsd->Instance->STA corresponds to the SDIO status indicating the SDIO static flags. In particular, it indicates that the SDIO hardware detected a start bit during the data transfer.


SD not working = normal (at first). 🙂

read in forum about sd-card problems...


If you feel a post has answered your question, please click "Accept as Solution".

Yeah I found that solution and implemented that. Now the error is that HAL_SD_RxCpltCallback() is not getting triggered.