I have written/modified a CE driver to access a quad serial Uart
(specifically an Exar 16C8541).

What appears to be working is the ability to transmit and receive with the
driver on a given serial or COM port when an application requests to do so.
What does not appear to be working is the ability to open more than one
serial or COM port at a time. Example: If COM1 is open COM2 fails to open.
If COM1 is closed then COM2 will open.

Any clues as to what I may be doing wrong? Attached is debug output for CE
initialization of the driver (in this case only COM1 and COM2).

I have placed debug info for all functions in the driver yet when I try to
open the second COM2 port simultaneously with COM1 I see no driver activity
whatsoever.

Additional Info:
There is only one physical interrupt for all the Exar COM ports.
The kernel is sending debug data through one of three serial ports built
into the processor (Cirrus EP9315) - Platform builder has the driver removed
for the remaining 2 built in Cirrus serial ports so they do not conflict with
the COM naming convention used for the Exar part (Only the Exar seral driver
is in effect in the registry).

Any information as to why only one port opens would be greatly appreciated.

Thanks.

---------------------- Device Init On CE Boot Debug Info
---------------------------
XR16C8541 GetSerialObject DeviceArrayIndex=1
XR16C8541SerInit
Try to open Drivers\Active\04
read interrupt configuration parameters
XR16C8541Ser_GetRegistryData pHWHead->xrser16C8541.dwSysIntr =0x00000025
XR16C8541Ser_GetRegistryData pHWHead->xrser16C8541.dwIrq =0x00000004
XR16C8541Ser_GetRegistryData hKey............................=0x00070440
XR16C8541Ser_GetRegistryData pHWHead.........................=0x00034380
XR16C8541Ser_GetRegistryData pHWHead->dwInterfaceType........=0xFFFFFFFF
XR16C8541Ser_GetRegistryData pHWHead->dwIOBase...............=0x20004000
XR16C8541Ser_GetRegistryData device register stride
XR16C8541Ser_GetRegistryData - Devindex 1, SysIntr 37, IOB 20004000, IOLen 8
XR16C8541Ser_GetRegistryData DONE
XR16C8541Ser_InternalMapRegisterAddresses : HalTranslateBusAddress
XR16C8541Ser_InternalMapRegisterAddresses : HalTranslateBusAddress - OK
XR16C8541Ser_InternalMapRegisterAddresses : HalTranslateBusAddress : ! IO
Space
XR16C8541Ser_InternalMapRegisterAddresses TransBusAddrToStatic
** InterfaceType0xFFFFFFFF ioPhysicalBase=0x20004000
XR16C8541Ser_InternalMapRegisterAddresses Result=(0x00034448)
XR16C8541Ser_InternalMapRegisterAddresses ioPortBase=(0x00070000)
XR16C8541SerInit pBaseAddress =(0x00070000)
XR16C8541SerInit pHWHead->cOpenCount =0x00000000
XR16C8541_INIT RegBase 16550 0x70000
XR16C8541-ClearPendingInts IIR 0
XR16C8541SerSetOutputMode
XR16C8541SerInit returning handle of 00034380
XR16C8541_GetRxBufferSize
XR16C8541_PostInit 0x70000
XR16C8541-ClearPendingInts IIR 1
XR16C8541_PostInit Pending Interrupts cleared.0x0
------------------------------------------------------
XR16C8541 GetSerialObject DeviceArrayIndex=2
XR16C8541SerInit
Try to open Drivers\Active\05
read interrupt configuration parameters
XR16C8541Ser_GetRegistryData pHWHead->xrser16C8541.dwSysIntr =0x00000025
XR16C8541Ser_GetRegistryData pHWHead->xrser16C8541.dwIrq =0x00000005
XR16C8541Ser_GetRegistryData hKey............................=0x000715B0
XR16C8541Ser_GetRegistryData pHWHead.........................=0x00034F30
XR16C8541Ser_GetRegistryData pHWHead->dwInterfaceType........=0xFFFFFFFF
XR16C8541Ser_GetRegistryData pHWHead->dwIOBase...............=0x20005000
XR16C8541Ser_GetRegistryData device register stride
XR16C8541Ser_GetRegistryData - Devindex 2, SysIntr 37, IOB 20005000, IOLen 8
XR16C8541Ser_GetRegistryData DONE
XR16C8541Ser_InternalMapRegisterAddresses : HalTranslateBusAddress
XR16C8541Ser_InternalMapRegisterAddresses : HalTranslateBusAddress - OK
XR16C8541Ser_InternalMapRegisterAddresses : HalTranslateBusAddress : ! IO
Space
XR16C8541Ser_InternalMapRegisterAddresses TransBusAddrToStatic
** InterfaceType0xFFFFFFFF ioPhysicalBase=0x20005000
XR16C8541Ser_InternalMapRegisterAddresses Result=(0x00034FF8)
XR16C8541Ser_InternalMapRegisterAddresses ioPortBase=(0x00080000)
XR16C8541SerInit pBaseAddress =(0x00080000)
XR16C8541SerInit pHWHead->cOpenCount =0x00000000
XR16C8541_INIT RegBase 16550 0x80000
XR16C8541-ClearPendingInts IIR 0
XR16C8541SerSetOutputMode
XR16C8541SerInit returning handle of 00034F30
XR16C8541_GetRxBufferSize
XR16C8541_PostInit 0x80000
XR16C8541-ClearPendingInts IIR 1
XR16C8541_PostInit Pending Interrupts cleared.0x0
------------------------------------------------------

