Issue with SPI and SDIO using same DMA
Hello,
I'm working on an STM32F411 and I'm using two peripherals : one SPI and one SDIO.
The SPI is triggered every millisecond in a timer ISR and is using two DMA2 streams 0 and 2 in direct mode at a very high priority for TransmitReceive. Then, the DMA triggers an ISR at high priority at the end of transfer.
The SDIO is using DMA2 also but stream 3 with a FIFO at a medium priority and is triggered asynchronously in the main. Its DMA transfer triggers an ISR at low priority at the end.
Sometimes, the DMA of the SDIO is enabled and the timer ISR is triggered at this time which enables the SPI DMA even if the SDIO DMA is already working.
But it's not a problem (at least during a while) because the DMA arbiter should manage the priority and give it to the SPI DMA (according to the reference manual and AN4031) and the data are well written for both SPI and SDIO.
But after a while (a random timing like few hundred milliseconds) the SPI DMA ISR doesn't trigger anymore and the SPI appears to be always busy in Rx Tx mode.
This issue always occurs after a case when the SDIO DMA stream is already enabled and the SPI DMA transfer is launched by the timer ISR.
I don't understand the reason why it's working during a while and then it stops.
Do I miss something ?
Thank you for your answer
