cancel
Showing results for 
Search instead for 
Did you mean: 

UART IT

marcogrossi89
Associate II
Posted on December 04, 2017 at 18:18

I am using Nucleo F334 and STM32 Workbench as IDE.

I need to build a bridge between UART2 and UART3. It should work this way: data are continously acquired on USART3_RX by interrupt and transmitted on USART2_TX.

I am using the HAL library but I can not understand how to implement it since the library has the function:

HAL_UART_Receive_IT(&huart3, (uint8_t*)ch1, strlen(ch1));

but the number of bytes to acquire must be specified. 

I can not understand how to make it acquire indefinitely.

Thanks.

1 REPLY 1
Posted on December 04, 2017 at 18:45

Consider just using the registers and IRQ

strlen(ch1) for receive seems a odd choice, consider sizeof() as it's not sensitive to NUL characters.

For HAL you'd need to keep refiring HAL_UART_Receive_IT() with a one count in every callback, hugely inefficient, but that's the bed you're laying in.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..