2022-03-31 06:04 AM
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
2022-03-31 06:39 AM
You can use HAL_UARTEx_ReceiveToIdle_DMA which will return when the bus becomes idle and/or the buffer becomes half- or full-complete.