AnsweredAssumed Answered

Building a DMA driven serial handler: How can I drain FIFO

Question asked by wieser.anthony on Jul 16, 2014
Latest reply on Aug 6, 2014 by UV
I'm trying to understand how to build a buffered serial handler using DMA.
I currently have an interrupt driven handler, that adds characters received to a circular buffer, but due to the lack of a FIFO on the USARTs, I'm occasionally getting overruns when I can't service the interrupt.

As a result, I'd like to build a DMA based implementation instead.

I've seen the USART/DMA sample code, and am pretty confident I could build a solution using double buffering, but what I don't understand is how I can drain the FIFO when the line goes idle, for instance if I get a single byte, and then nothing more.

Any pointers to documentation for that?