2025-07-11 6:19 AM
Hi Team,
I'm currently transitioning from using UART interrupt with timeout to DMA-based reception on an STM32G4 controller. I’d like to implement a similar behavior where I can detect the end of a UART message using idle line detection while receiving data via DMA.
Is there a recommended way to combine DMA reception with UART idle timeout on STM32G4? Specifically:
Are there any best practices or example configurations for this setup?
2025-07-11 10:04 AM
Use HAL_UARTEx_ReceiveToIdle_DMA to receive into a circular buffer.
Process data in the HAL_UARTEx_RxEventCallback call back on the HT, TC and IDLE flags.
Here is an example which does exactly this: