[comp.sys.apollo] Problems using /lib/spe_pio_lib

don@bacchus.esa.oz.au (Don Isdale) (01/30/91)

I have a problem with the library /lib/spe_pio_lib,
which is supplied with the Serial-Parallel Expansion
board.

The problem is that the library seems not to be
accessible by programs which use spe_$pio functions.

I've added a line "lib spe_pio_lib" to /etc/sys.conf.

"llib -a" shows /lib/spe_pio_lib.

"las -a" shows /lib/spe_sio_lib and /lib/spe_sio_int_lib,
but not /lib/spe_pio_lib.

esa 'spe_$pio_init' and esa 'spe_$pio_cleanup' both
output "Symbol is known, but not loaded".

When I run /systest/spe/pio_test, with no loopback
connector, I get :
"?(SPE pio_test) Problem opening stream to pio line -
SPE controller or SW not installed (library/spe driver)
OS status: SPE controller or SW not installed (library/spe driver)"
If the loopback connector is in place for the test, pio_test
gets a segmentation fault in spe_$pio_loopback line 428,
from pio_test line 86.

Using bind and inlib have no effect, except that
an extra entry is added to the output of llib.

Thanks for your help,

Don Isdale

----
INTERNET: don@bacchus.esa.oz.au   UUCP: uunet!bacchus.esa.oz.au!don
Phone   : (+61) (3) 819 4554      Fax : 819 5580

don@bacchus.esa.oz.au (Don Isdale) (01/31/91)

I've made some progress since my last posting, which I'll summarise
because I seem to have narrowed in on one last problem :-),
which may be familiar to someone.

First, I want to contribute what I have learned about the SPE board,
because I'm sure other people must find it tricky to use.

The release notes state that above 4800bd, characters may be dropped
in the sio input.  I worked around this by having a separate input
process for each sio; the input process waits on input, reading 
blocks of characters instead of single characters (to reduce overhead).
Each input process pipes its output to the main process.
I used TIOCSTART when starting the input process, in case flow was blocked during
the previous run.
The main process sometimes read null characters from the pipe (lots
of fun when you null-terminate strings); I excised these and all worked
fine.

Occasionally the ddf of an sio becomes corrupted and emt can't
open the sio; this is solved by deleting the ddf (eg /dev/spe_sio1_ddf),
and remaking it with crddf.

Opening the SIO-s would often block because pin 8 was floating low;
opening with O_NDELAY solved this.

The problems I described with pio_test appear to have been fixed
by moving the SPE board adjacent to the other boards (I had installed
it in the half-slot at the far end of the bus).
As per the documentation, bind and inlib are not needed - dynamic
loading works fine.  This can be monitored by doing
"crddf /dev/pio -debug", which will cause loading information
to be displayed when the port is opened.


The problem is this:

My program, which uses the PIO to drive a character printer and
/systest/spe/pio_test now run, but characters are lost and the high bit
is always set.  pio_test sends an alphabetic sequence, and
it arrives on the printer output with every second or
third character missing.

My colleague, Matt, converted the example program
/domain_examples/spe_pio.pas to C;  two problems here:
firstly, the following causes a segmentation violation
at line 182 of spe_$pio_status().
	{
		status_$t			status;
		spe_$pio_status(&status);
	}
The other problem is that the the following doesn't work,
unless the ios_$write_opt is changed to ios_$no_open_options or ios_$no_read_opt,
which are useless because I want to output.
	st_id2 =
		ios_$open
		(
			"/dev/pio",
			strlen("/dev/pio"),
			ios_$write_opt,
			&status
		);
This returns a non-zero status, and error_$std_format() outputs :
"status E610D2A (DOMAIN Diagnostics)"


I am using version 2.1 of the SPE software, running under
10.2 on a DN3000.

Thanks for your help,

Don Isdale.

--
INTERNET: don@bacchus.esa.oz.au   UUCP: uunet!bacchus.esa.oz.au!don
Phone   : (+61) (3) 819 4554      Fax : 819 5580