2018-10-04 06:14 AM
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?
2018-10-04 10:13 AM
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