public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Grant Edwards <grante@visi.com>
To: ecos-discuss@sources.redhat.com
Subject: [ECOS]  Re: Uart missing chars when in Release
Date: Sun, 27 Jan 2008 09:54:00 -0000	[thread overview]
Message-ID: <fnhkbe$1b0$1@ger.gmane.org> (raw)
In-Reply-To: <OBEELMDOHGDFDEMJCJCJAENOMIAA.laurie.gellatly@netic.com>

On 2008-01-27, Laurie Gellatly <laurie.gellatly@netic.com> wrote:

> The missing chars are on the wire - I've snooped them.

So the receiver is at fault.

>> I'm not familiar with your platform, but on many platforms
>> running from flash can be much, much slower than running from
>> RAM -- in some cases up to maybe 8-10X slower, but 4X slower
>> is more typical.  Flash often has much slower access times
>> that RAM and is often narrower than RAM.  2X bus cycles with
>> 4X access time can add up pretty fast.
>
> The same platform also runs an Ethernet interface without
> problems. 10Mbit is quite a bit faster than 115K baud so I
> feel I can probably discount that.

At 117Kbps with no fifo, you have to service a receive
interrupt at a 11.7KHz or you lose bytes.  That means you've
got to have an interrupt latency less than 85us.

The Ethernet interface only produces an interrupt once per
frame. I'd be surprised if you're transferring more than a
hundred frames per second. The Ethernet interface probabably
also has a buffer queue.  That means that the Ethernet
interface can tolerate an interrupt latency 10-20X larger than
the serial interface can tolerate.  The Ethernet service
routine also probably produces a pretty long interrupt latency
while its DSR is running.  (It's probably the DSR latency that
matters rather than the ISR latency.)

Does it stop dropping bytes at lower baud rates?

Does it stop dropping bytes if there is no Ethernet traffic?

Running from flash is almost certainly slower, and I'd wager
that it increases the interrupt latency beyond what can be
tolerated by the serial interface's interrupt frequency.

>> Are you seeing rx overrun errors?  If the rx end is running
>> too slowly for the data rate, you would see rx overrun errors.
>
> From what I've read, the OE gets cleared on each read of RBR.
> How can I check on this? Is there a counter of OE and other
> errors kept in eCos that I can access?

You've got the source code, you tell me.  -- I don't know what
low-level driver you're using. If it doesn't have an OE
counter, you can add one: it's only a couple lines of code.

You could also add a line of code to the serial driver's DSR
that toggles a spare port pin.  Then watch that pin while it's
receiving data.  That should give a pretty good idea if
interrupt latency is the problem. 

-- 
Grant



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

  reply	other threads:[~2008-01-27  9:54 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-25  4:16 [ECOS] Re: Half Duplex RS485 wangcui
2008-01-26 20:41 ` Laurie Gellatly
2008-01-28 10:34   ` wangcui
2008-01-27  4:52 ` [ECOS] Uart missing chars when in Release Laurie Gellatly
2008-01-27  5:14   ` [ECOS] " Grant Edwards
2008-01-27  6:46     ` Laurie Gellatly
2008-01-27  9:54       ` Grant Edwards [this message]
2008-01-27 11:20         ` Laurie Gellatly
2008-01-27 15:55           ` Grant Edwards
2008-01-28  0:11             ` Laurie Gellatly
2008-01-28  2:37               ` Grant Edwards
2008-01-28  5:53                 ` Laurie Gellatly
2008-01-28 15:58                   ` Grant Edwards
2008-01-28 20:40                     ` Grant Edwards
2008-01-29 23:35                       ` Byron Jacquot
2008-02-06  9:35                       ` Laurie Gellatly
2008-02-06 15:25                         ` Grant Edwards

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='fnhkbe$1b0$1@ger.gmane.org' \
    --to=grante@visi.com \
    --cc=ecos-discuss@sources.redhat.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).