cancel
Showing results for 
Search instead for 
Did you mean: 

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

AAugu.2
Associate II

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

1 REPLY 1
TDK
Guru

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".