Skip to main content
Associate III
September 6, 2024
Question

uart delay

  • September 6, 2024
  • 1 reply
  • 622 views

 

Hello

Do I need delay when I use HAL_UART_Transmit multiple times?

How much do I need if I need it?

Thank you.

1 reply

TDK
Super User
September 6, 2024

HAL_UART_Transmit is blocking, which means it will not return until the transmission is done. There is no need to wait between calls.

HAL_UART_Transmit_IT and HAL_UART_Transmit_DMA happen asynchronously. You will need to wait for the transmission to complete and the state to return to ready before calling them again. Calling them too soon will result in them returning HAL_BUSY.

"If you feel a post has answered your question, please click ""Accept as Solution""."