none
Problems with the serial ports on Win Embedded Compact 7

    Question

  • Hello.

    I'm trying to set up a Windows Embedded Compact 7 on a Wafer-945GSE, but the serial ports won't work properly. I am using a Intel® Atom™ processor D410/D510 series Rev 3.0 BSP, with a x86 processor.


    Bios settings:
    COM1: Address: 03F8 IRQ: 4
    COM2: Address: 02F8 IRQ: 3
    COM3: Address: 03E8 IRQ: 11
    COM4: Address: 02E8 IRQ: 11
    COM5: Address: 02E0 IRQ: 10
    COM6: Address: 02F0 IRQ: 10

    The debugging port on COM1 has been disabled.

    I'm using the serial port test program from www.embeddedpc.net 
    Only COM1, COM2, COM3 and COM5 shows in the program.
    Just to see if the ports are functional I'm looping pin 2 and 3.

    Sending a message while I'm looping COM1, COM2 and COM3 works fine, but when I try to loop COM5 the program freezes. 

    The following bits are set:
    set IF BSP_SERIAL1=1
    set IF BSP_SERIAL2=1
    set IF BSP_SERIAL3=1
    set IF BSP_SERIAL4=1
    set IF BSP_SERIAL5=1
    set IF BSP_SERIAL6=1

    set IMGENFORA_COM1=
    set IMGENFORA_COM2=
    set IMGENFORA_COM3=1
    set IMGENFORA_COM4=1
    set IMGENFORA_COM5=1
    set IMGENFORA_COM6=1

     

    After some testing, it seems that the serial port test program freezes when the COM5-port with IRQ10 is used. Is it possible that "SysIntr"=dword:1A is not correct for IRQ10?

    Why does not COM3 and COM4, which have the same IRQ number, show up even though isr16550.dll is used? (IMGENFORA_COM3=1, IMGENFORA_COM4=1)


    Code from Platform.reg:

     

    ;-- Resource Manager Configuration ---------------------------------------------

    ; HIVE BOOT SECTION

    [HKEY_LOCAL_MACHINE\Drivers\Resources\IRQ]

        "Identifier"=dword:1

        "Minimum"=dword:1

        "Space"=dword:F

        "Ranges"="1,3-7,9-0xF"

        "Shared"="1,3-7,9-0xF"

     

    [HKEY_LOCAL_MACHINE\Drivers\Resources\IO]

        "Identifier"=dword:2

        "Minimum"=dword:0

        "Space"=dword:10000

        "Ranges"="0-0x5F,0x65-0x277,0x284-0x38F,0x392-0x3DF,0x3E2-0xFFFF"

    IF BSP_SERIAL1

        "Ranges"="0-0x5F,0x65-0x277,0x284-0x2F7,0x300-0x38F,0x392-0x3DF,0x3E2-0xFFFF"

    ENDIF BSP_SERIAL1

    IF BSP_SERIAL2

        "Ranges"="0-0x5F,0x65-0x277,0x284-0x2F7,0x300-0x38F,0x392-0x3DF,0x3E2-0x3E7,0x3F0-0xFFFF"

    ENDIF BSP_SERIAL2

    IF BSP_SERIAL3

        "Ranges"="0-0x5F,0x65-0x277,0x284-0x2E7,0x2F0-0x2F7,0x300-0x38F,0x392-0x3DF,0x3E2-0x3E7,0x3F0-0xFFFF"

    ENDIF BSP_SERIAL3

     

    IF BSP_PCH_EG20T

    IF BSP_SERIAL1

    [HKEY_LOCAL_MACHINE\Drivers\Resources\IO]

        ; PCH EG20T COM debug port IO range = 0x3F8-ox3FF

        "Ranges"="0-0x5F,0x65-0x277,0x284-0x38F,0x392-0x3DF,0x3E2-0x3F7,0x400-0xFFFF"

    ENDIF BSP_SERIAL1

    ENDIF BSP_PCH_EG20T

     

    ; END HIVE BOOT SECTION

    ;-------------------------------------------------------------------------------

     

    IF BSP_SERIAL1

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial1]

        "Flags"=dword:0010            ; User Mode: DEVFLAGS_LOAD_AS_USERPROC

        "Dll"="Com16550.Dll"

        "Prefix"="COM"

        "Order"=dword:0

        "Index"=dword:1

        "SysIntr"=dword:14

    IF BSP_PCH_EG20T

        ; PCH EG20T COM debug port IOBase=0x3F8 (per BIOS settings)

        "IoBase"=dword:03F8

    ELSE

        "IoBase"=dword:03F8

    ENDIF BSP_PCH_EG20T

        "IoLen"=dword:8

        "DeviceArrayIndex"=dword:0

        "IClass"="{CC5195AC-BA49-48a0-BE17-DF6D1B0173DD}"

        "UserProcGroup"=dword:$(PROCGROUP_DRIVER_MSFT_DEFAULT)

    IF IMGENFORA_COM1

        ; Turn on installable ISR (isr16550 supporting SOFTWARE FIFO)

        "Flags"=dword:0                 ; Kernel Mode

        "Irq"=dword:4

        "IsrDll"="isr16550.dll"

        "IsrHandler"="ISRHandler"

    ENDIF IMGENFORA

     

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial1\Unimodem]

        "Tsp"="Unimodem.dll"

        "DeviceType"=dword:0

        "DevConfig"=hex: 10,00, 00,00, 05,00,00,00, 10,01,00,00, 00,4B,00,00, 00,00, 08, 00, 00, 00,00,00,00

     

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial1\HayesCompat]

        "Tsp"="Unimodem.dll"

        "DeviceType"=dword:1

    ENDIF BSP_SERIAL1

     

    IF BSP_SERIAL2

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial2]

        "Flags"=dword:0010            ; User Mode: DEVFLAGS_LOAD_AS_USERPROC

        "Dll"="Com16550.Dll"

        "Prefix"="COM"

        "Order"=dword:1

        "Index"=dword:2

        "SysIntr"=dword:13

        "IoBase"=dword:02F8

        "IoLen"=dword:8

        "DeviceArrayIndex"=dword:1

        "IClass"="{CC5195AC-BA49-48a0-BE17-DF6D1B0173DD}"

        "UserProcGroup"=dword:$(PROCGROUP_DRIVER_MSFT_DEFAULT)

    IF IMGENFORA_COM2

        ; Turn on installable ISR (isr16550 supporting SOFTWARE FIFO)

        "Flags"=dword:0                 ; Kernel Mode

        "Irq"=dword:3

        "IsrDll"="isr16550.dll"

        "IsrHandler"="ISRHandler"

    ENDIF

     

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial2\Unimodem]

        "Tsp"="Unimodem.dll"

        "DeviceType"=dword:0

        "DevConfig"=hex: 10,00, 00,00, 05,00,00,00, 10,01,00,00, 00,4B,00,00, 00,00, 08, 00, 00, 00,00,00,00

     

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial2\HayesCompat]

        "Tsp"="Unimodem.dll"

        "DeviceType"=dword:1

    ENDIF BSP_SERIAL2

     

    IF BSP_SERIAL3

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial3]

        "Flags"=dword:0010            ; User Mode: DEVFLAGS_LOAD_AS_USERPROC

        "Dll"="Com16550.Dll"

        "Prefix"="COM"

        "Order"=dword:2

        "Index"=dword:3

        "SysIntr"=dword:1B

        "IoBase"=dword:03E8

        "IoLen"=dword:8

        "DeviceArrayIndex"=dword:2

        "IClass"="{CC5195AC-BA49-48a0-BE17-DF6D1B0173DD}"

        "UserProcGroup"=dword:$(PROCGROUP_DRIVER_MSFT_DEFAULT)

    IF IMGENFORA_COM3

        ; Turn on installable ISR (isr16550 supporting SOFTWARE FIFO)

        "Flags"=dword:0                 ; Kernel Mode

        "Irq"=dword:11

        "IsrDll"="isr16550.dll"

        "IsrHandler"="ISRHandler"

    ENDIF

     

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial3\Unimodem]

        "Tsp"="Unimodem.dll"

        "DeviceType"=dword:0

        "DevConfig"=hex: 10,00, 00,00, 05,00,00,00, 10,01,00,00, 00,4B,00,00, 00,00, 08, 00, 00, 00,00,00,00

     

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial3\HayesCompat]

        "Tsp"="Unimodem.dll"

        "DeviceType"=dword:1

    ENDIF BSP_SERIAL3

     

    IF BSP_SERIAL4

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial4]

        "Flags"=dword:0010            ; User Mode: DEVFLAGS_LOAD_AS_USERPROC

        "Dll"="Com16550.Dll"

        "Prefix"="COM"

        "Order"=dword:3

        "Index"=dword:4

        "SysIntr"=dword:1B

        "IoBase"=dword:02E8

        "IoLen"=dword:8

        "DeviceArrayIndex"=dword:3

        "IClass"="{CC5195AC-BA49-48a0-BE17-DF6D1B0173DD}"

        "UserProcGroup"=dword:$(PROCGROUP_DRIVER_MSFT_DEFAULT)

    IF IMGENFORA_COM4

        ; Turn on installable ISR (isr16550 supporting SOFTWARE FIFO)

        "Flags"=dword:0                 ; Kernel Mode

        "Irq"=dword:11

        "IsrDll"="isr16550.dll"

        "IsrHandler"="ISRHandler"

    ENDIF

     

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial4\Unimodem]

        "Tsp"="Unimodem.dll"

        "DeviceType"=dword:0

        "DevConfig"=hex: 10,00, 00,00, 05,00,00,00, 10,01,00,00, 00,4B,00,00, 00,00, 08, 00, 00, 00,00,00,00

     

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial4\HayesCompat]

        "Tsp"="Unimodem.dll"

        "DeviceType"=dword:1

    ENDIF BSP_SERIAL4

     

    IF BSP_SERIAL5

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial5]

        "Flags"=dword:0010            ; User Mode: DEVFLAGS_LOAD_AS_USERPROC

        "Dll"="Com16550.Dll"

        "Prefix"="COM"

        "Order"=dword:4

        "Index"=dword:5

        "SysIntr"=dword:1A

        "IoBase"=dword:02F0

        "IoLen"=dword:8

        "DeviceArrayIndex"=dword:4

        "IClass"="{CC5195AC-BA49-48a0-BE17-DF6D1B0173DD}"

        "UserProcGroup"=dword:$(PROCGROUP_DRIVER_MSFT_DEFAULT)

    IF IMGENFORA_COM5

        ; Turn on installable ISR (isr16550 supporting SOFTWARE FIFO)

        "Flags"=dword:0                 ; Kernel Mode

        "Irq"=dword:10

        "IsrDll"="isr16550.dll"

        "IsrHandler"="ISRHandler"

    ENDIF

     

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial5\Unimodem]

        "Tsp"="Unimodem.dll"

        "DeviceType"=dword:0

        "DevConfig"=hex: 10,00, 00,00, 05,00,00,00, 10,01,00,00, 00,4B,00,00, 00,00, 08, 00, 00, 00,00,00,00

     

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial5\HayesCompat]

        "Tsp"="Unimodem.dll"

        "DeviceType"=dword:1

    ENDIF BSP_SERIAL5

     

    IF BSP_SERIAL6

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial6]

        "Flags"=dword:0010            ; User Mode: DEVFLAGS_LOAD_AS_USERPROC

        "Dll"="Com16550.Dll"

        "Prefix"="COM"

        "Order"=dword:5

        "Index"=dword:6

        "SysIntr"=dword:1A

        "IoBase"=dword:02E0

        "IoLen"=dword:8

        "DeviceArrayIndex"=dword:5

        "IClass"="{CC5195AC-BA49-48a0-BE17-DF6D1B0173DD}"

        "UserProcGroup"=dword:$(PROCGROUP_DRIVER_MSFT_DEFAULT)

    IF IMGENFORA_COM6

        ; Turn on installable ISR (isr16550 supporting SOFTWARE FIFO)

        "Flags"=dword:0                 ; Kernel Mode

        "Irq"=dword:10

        "IsrDll"="isr16550.dll"

        "IsrHandler"="ISRHandler"

    ENDIF

     

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial6\Unimodem]

        "Tsp"="Unimodem.dll"

        "DeviceType"=dword:0

        "DevConfig"=hex: 10,00, 00,00, 05,00,00,00, 10,01,00,00, 00,4B,00,00, 00,00, 08, 00, 00, 00,00,00,00

     

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial6\HayesCompat]

        "Tsp"="Unimodem.dll"

        "DeviceType"=dword:1

    ENDIF BSP_SERIAL6

     

     

    ;-------------------------------------------------------------------------------

     

     

    IF BSP_SERIAL1

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial1\Unimodem]

        "FriendlyName"="Serial Cable on COM1:"

     

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial1\HayesCompat]

       "FriendlyName"="Hayes Compatible on COM1:"

    ENDIF BSP_SERIAL1

     

    IF BSP_SERIAL2

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial2\Unimodem]

        "FriendlyName"="Serial Cable on COM2:"

     

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial2\HayesCompat]

       "FriendlyName"="Hayes Compatible on COM2:"

    ENDIF BSP_SERIAL2

     

    IF BSP_SERIAL3

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial3\Unimodem]

        "FriendlyName"="Serial Cable on COM3:"

     

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial3\HayesCompat]

       "FriendlyName"="Hayes Compatible on COM3:"

    ENDIF BSP_SERIAL3

     

    IF BSP_SERIAL4

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial4\Unimodem]

        "FriendlyName"="Serial Cable on COM4:"

     

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial4\HayesCompat]

       "FriendlyName"="Hayes Compatible on COM4:"

    ENDIF BSP_SERIAL4

     

    IF BSP_SERIAL5

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial5\Unimodem]

        "FriendlyName"="Serial Cable on COM5:"

     

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial5\HayesCompat]

       "FriendlyName"="Hayes Compatible on COM5:"

    ENDIF BSP_SERIAL5

     

    IF BSP_SERIAL6

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial6\Unimodem]

        "FriendlyName"="Serial Cable on COM6:"

     

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial6\HayesCompat]

       "FriendlyName"="Hayes Compatible on COM6:"

    ENDIF BSP_SERIAL6

     

     


    Wednesday, July 20, 2011 8:10 AM

