2024-01-09 12:41 PM
Hi,
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 https://www.youtube.com/watch?v=I9KDN1o6924 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 https://www.amazon.com/gp/product/B09K6XVS9R/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1. 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_mount. My hsd->Instance->STA has a value of 0x200, what state does that value correspond to? Looking for some suggestions on how to proceed
2024-01-09 12:48 PM
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.
2024-01-09 01:20 PM
SD not working = normal (at first). :)
read in forum about sd-card problems...
ie
2024-01-09 07:52 PM
Yeah I found that solution and implemented that. Now the error is that HAL_SD_RxCpltCallback() is not getting triggered.