Question
STM32F407VG + 4 bit SDIO + DMA does not work probably
Posted on April 27, 2018 at 19:33
Hi,
I am using the STM32F407VG and try to read an SD Card over SDIO in 4 bit mode.
I have downloaded the fatfs driver from this site:
The initialization works absolutely fine until the second invocation of check_fs in line 3008 of ff.c 'fmt = bsect ? check_fs(fs, bsect) : 3; /* Check the partition */'(Note: The first invocation of check_fs in line 2998 'fmt = check_fs(fs, bsect);' returns the correct value (2))
Where it sticks after the check_fs invocation is in the interrupt of the DMA RX interrupt callback:
static void SD_DMA_RxCplt(DMA_HandleTypeDef *hdma)
{
SD_HandleTypeDef *hsd = (SD_HandleTypeDef*)((DMA_HandleTypeDef*)hdma)->Parent;
/* DMA transfer is complete */
hsd->DmaTransferCplt = 1U;
/* Wait until SD transfer is complete */
while(hsd->SdTransferCplt == 0U)
{
}
/* Disable the DMA channel */
HAL_DMA_Abort(hdma);
/* Transfer complete user callback */
HAL_SD_DMA_RxCpltCallback(hsd->hdmarx);
}�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?
line 9 ('while(hsd->SdTransferCplt == 0U)).
Any ideas what is going wrong?