2025-12-05 4:35 AM
Hi, everyone
I recently encountered a strange phenomenon. I opened three DMA channels on the STM32G474RBT6.
The first one is Channel 1 of DMA1 (circular mode), which is used for automatically collecting the data converted by ADC.
The second one is channel 8 of DMA2 (normal mode), which is used to transfer the calculated data to the timer for updating the PWM.
The third one is Channel 1 of DMA2, which (normal mode) is used to send serial port data of variable length. The first two did not enable the interrupt service function.
But if the DMA in the third case does not enable the interrupt, the serial port sending process will be stuck (the HAL library shows that the DMA2channel1 is in the “BUSY" state). If the interrupt is enabled, this situation will not occur.
However, the interrupt service of the first two I didn't enable DMA can still run normally. The data of the ADC can be automatically transmitted, and the timer can also send out the correct PWM signal. The priority of DMA has already been allocated and there should be no conflict issue. How did this situation occur?
2025-12-05 5:51 AM
Show your code.
DMA will generally need interrupts enabled to progress away from the BUSY state. There are examples for DMA-based UART you can follow.