Answers

  • Supposing that you're using the standard serial driver; while you can have the same IRQ value for different serial ports, you cannot have the same sysintr, value it must be unique.

    You can modify the serial port settings in the BIOS so that there's no IRQ sharing OR

    You can modify the OAL to statically map other sysintr to IRQ 10 and IRQ 11 which are shared OR

    Modify the serial driver code so that calls IOCTL_HAL_REQUEST_SYSINTR to obtain the additional sysintr for IRQ10 and IRQ11 other than 0x1A & 0x1B which are statically mapped in the OAL


    Luca Calligaris lucaDOTcalligarisATeurotechDOTcom www.eurotech.com Check my blog: http://lcalligaris.wordpress.com
    • Marked as answer by Kyllingmann Friday, July 22, 2011 5:38 AM
    Thursday, July 21, 2011 12:50 PM

All replies

  •  Hello,

     at first, you should check is registry filling correctly? Find reginit.ini and make sure that all \Builtin\SerialXX entries are there.

    Then build project under Debug configuration and enable serial driver debug zones to investigate hang reason.

    Thursday, July 21, 2011 11:43 AM
  • Supposing that you're using the standard serial driver; while you can have the same IRQ value for different serial ports, you cannot have the same sysintr, value it must be unique.

    You can modify the serial port settings in the BIOS so that there's no IRQ sharing OR

    You can modify the OAL to statically map other sysintr to IRQ 10 and IRQ 11 which are shared OR

    Modify the serial driver code so that calls IOCTL_HAL_REQUEST_SYSINTR to obtain the additional sysintr for IRQ10 and IRQ11 other than 0x1A & 0x1B which are statically mapped in the OAL


    Luca Calligaris lucaDOTcalligarisATeurotechDOTcom www.eurotech.com Check my blog: http://lcalligaris.wordpress.com
    • Marked as answer by Kyllingmann Friday, July 22, 2011 5:38 AM
    Thursday, July 21, 2011 12:50 PM
  • Probably the 2nd option is the easiest one: in your BSP (otherwise you need to clone %_WINCEROOT%\platform\common\src\x86\common\intr) after the various calls to OALIntrStaticTranslate you can call OALIntrRequestSysIntr (you need to use OAL_INTR_DYNAMIC)
    Luca Calligaris lucaDOTcalligarisATeurotechDOTcom www.eurotech.com Check my blog: http://lcalligaris.wordpress.com
    Thursday, July 21, 2011 1:16 PM