public inbox for gentoo-embedded@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-embedded] High Speed Serial Problem
@ 2010-03-14 14:24 David Relson
  2010-03-14 16:34 ` Manuel Lauss
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: David Relson @ 2010-03-14 14:24 UTC (permalink / raw
  To: gentoo-embedded

G'day,

I'm porting a DOS application to Linux and have encountered problems
with the high speed serial devices from which the app receives data.

The hardware consists of a PC-104 board with a 486 compatible SOC
(system on a chip) providing 4 serial ports.  Ports 2 and 4 connect to
external devices that communicate at 115,200 baud.  The device sends a
42 byte record (containing a CRC), asserts a break to indicate end of
record, then does it again.  Every hour or so the app sends a message
to the device.  The message is sent immediately after the break is
recognized.

As an additional complication, the device connection is RS-485.  Being
half duplex, the code enables receive mode and transmit mode as needed.

The DOS app has an ISR to handle the communication.  Measured
throughput is approx 4,230 characters per second.  There is an error
rate of approx 2.5 errors per 1,000 records.

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.  

The Linux app receives approx 5,169 bytes per second and has an error
rate of 100 errors per 1,000 records.

Errors generally show up as dropped bytes.  Usually only 1 or 2 bytes.

The first (and most obvious) problem is that the Linux error rate is
40X higher rate than the DOS error rate.

 The second problem is that output from Linux isn't working.  After
 writing to the device, reading back doesn't show any change.  It's
 suspected that there's a timing issue, i.e. a timing window for
 receiving messages after the device sends a break.

I'm using a 2.6.29 kernel and the 486 SOC is running at 300mhz.
Processor speed is not believed to be the root because a newer 500mhz
version of the PC-104 board exhibits the same symptoms.

Any suggestions of what to do or where to look to solve the problems?

Thank you.

David



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-03-23  6:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox