Skip to main content
AAugu.2
Visitor II
March 31, 2022
Question

can we trigger a Flag when the HAL_UART_Receive_DMA function no longer has any character for a long time

  • March 31, 2022
  • 1 reply
  • 645 views

I am coding on a stm32 a connection between UART1 and UART2. I would like UART1 to transmit the data rise by UART2 and vice versa (my stm32 will only be a gateway between a PC and an IOT), I do not know the size of the data that arrives on the two UART.

I can't use pull mode either because I risk losing data.

that's why I use DMA

i don't know how to stop reading my UART to be able to transfer my data to the second UART without wasting time

any idea ?

Thanks for your help

excuse me for my English i am not English speaking

This topic has been closed for replies.

1 reply

TDK
March 31, 2022

You can use HAL_UARTEx_ReceiveToIdle_DMA which will return when the bus becomes idle and/or the buffer becomes half- or full-complete.

"If you feel a post has answered your question, please click ""Accept as Solution""."