Our custom SH4 based hardware (CE.NET 4.2 OS) has an ST16C554 quad UART
connected. We have this working correctly using the standard
COM16550.dll driver supplied by MS (we have done some minor changes to
the PDD code in com16550.c to get it to work with our hardware, but
nothing major).
I am now attempting to use the ISR16550.dll "high speed" serial driver,
but am not having much success.
I have added the appropriate reg entries, and added the call to
NkCallIntChain() in the OAL ISR code (I basically copied the assembler
source code from Aspen that makes this call).
I have initially enabled (in the registry) only one of the four UART
ports to use the installable ISR (ISR16550.dll), in order to compare
performance with the other ports.
The test code I am using attempts to transmit 200 bytes from the port
with the IISR to one of the "normal" ports, via a loopback cable. There
is no hardware or software handshaking, and timeouts are all set to
zero.
This test works fine if I don't use the IISR, but not when I enable it.
What appears to happen (determined by stepping through the code with the
kernel debugger) is that the 200 bytes get loaded into the IISR tx fifo
correctly, and some of these (12 bytes) get received by the other serial
port. The IISR port then ends up waiting forever for the transmit
complete interrupt, but it never gets it, as shown in the following
debug output:
1236191 PID:8ffbebc2 TID:fd8d116 0x8fd14098: -GetBytes - rx'ed 12,
dropped 0.
1236191 PID:8ffbebc2 TID:fd8d116 0x8fd14098: After HWGetBytes, Fifo(R=
0,W=1,BA=1,L=2048) ByteRead=12
1236192 PID:8ffbebc2 TID:fd8d116 0x8fd14098: +SL_GetInterruptType IIR=c1
1236193 PID:8ffbebc2 TID:fd8d116 0x8fd14098: -SL_GetInterruptType
0x32820, 0x0
1236194 PID:8ffbebc2 TID:fd8d116 0x8fd14098: SerialEventHandler, No
Interrupt.
1236195 PID:8ffbebc2 TID:fd8d116 0x8fd14098: -SerialEventHandler, Fifo
(R=0,W=13,L=2048)
1236196 PID:8ffbebc2 TID:fd8d116 0x8fd14098: Event 8FF86E16, 24
1236203 PID:8ffbebc2 TID:afd24cd6 0x8fc9a978: SL_TxIntrEx: Enable
INTR_TX.
1236212 PID:8ffbebc2 TID:afd24cd6 0x8fc9a978: SL_TxIntrEx released
CritSec 31c30.
1236217 PID:8ffbebc2 TID:afd24cd6 0x8fc9a978: -SL_TxIntrEx - sent 200.
1236231 PID:8ffbebc2 TID:afd24cd6 0x8fc9a978: 200 bytes actually copied.
1236251 PID:8ffbebc2 TID:afd24cd6 0x8fc9a978: DoPutBytes released
CritSec: 31b34.
1236274 PID:8ffbebc2 TID:afd24cd6 0x8fc9a978: COM_Write wait for
transmission complete event cff865ae.
If I exit the test program, the wait returns and the port closes as
expected.
So it looks looks like I'm not getting interrupts routed back to the
ISR16550.dll correctly.
Any ideas what could be wrong here, or any suggestions as to what to try
to diagnose the problem?
Andrew