Skip to main content
Abhishek Kumar
Associate III
October 4, 2018
Question

Intentional receive complete UART DMA interrupt after specified timeout

  • October 4, 2018
  • 1 reply
  • 673 views

I have configured a UART to receive in DMA mode where the size of the buffer is around 64 bytes. So, basically the HAL_UART_RxCpltCallback() DMA receive complete interrupt will only fire when 64 chars are received.

Is there a way in STM32 through which I can configure a timeout for DMA Rx where when the buffer is only partially filled (i.e. less than 64 chars are received) and we don't receive anymore chars for a specified timeout, the DMA will then raise the same HAL_UART_RxCpltCallback() based interrupt to let the consumer consume whatever partial data is currently received on the UART?

This topic has been closed for replies.

1 reply

Tesla DeLorean
Guru
October 4, 2018

The HAL doesn't facilitate such a method directly, @Tilen MAJERLE​ had a thread once upon a time.

Personally, I have the USART DMA into a 16-bit wide circular FIFO, and mark the words so I can periodically harvest the data in a worker task

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..