SDMMC_FLAG_SDIOIT flag not set - SDIO DMA on STMH7B0
I have adhered to the an5200-getting-started-with-stm32h7-series-sdmmc-host-controller-stmicroelectronics.pdf document and have had a good deal of success implementing CMD53 and CMD52 comms with a slave device but there seems to be a problem
The slave device sets an interrupt (request) on DATA Pin 1 which I need to respond to.
I have enabled SDIOIT interrupts and cleared the flags upon initialization of the SDIO.
hsd1 being a pointer (my app requires it to be added on the heap) and SDMMC1 is the Instance.
__HAL_SD_ENABLE_IT(hsd1, SDMMC_IT_SDIOIT);
__HAL_SD_CLEAR_FLAG(hsd1, SDMMC_FLAG_SDIOIT);
I can detect the the pin being set low through polling after/before data has been sent /received using DMA.
Therefore the slave device is behaving as expected but the SDIOIT flag on the STMH7B0 is never set.
I wish to respond to it being set in the ISR and don't wish to poll the pin
void SDMMC1_IRQHandler(void) {
if (__HAL_SD_GET_FLAG(hsd1, SDMMC_FLAG_SDIOIT)) {
... do something
}
Should be simple right?
But the flag is never set.
I sense that this is due DMA transfers doing something behind the scenes - clearing and/or disabling the SDIOIT interrupt. (Either in hardware or in the HAL library).
In addition quoting from STM32MP1-Peripheral-SDMMC_interface_SDMMC.pdf
"The interrupt concept is used to inform the host of changes in the card status using the SDMMC_D1/IRQ pin in 1-bit or in 4-bit data bus mode. SDIO interrupts are sent from the card to the SDMMC host when the card detects an external event. Interrupts are only sent outside the data transfer periods. The SDMMC host detects interrupts sent on the SDMMC_D1 pin once the SDIOEN configuration bit in the data control register is enabled. While the DPSM remains in Idle state and in Busy state between data blocks for DS, HS, SDR12 and SDR25 speed or after the last data block in all speed modes, all low levels on the SDMMC_D1 pin are detected as interrupts from the card to the host."
Maybe someone could explain to me why the flag isn't happening...
