cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H753 SDMMC in SDIO mode producing repeated DATEND interrupt without new request

ChrisK1
Associate II

Hi I'm debugging the mentioned issue since quite a while.
We use CubeMX to generate the configuration and working with the provided HAL libraries to access a 4GB SD-Card connected through the SDMMC adaptor over 4-bit SDIO bus.

HAL libraries version is H7_V1.9.0 (for know we are stucked here, using a fixed tool chain).

SD-Card and FAT-FS init is OK.
In our application we are copying files from USB-Memory-Stick to the SD-Card, which works fine.
The mentioned problem seems to occure only when reading large portions from the card, while writing to the card doesn't produce the issue.

We are using FreeRTOS and wrote a FAT-FS interface with a mutex to make the FAT-FS access thread safe. Since the function BSP_SD_ReadBlocks_DMA() used by sd_diskio.c :: SD_read() is blocking in a while-loop (staying in the FreeRTOS context), I configured the SDMMC global interrupt to have higher priority than any FreeRTOS task (configured to 3, FreeRTOS max. is 5). But this didn't help out.

I printed out the SDMMC registers 'STAR' and 'MASK' on every entry and exit of the ISR and saw, that the DATEND  status bit (bit 8) and the according MASK bits to enable the interrupt where set again without a new request from the BSP_SD_ReadBlocks_DMA() function which also prints out on its call.

Here is a part of the printout, where this happens (the issue is marked in magenta):

01> SD_IO: Start DMA rx of sect 138443 to buff 240220CC, tick: 912113
01> SD_IRQ: Irq start STAR: 100, MASK: 12A
01> SDBSP: Rx complete, tick: 912113
01> SD_IRQ: Irq end STAR: 0, MASK: 0
01> SD_IO: Start DMA rx of sect 138443 to buff 24021FD4, tick: 912113
01> SD_IRQ: Irq start STAR: 100, MASK: 12A
01> SDBSP: Rx complete, tick: 912114
01> SD_IRQ: Irq end STAR: 0, MASK: 0
01> SD_IRQ: Irq start STAR: 100, MASK: 12A
01> SDBSP: Rx complete, tick: 912115
01> SD_IRQ: Irq end STAR: 0, MASK: 0
01> SD_IO: Start DMA rx of sect 11585 to buff 240009F0, tick: 912115
01> SD_IRQ: Irq start STAR: 100, MASK: 12A
01> SDBSP: Rx complete, tick: 912115
01> SD_IRQ: Irq end STAR: 0, MASK: 0
01> SD_IO: Start DMA rx of sect 11586 to buff 240009F0, tick: 912116

Has somone any hint, what I'm missing here?

Thanks a lot!

0 REPLIES 0