Odd RS232 problem
hk at alogis.com
Sat May 13 05:30:38 PDT 2006
On Sat, May 13, 2006 at 02:13:08PM +0930, Daniel O'Connor wrote:
> I am trying to talk to a high voltage power supply unit we're using at work,
> it uses RS232 and you can read back current, voltage, faults, etc..
> What I have seems to work fine except that occassionally I get junk read back,
> strangely it appears the longer my program runs the more often I see corrupt data.
I am not an expert, except that we added another card to our
old Server (Dialout) and upgraded from 4.x to 6.x and had
very interesting problems, too. The following seemed to help
First, make sure you have a dedicated IRQ for the card.
Then, add options PUC_FASTINTR to your kernel config.
If you encounter silo overflows, you might need to increase
cp4ticks in sio.c, eg
- cp4ticks = speed / 10 / hz * 4;
+ cp4ticks = speed / 10 / hz * 40;
and/or you might want to change hz from 1000 back to 100.
This is on old 500MHz-hardware which should be capable of
handling a few sios without problems (but generates about
15% irq-load on swi4: clock sio permanently under 6.x).
$ ps ax | grep swi
12 ?? WL 1:43.10 [swi1: net]
13 ?? WL 5109:23.82 [swi4: clock sio]
14 ?? WL 0:00.00 [swi3: vm]
16 ?? WL 0:18.64 [swi2: cambio]
17 ?? WL 0:00.00 [swi6: task queue]
18 ?? WL 0:00.00 [swi6: Giant taskq]
19 ?? WL 0:00.00 [swi5: +]
22 ?? WL 0:22.20 [swi0: sio]
> The serial card in it is..
> puc0: <Dolphin Peripherals 4036> port 0x9400-0x941f irq 18 at device 13.0 on pci0
> sio4: <Dolphin Peripherals 4036> on puc0
> sio4: type 16550A
> sio4: unable to activate interrupt in fast mode - using normal mode
> sio5: <Dolphin Peripherals 4036> on puc0
> sio5: type 16550A
> sio5: unable to activate interrupt in fast mode - using normal mode
> So, apart from the actual program code everything else is different :)
> (Hopefully my next test will reduce the variable space a lot..)
We still have some strange issues we did not have with the
old card only and FreeBSD 4.x, but at least it is working
again without data loss etc.
Have you looked at the port speed and if it is changing or
has different speeds on both ends? The card together with
the modems were really trying very hard to get the data to
the other side, and were very good at it, especially with
smaller chunks (necessary for dialing and authentication).
Problems then started with real traffic going over the line -
and we didn't get any errors in messages...
My impression is that serial io irq-handling on 6.x needs
some improvement (personal feeling: it is much worse then
Hope this helps.
More information about the freebsd-stable