Skip to main content
TKTKTK
Visitor II
September 12, 2022
Solved

I want to detect a timeout after execution of HAL_UART_Receive_IT and execute the transmission, is there a good way to do this? (I am translating Japanese to English with deepl)

  • September 12, 2022
  • 1 reply
  • 1143 views

..

This topic has been closed for replies.
Best answer by KDJEM.1

Hi @豊和 金�?​ welcome to the Community :),

When you used the Hal UART with Interrupt mode, the callback functions are declared as weak functions in the driver, with no code to execute. This means that the user can declare the Tx / Rx callback again in the application and customize it to be informed in real-time about the process completion and to execute some application code. Contrary, when you used the Hal UART with polling mode, the data processing is handled internally in a loop. A timeout (expressed in ms) is used to prevent process hanging.

For more explanation, you can refer to this article.

Also, I advise you to take a look at this example.

When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

Kaouthar

1 reply

KDJEM.1
KDJEM.1Best answer
Technical Moderator
September 20, 2022

Hi @豊和 金�?​ welcome to the Community :),

When you used the Hal UART with Interrupt mode, the callback functions are declared as weak functions in the driver, with no code to execute. This means that the user can declare the Tx / Rx callback again in the application and customize it to be informed in real-time about the process completion and to execute some application code. Contrary, when you used the Hal UART with polling mode, the data processing is handled internally in a loop. A timeout (expressed in ms) is used to prevent process hanging.

For more explanation, you can refer to this article.

Also, I advise you to take a look at this example.

When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

Kaouthar

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.