This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: RedBoot gets() problems


On Sat, Mar 03, 2001 at 06:28:32AM -0700, Gary Thomas wrote:

> On 02-Mar-2001 Grant Edwards wrote:

> > That cost is already incurred.  If the gap between rx
> > characters is smaller than the time it takes to do a network
> > poll, then initial characters in a command can be lost.  If I
> > send a command line to the board at 57600 baud, I generally
> > loose 2-3 characters due to the fact that rx characters are
> > only processed between network polls.
> 
> This is probably not the problem.  The true problem was that
> the timeouts were not being handled properly if you have
> multiple serial channels and were scanning for a console to
> use.  In this case, the old code would have waited for 10/N ms
> (where N is the number of channels) on each channel before
> deciding that any characters have arrived.  If N is 2, then
> this is 5 ms.  At a baud rate of 57600, 5ms represents as many
> as 15 characters! Thus, a bunch of characters could arrive on
> one channel while the code was waiting for the other.

Ah.  I hadn't spotted that.

> This patch will make it better, by forcing each channel to
> timeout as fast as possible (sorry, but the granularity is only
> 1ms).

The current performace is actually fine for a human typing
commands to RedBoot -- it's only a problem when the stuff sent
to RedBoot is buffered and sent a line at a time.  I can get
GDB to connect to RedBoot via TCP but not via serial port, and
I suspect it's because characters are getting lost when GDB
initiates the connection.

One thing I'm a little fuzzy on is why not set the timeout to
zero?  If there's no character there, don't sit and wait, check
the next port (or the network) right away.  The only issue I
can think of is that the system time no longer gets updated if
nobody is doing any 1ms delays.  Adding a 100us delay in the
main-loop that updates the system time every 10th time could
alleviate that problem.

> I'm still thinking about how [limited] network processing can
> take place between characters.  However, I'm not convinced that
> RedBoot is the place to be doing such processing.  It would
> seem to me that if you need more processing and higher response
> rates, you should really have a real application running, using
> interrupts, etc. ... but that's probably a whole different
> discussion.

The throughput is plenty good enough for what little network
processing I want to do.  Except for the GDB issue I just
mentioned, my only problem is when RedBoot switches exclusively
to a console port due to a noise glitch and ignores the network
completely.

-- 
Grant Edwards
grante@visi.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]