Skip to main content
Associate III
February 18, 2024
Solved

HAL_UARTEx_ReceiveToIdle_DMA() timeout

  • February 18, 2024
  • 2 replies
  • 1647 views

Hi folks,

I'm using HAL_UARTEx_ReceiveToIdle_DMA() on STM32L4. If I use minicom and type a few characters, HAL obviously detects an idle state after each single character I typed.

I'd like to configure a idle timeout value used in HAL_UARTEx_ReceiveToIdle_DMA(), so it would suite my use case.

Could someone point me to the right place such a fix?

 

Cheers

 

 

Best answer by TDK

The IDLE flag is a hardware feature and is not adjustable.

You can make code to process each character, record the timestamp, and set an interrupt to go off X milliseconds in the future if you don't see another character, or some similar code feature.

2 replies

TDK
TDKAnswer
Super User
February 18, 2024

The IDLE flag is a hardware feature and is not adjustable.

You can make code to process each character, record the timestamp, and set an interrupt to go off X milliseconds in the future if you don't see another character, or some similar code feature.

"If you feel a post has answered your question, please click ""Accept as Solution""."
TLin.5
Associate III
February 18, 2024

The IDLE interrupt is not configurable with a timeout. 
If you want something like that, I suggest tying the input line to an IO and timer trigger, but you'd have to write that on your own.

To clarify, the IDLE in question here is that of the receiving UART line.