public inbox for gentoo-embedded@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Relson, David" <david.relson@orion-sys.com>
To: <gentoo-embedded@lists.gentoo.org>
Subject: RE: [gentoo-embedded] High Speed Serial Problem
Date: Mon, 15 Mar 2010 13:47:14 -0400	[thread overview]
Message-ID: <91FA647A1A781F41BBB0359765C90C15F713C8@mailsvr.orion-sys.com> (raw)
In-Reply-To: <20100315133434.GA15613@xyzzy.org.uk>

Hello Bob,

VMIN and VTIME are the default values of 1 and 0, respectively.  If I
understand correctly, these settings will provide data as rapidly as
possible.

At present, I am using a 256 byte buffer for reading data.  I've added
some statistics gathering.  Every 1000 reads, the program logs the total
bytes read and the maximum read.  The program was run for 30 seconds to
provide 6 statistics records

With _no_ processing of data, 1000 reads got from 27,545 to 28,520
chars.  The max read was 128 chars.  3 of the 1000 read samples had max
reads of 56 or 57 and 3 had max reads of 110, 126, and 128.

With copying of data to a buffer (which involves several function calls,
incrementing counters, etc), 1000 reads got from 27,187 to 28,241 chars
and each of the 6 sample sets had a max read of 110 to 128 bytes.

One would expect processing to increase the total bytes received, but
this was not the case.

The code _is_ handling the 3 char break sequence and the (undocumented)
doubling (escaping) of 0xFF chars (to distinguish them from break
sequences).

Regards,
 
David
-----Original Message-----
From: Bob Dunlop [mailto:bob.dunlop@xyzzy.org.uk] 
Sent: Monday, March 15, 2010 9:35 AM
To: gentoo-embedded@lists.gentoo.org
Subject: Re: [gentoo-embedded] High Speed Serial Problem

Hi,

> The Linux app has a separate thread for each of the 2 serial ports.
> Data is received using select() and read().  Read is called with a 32
> byte buffer.  As neither BRKINT nor IGNBRK is set, the input thread
> recognizes 0xFF, 0x00, 0x00 sequences as breaks.  When the encoded
> break is recognized, any pending message is sent.  

There should be no problem handling 115K2 data at full speed on a 300MHz
processor although some SOC UARTs are realy gnarly.  Using line break as
a protocol signalling element is so 1970s but again shouldn't be a
problem.

What are your VMIN, VTIME settings ? They can have a big impact on read
performance/timing.  VMIN=VTIME=0 makes a mockery of using select for
example.

What size of return are you actually seeing from the read ?

If you are seeing reasonably full blocks, does you code handle the three
char break sequence spanning the read boundy ?  Sorry if this is
teaching grandma to suck eggs.

-- 
        Bob Dunlop




  reply	other threads:[~2010-03-15 18:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-14 14:24 [gentoo-embedded] High Speed Serial Problem David Relson
2010-03-14 16:34 ` Manuel Lauss
2010-03-14 17:14   ` David Relson
2010-03-14 17:51 ` Peter Stuge
2010-03-15  1:47 ` Peter Bell
2010-03-15 13:34 ` Bob Dunlop
2010-03-15 17:47   ` Relson, David [this message]
2010-03-20 19:02     ` [gentoo-embedded] SOLUTION (partial) was: " David Relson
2010-03-23  5:19       ` James Ausmus
2010-03-15 14:07 ` [gentoo-embedded] " wireless

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=91FA647A1A781F41BBB0359765C90C15F713C8@mailsvr.orion-sys.com \
    --to=david.relson@orion-sys.com \
    --cc=gentoo-embedded@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox