2016-02-28 11:08 PM
Hello,
I'm trying to modifiy my project to work with DMA on the SDIO interface. Without DMA the system works fine. Then I modified my Cube settings to DMA and set the access functions to Write_DMA and Read_DMA. Now the system starts up and after the 7th access to HAL_SD_CheckReadOperation() systems hangs on:while((__HAL_SD_SDIO_GET_FLAG(hsd, SDIO_FLAG_RXACT)) && (timeout > 0)){ timeout--; }Accesses are:- f_mount, find_volume, check_fs, move_window, SD_read, BSP_SD_ReadBlocks_DMA -> ok- f_mount, find_volume, check_fs, move_window, SD_read, BSP_SD_ReadBlocks_DMA -> ok- f_mount, find_volume, check_fs, move_window, SD_read, BSP_SD_ReadBlocks_DMA -> ok- f_open, folow_path, dir_find, move_window, SD_Read, BSP_SD_ReadBlocks_DMA -> ok- f_read, SD_Read, BSP_SD_ReadBlocks_DMA -> ok- f_read, get_fat, move_window, SD_Read, BSP_SD_ReadBlocks_DMA -> ok
- f_read, SD_Read, BSP_SD_ReadBlocks_DMA -> ok- f_read, SD_Read, BSP_SD_ReadBlocks_DMA -> failInterrupt is fired in according to the accesses.I searched all the forum around but has no clue. #dma #sdio #sd #fatfs #stm322016-10-25 05:12 AM
Hi,
I have the same problem. Did you find any solution?Regards,Andreea2016-10-26 07:25 PM
Hi,
I have experience that before, and it is caused by the interrupt priority.Try to make sure the DMA interrupts have the lower priority compared to your SDIO interrupt.Hope it helps :)2016-10-27 06:18 AM
Hello,
Please follow this answer from ST team in this [DEAD LINK /public/STe2ecommunities/mcu/Lists/STM32Java/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/STM32Java/STM32L4%20STM32Cube%204.14%20SDMMC%20FATFS%20DMA%20TX%20RX%20hang&FolderCTID=0x01200200770978C69A1141439FE559EB459D758000F9A0E3A95BA69146A17C2E80209ADC21¤tviews=173]thread. Then, confirm if your problem is resolved or not .''First of all, the SD specification don't allow simultaneous Tx transfer and RX transfert, they must be sequetially enabled.
So for the DMA used with SD, there is only one direction at a time and not both Tx and Rx. So we should reconfigure the DMA channel/stream before each DMA read or write on SD.
We note that it is not possible to use a DMA channel for each transfer , because once DMAEN bit is set, the channel that has the highest priority will be automatically selected.
''Regards