Skip to main content
marcogrossi89
Associate III
December 4, 2017
Question

UART IT

  • December 4, 2017
  • 1 reply
  • 663 views
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.

    This topic has been closed for replies.

    1 reply

    Tesla DeLorean
    Guru
    December 4, 2017
    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 (See Profile) Up vote any posts that you find helpful, it shows what's working..