[En-Nut-Discussion] Possible BUG in ARM usart driver or crt routines

Harald Kipp harald.kipp at egnite.de
Fri Sep 4 11:11:13 CEST 2009


Coleman Brumley wrote:

> There are some issues with the AT91 USART error handling in that he error
> flag doesn't get cleared correctly.  
> 
> I documented this, and a potential fix some time ago at
> http://coleman.jandasoft.biz/?p=8

Many thanks, Coleman.

Indeed the flags never get cleared, neither in the hardware register nor
in the global shadow variable.

As the AT91 channel status register keeps the errors until explicitly
cleared by RSTSTA, we may be able to remove the register read from the
interrupt routine to decrease the system's interrupt latency. We simply
need to keep track of the ring buffer overflow.

My first attempt was to remove the shadow variable and skip reading the
character from the receiver holding register, if the ring buffer is
full. The next incoming character would automatically set the OVRE flag
in the channel status register. Unfortunately this conflicts with
XON/XOFF handshake. Thus, we still need the global variable to flag
buffer overruns. :-(

Harald




More information about the En-Nut-Discussion mailing list