[U-Boot] [PATCH v2] NS16550: buffer reads

Wolfgang Denk wd at denx.de
Mon Oct 24 23:59:36 CEST 2011


Dear Graeme Russ,

In message <4EA5CD39.2070203 at gmail.com> you wrote:
> 
> > Assume we have a simple device with a small Rx FIFO - say, 8 bytes
> > only. Guess what the chances are that we will overrun this FIFO (and
> > then lose characters) before the other side stops sending?
> 
> Should be zero (if you disable the hardware Tx buffer) unless you have an
> incredibly slow Rx routine (in which case, your baud rate is too high). And
> even with a Tx buffer in play the solution is fairly simple - After sending
> an XOFF, flush the Rx buffer (and remote Tx buffer) into an internal buffer
> until tstc() returns false - use this buffer for getc() until it is empty.

Things are becoming more and more complicated, it seems.

If you ask me: forget about all this, and stick with single line
input.  Do the processing on the sender's side (always wait for a
prompt before sending the next line).  This is MUCH easier.


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Never face facts; if you do, you'll never get up in the morning."
- Marlo Thomas


More information about the U-Boot mailing list