Question
SDMMC with Internal (I)DMA + FATFS with DMA Template - not working! [STM32H7]
Hi, everyone!
I have a custom board with an STM32H7. I configured SDMMC2 correctly on it.
As you can see there is no options for configuring DMA since it has an Internal (I)DMA.
I have also added FATFS, as follows.
I managed to write/ready successfully to SD CARD mounted via FATFS. My problem arises when I enable the ‘Use DMA Template’. It is a must in order to later add FreeRTOS to the project.
After hours of debugging I realized that:
- f_write() calls disk_write(), which calls sd_write(), which calls BSP_SD_WriteBlocks_DMA(), which calls HAL_SD_WriteBlocks_DMA(), and does not return any errors.
- In sd_write(), WriteStatus desn’t get set to 1 [in sd_diskio.c] and times out.
- HAL_SD_IRQHandler() gets called but it subsequently never calls HAL_SD_TxCpltCallBack() (which should eventually via many wrappers set WriteStatus to 1), and completely skips it.
- I get HAL_SD_ERROR_TX_UNDERRUN.
Any help is highly appreciate it :folded_hands: .
