EmbeddedRelated.com
Forums
Memfault Beyond the Launch

STM32F4 DMA question

Started by Tim Wescott September 10, 2013
On 09/13/13 21:10, Tim Wescott wrote:

> > I'm not even sure that the serial port is double-buffered -- I know that > I figured out how to get just one byte at a time out via DMA, and my > problems disappeared. >
I didn't mean to be critical, just didn't understand what the problem was. A lot of uarts aren't multi buffered, but they all at least have a holding register for the previously received byte, while the next byte is being loaded by the input shift register. This means you have at least a byte's time to receive the interrupt and process it. Even at 100K bits/second, assuming async, 8,N,1 you have 100uS to process the interrupt and do the houskeeping, ie: modify bits in the uart control register, whatever. On the Cortex M3, for example, interrupt latency, 72MHZ clock, is < 200nS worst case, so it's unlikely to affect anything for serial comms. Instruction cycle times are down on the 10's of nS range as well, so interrupt driven serial comms should be a breeze without having to resort to dma transfer, which just complicates everything, The problems might have disappeared, but it wouldn't be enough for me not to understand why. Hence the question :-)... Chris
On Fri, 13 Sep 2013 21:46:49 +0000, chris wrote:

> On 09/13/13 21:10, Tim Wescott wrote: > > >> I'm not even sure that the serial port is double-buffered -- I know >> that I figured out how to get just one byte at a time out via DMA, and >> my problems disappeared. >> >> > I didn't mean to be critical, just didn't understand what the problem > was.
You have my permission to be critical -- I shouldn't have that much interrupt latency.
> A lot of uarts aren't multi buffered, but they all at least have a > holding register for the previously received byte, while the next byte > is being loaded by the input shift register.
That's what I meant by double-buffered, and this one is. So I really have no excuse for the interrupt response time. Dang. Now I wonder what was going on... -- Tim Wescott Wescott Design Services http://www.wescottdesign.com

Memfault Beyond the Launch