none
COM port stops working when enabling KITL and Kernel Debugger RRS feed

  • Question

  • Hi, 

    I am facing a problem with my nk.bin builds.

    When I build with the Build Options

    > Enable Kernel Debugger AND

    > Enable KITL

    One of my COM Ports( COM 3, by means of a TI 16C554 IC connected on the ISA bus to the processor) mapped to IRQ5, Address 0x320, stops working. From the signals that I am getting on the IRQ pin, I have a feeling that the Interrupt from the UART IC is not being serviced by the windows serial port driver

     

    When I  build the image with  Kernel Debugger and KITL disabled, the same serial port is working fine.

     

    I have not selected the Serial port for any debugging related activity, My Target connectivity options->Transport is SET to Ethernet.

     

    Why could this be happening? What does the KITL and hte Kernel Debugger have to do with a Serial Port when using Ethernet as the medium to connect to the Development System?

    Monday, January 2, 2012 12:54 PM

All replies

  • Hi Deepak,

    I guess any HW signals being shared bettween Ethernet and TI 16C554?

    Regards,

    GSR

    Tuesday, January 3, 2012 5:04 AM
  • @ Deepak,

    Your problem is likely related to debug serial captured the serial port and prevent your application from accessing the port.

    Use the remote registry tool to view the device's registry after bootup.  It should give you some clue about the problem.


    Samuel Phung ICOP Technology Inc. http://www.embeddedpc.net
    Wednesday, January 4, 2012 11:24 PM
  • Thanks Samuel I will check this.
    Thursday, January 5, 2012 5:22 AM
  • Hi Samuel,

     

    In my Device's registry, there is no entry for

    HKEY_LOCAL_MACHINE\Drivers\BootArg

     

    Is this the problem? I understand that the void OEMInitDebugSerial(void) function uses the value in HKEY_LOCAL_MACHINE\Drivers\BootArg to decide which COM port to use for Serial Debug. In absence of any entry, could be taking up a random COM port?

     

    I checked the source for my platform.reg(modified by the Vendor) file, in which the below is commented out...

     

    ;;legend start             IF BSP_NOSERIAL !
    ;;                ; HIVE BOOT SECTION
    ;;                    [HKEY_LOCAL_MACHINE\Drivers\BootArg]
    ;;                        ; During load, we check the SerialDbgX regkey, where X is the physical COM port selected
    ;;                        ; for serial debug output.  Then we disable the serial driver of the corresponding value
    ;;                        ; Be sure that the pointed-to driver is associated with the same physical COM port (IOBase value).
    ;;                        "SerialDbg1"="Drivers\\BuiltIn\\Serial"
    ;;                        IF BSP_SERIAL2
    ;;                            "SerialDbg2"="Drivers\\BuiltIn\\Serial2"
    ;;                        ENDIF BSP_SERIAL2
    ;;                        IF BSP_SERIAL3
    ;;                            "SerialDbg3"="Drivers\\BuiltIn\\Serial3"
    ;;                        ENDIF BSP_SERIAL3
    ;;                        IF BSP_SERIAL4
    ;;                            "SerialDbg4"="Drivers\\BuiltIn\\Serial4"
    ;;                        ENDIF BSP_SERIAL4
    ;;                ; END HIVE BOOT SECTION
    ;;legend end            ENDIF BSP NOSERIAL !
    
    And immediately after are serial port registry entries...
                IF BSP_NOSERIAL !
                    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial]
                        "SysIntr"=dword:14
                        "IoBase"=dword:03F8
                        "IoLen"=dword:8
                        "DeviceArrayIndex"=dword:0
                        "Prefix"="COM"
                        "IClass"="{CC5195AC-BA49-48a0-BE17-DF6D1B0173DD}"
                        "Dll"="Com16550.Dll"
                        "Order"=dword:0
                        "Flags"=dword:10 ; User MOde: DEVFLAGS_LOAD_AS_USERPROC
                        ; Turn on follows for Installable ISR (isr16550 supporting SOFTWARE FIFO
                        ;"Irq"=dword:3
                        ;"IsrDll"="isr16550.dll"
                        ;"IsrHandler"="ISRHandler"
                        ;"Flags"=dword:0 ; Disable User Mode if we need ISR16550.
    
                    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial\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
                        #if ! (defined IMGPPC || defined IMGTPC)
                             "FriendlyName"=LOC_FRIENDLYNAME_SERIAL
                        #else (defined IMGPPC || defined IMGTPC)
    {BEGIN MULTILANG}
                                ; @BEGINASSOC LOCALE %LANGID%
                                    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial\Unimodem]
                                        "FriendlyName"=LOC_%LANGID%_FRIENDLYNAME_SERIAL
                                ; @ENDASSOC
    {END MULTILANG}
                        #endif ! (defined IMGPPC || defined IMGTPC)
    
                    IF BSP_SERIAL2
                        [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial2]
                            "SysIntr"=dword:13
                            "IoBase"=dword:02F8
                            "IoLen"=dword:8
                            "DeviceArrayIndex"=dword:1
                            "Prefix"="COM"
                            "IClass"="{CC5195AC-BA49-48a0-BE17-DF6D1B0173DD}"
                            "Dll"="Com16550.Dll"
                            "Order"=dword:0
                            "Flags"=dword:10 ; User MOde: DEVFLAGS_LOAD_AS_USERPROC
    
                        [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
                            #if ! (defined IMGPPC || defined IMGTPC)
                                "FriendlyName"=LOC_FRIENDLYNAME_SERIAL2
                            #else (defined IMGPPC || defined IMGTPC)
    {BEGIN MULTILANG}
                                    ; @BEGINASSOC LOCALE %LANGID%
                                        [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial2\Unimodem]
                                            "FriendlyName"=LOC_%LANGID%_FRIENDLYNAME_SERIAL2
                                    ; @ENDASSOC
    {END MULTILANG}
                            #endif ! (defined IMGPPC || defined IMGTPC)
                    ENDIF BSP_SERIAL2
    
                    IF BSP_SERIAL3
                        [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial3]
                            "SysIntr"=dword:15
                            "IoBase"=dword:0320
                            "IoLen"=dword:8
                            "DeviceArrayIndex"=dword:2
                            "Prefix"="COM"
                            "IClass"="{CC5195AC-BA49-48a0-BE17-DF6D1B0173DD}"
                            "Dll"="Com16550.Dll"
                            "Order"=dword:0
                            "Flags"=dword:10 ; User MOde: DEVFLAGS_LOAD_AS_USERPROC
    
                        [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
                            #if ! (defined IMGPPC || defined IMGTPC)
                                "FriendlyName"=LOC_FRIENDLYNAME_SERIAL3
                            #else (defined IMGPPC || defined IMGTPC)
    {BEGIN MULTILANG}
                                    ; @BEGINASSOC LOCALE %LANGID%
                                        [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial3\Unimodem]
                                            "FriendlyName"=LOC_%LANGID%_FRIENDLYNAME_SERIAL3
                                    ; @ENDASSOC
    {END MULTILANG}
                            #endif ! (defined IMGPPC || defined IMGTPC)
                    ENDIF BSP_SERIAL3
                    IF BSP_SERIAL4
                        [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial4]
                            "SysIntr"=dword:16
                            "IoBase"=dword:0328
                            "IoLen"=dword:8
                            "DeviceArrayIndex"=dword:3
                            "Prefix"="COM"
                            "IClass"="{CC5195AC-BA49-48a0-BE17-DF6D1B0173DD}"
                            "Dll"="Com16550.Dll"
                            "Order"=dword:0
                            "Flags"=dword:10 ; User MOde: DEVFLAGS_LOAD_AS_USERPROC
    
                        [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
                            #if ! (defined IMGPPC || defined IMGTPC)
                                "FriendlyName"=LOC_FRIENDLYNAME_SERIAL4
                            #else (defined IMGPPC || defined IMGTPC)
    {BEGIN MULTILANG}
                                    ; @BEGINASSOC LOCALE %LANGID%
                                        [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial4\Unimodem]
                                            "FriendlyName"=LOC_%LANGID%_FRIENDLYNAME_SERIAL4
                                    ; @ENDASSOC
    {END MULTILANG}
                            #endif ! (defined IMGPPC || defined IMGTPC)
                    ENDIF BSP_SERIAL4
                    IF BSP_SERIAL5
                        [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial5]
                            "SysIntr"=dword:17
                            "IoBase"=dword:0330
                            "IoLen"=dword:8
                            "DeviceArrayIndex"=dword:4
                            "Prefix"="COM"
                            "IClass"="{CC5195AC-BA49-48a0-BE17-DF6D1B0173DD}"
                            "Dll"="Com16550.Dll"
                           "Order"=dword:0
                            "Flags"=dword:10 ; User MOde: DEVFLAGS_LOAD_AS_USERPROC
    
                        [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
    			"FriendlyName"="serial Cable on  COM5:"
    
                           
                    ENDIF BSP_SERIAL5
    
    		IF BSP_SERIAL6
                        [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial6]
    			"SysIntr"=dword:1b
                            "IoBase"=dword:0338
                            "IoLen"=dword:8
                            "DeviceArrayIndex"=dword:5
                            "Prefix"="COM"
                            "IClass"="{CC5195AC-BA49-48a0-BE17-DF6D1B0173DD}"
                            "Dll"="Com16550.Dll"
                            "Order"=dword:0
                            "Flags"=dword:10 ; User MOde: DEVFLAGS_LOAD_AS_USERPROC
    
                        [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
    			"FriendlyName"="serial Cable on  COM6:"
    
                           
                    ENDIF BSP_SERIAL6
    
    
    		
                ENDIF BSP_NOSERIAL !

    Sorry for the long listing, wanted to be sure I don't miss out anything critical.
    With regards

    Friday, January 6, 2012 1:52 PM
  • @ Deepak,

    You need to verify the IRQ and I/O address configured for the serial port in question.

    In general, the system is configured to use the first serial port for serial debug

    There are a few different methods you can use to check/isolate the problem:

    1.  Configure the serial port in question to use a different IRQ and I/O address.

     

    2.  Add registry entries similar to the following to configure the serial debug to use a different serial port.

    [HKEY_LOCAL_MACHINE\Drivers\BootArg]
       "SerialDbg1"="Drivers\\BuiltIn\\Serial1"

     

    Most bootloader is designed with ability to pass BootArg parameter to set Serial debug port usage, which can be another potential source of problem. 


    Samuel Phung ICOP Technology Inc. http://www.embeddedpc.net
    Thursday, January 12, 2012 6:29 AM