Question
Building a DMA driven serial handler: How can I drain FIFO
Posted on July 16, 2014 at 10:45
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? #usart-dma-fifo #dma-stm32f217-usart