[ECOS] Serial buffer overrun

Jonathan Larmour jifl@eCosCentric.com
Fri Jan 17 23:27:00 GMT 2003


Shannon Holland wrote:
> 
> In general the delay between the ISR and DSR is around 5.5 microseconds.
 > However, sometimes it seems to bump out to around 15 or so microseconds.
 > I would imagine that 5.5 uS is more than fast enough - what about 15?
 > I'm only running the serial line at 19,200 baud so I would still expect
 > that to be fast enough. While these tests were running I didn't detect
 > any dropped bytes, so that would indicate that these latencies are more
 > than fine.

If you know what's causing the delay you can do things to prevent it. e.g. 
if it's timeslicing, you can simply turn that off (as long as you have 
some other way to switch between threads of equal priority!), or various 
detailed options in the kernel.

> Just as an added measure of security, I think I might modify the ISR so 
> it reads the current character. The DSR would then pick that up along 
> with any other bytes that are available (very similar to the current 
> implementation, just that the ISR would read the first byte).

Can still be overrun if another char comes in of course.

> I did try to switch the console to tty0 and it didn't appear to work (no 
> output on the console) by setting CYGDAT_LIBC_STDIO_DEFAULT_CONSOLE to 
> use tty0 (and enabled serial 0 along with setting tty0 to use 
> /dev/ser0). I'm sure I missed something stupid so I'll go back and look 
> at that later.

Have you enabled the serial driver for that serial port as well?

It occurred to me belatedly that if you're looking for the output in GDB 
you wouldn't see it - you'd have to connect direct to the serial port with 
a terminal program. Should have said that before :-|.

Jifl
-- 
eCosCentric       http://www.eCosCentric.com/       <info@eCosCentric.com>
--[ "You can complain because roses have thorns, or you ]--
--[  can rejoice because thorns have roses." -Lincoln   ]-- Opinions==mine


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss



More information about the Ecos-discuss mailing list