Re: Windows CE 5.0 Stream Interface Driver by Steve

Steve
Mon Jul 09 16:56:20 CDT 2007

>Example: If COM1 is open COM2 fails to open.
>If COM1 is closed then COM2 will open.

This most likely indicates an incorrect implementation of the drivers
xxx_init function. It *MUST* return a unique driver context instance for
each serial port. ANother possibility is an incorrect xxx_open. It must also
create and return an "handle" to a unique open context for each device
opened. If you don't support sharing , which is normal for a serial port)
then you can have one open context for each port but need to track if it is
opened already and return the apprriate error if not. Normally this is all
handled in the MDD. Hoever the MDD does not comprehend the concept of a quad
uart so you may need to deal with that in this case (depending on the
details of the quad UART you may not)

BTW: you are far liklier to get more useful answers in the Windows CE
specific OEM group for Platform Builder
(microsoft.public.windowsce.platbuilder) Lot's of folks making devices and
drivers hang out there.

- Steve Maillet (MVP)
EmbeddedFusion


Re: Windows CE 5.0 Stream Interface Driver by Shamus

Shamus
Tue Jul 10 08:26:01 CDT 2007

Thanks Steve for the information and the newsgroup link.
I'm going to take a closer look at the init function as well as open and
check out the CE / Platform news group for additional information.



"Steve Maillet (MVP)" wrote:

> >Example: If COM1 is open COM2 fails to open.
> >If COM1 is closed then COM2 will open.
>
> This most likely indicates an incorrect implementation of the drivers
> xxx_init function. It *MUST* return a unique driver context instance for
> each serial port. ANother possibility is an incorrect xxx_open. It must also
> create and return an "handle" to a unique open context for each device
> opened. If you don't support sharing , which is normal for a serial port)
> then you can have one open context for each port but need to track if it is
> opened already and return the apprriate error if not. Normally this is all
> handled in the MDD. Hoever the MDD does not comprehend the concept of a quad
> uart so you may need to deal with that in this case (depending on the
> details of the quad UART you may not)
>
> BTW: you are far liklier to get more useful answers in the Windows CE
> specific OEM group for Platform Builder
> (microsoft.public.windowsce.platbuilder) Lot's of folks making devices and
> drivers hang out there.
>
> - Steve Maillet (MVP)
> EmbeddedFusion
>
>