Hi Min Xu,
On Fri, Aug 09, 2013 at 10:54:28AM -1000, Min Xu wrote:
Thanks for getting back to me. After analyzing the
issue, I believe the
issue is the overrun error the USART reports. The issue appear to stem
from the fact that each byte received by the USART is handled in the
interrupt handler, but the USB sending code locks out the interrupt for the
entirety of its call.
Thanks again for analyzing the problem. I was pondering to apply your
patch, but think a different approach might be better: Use the USART
DMA mode. Thiss way we don't get one interrupt per character, but one
interrupt every 'dma buffer size' characters. Using double buffering we
should be able to always process one particular dma buffer, while the
other buffer is being filled by the hardware without interrupts.
Processing of the DMA buffer could happen either in an interrupt handler
of the PDC (dma controller) or even in the main loop.
Unfortunately the SAM7S USB controller does not support DMA, so it is
impossible to improve on that side.
I will give this some more thought. If I'm unable to implement this
within short time, I might merge your patch anyway as a interim fix.
Regards,
Harald
--
- Harald Welte <laforge(a)gnumonks.org>
http://laforge.gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
(ETSI EN 300 175-7 Ch. A6)