2017-12-04 09:18 AM
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.
2017-12-04 09:45 AM
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.