none
Disable wince debug port RRS feed

  • Question

  • Hi all,

    I have to disable the WinCE debug port from BSP. What are the configurations/settings are required to it. Also i need free this port to be used as normal serial port.

     

    Thanks

    Misbah

    Thursday, September 23, 2010 5:46 AM

All replies

  •  
    Check out this blog post.Hope this helps.
     
     
    • Proposed as answer by Michael Koster Thursday, September 23, 2010 6:38 AM
    Thursday, September 23, 2010 6:11 AM
  • Thanks Prabhu,

    Yes i implemented the same way and it works also.

     

    I wanted to know if there is any other way rather than modifying the source to get it done so that it shall be helpful if we want to revert back to the original when ever we require debug port.

     

    Thanks

    Misbah

    Thursday, September 23, 2010 6:16 AM
  • Yeah you can keep it part of your boot argument area.And you can disable the debug serial port dynamically using that flag.
     
    In the eboot menu you can give a option in the menu to disable it.But you need to reset your device to do this.
    Thursday, September 23, 2010 6:38 AM
  • Another possible way to do this without rebooting the device but more works are involved here.

    1) Implement your own IOCTL in the OAL to initialize and uninitialize the debug serial port.

    2) Load and unload your serial driver programatically using ActivateDeviceEx() instead of using busenumerator (Builtin registry key).

    if you want debug port.

    1) unload the serial driver using DeactivateDevice().

    2) Call your own IOCTL to initialize the debug serial port using KernelIOcontrol(). Now you can get the debug messages.

    if you want serial port to use for some other purpose.

    1) call your own IOCtl to uninitialize the debug serial port using kernelIOcontrol().

    2) call ActivateDeviceEx() to load the serial driver for some other purpose.

     

    Note: if your application which is calling the kernelIocontrol() is a user mode thread, see the steps to implement additional things before calling the kernelIoControl() in the \WINCE600\PUBLIC\COMMON\OAK\OALIOCTL\oalioctl.cpp. Otherwise call to KernelIoControl() with your IOCTL will fail.


    Vinoth.R http://vinoth-vinothblog.blogspot.com http://www.e-consystems.com
    Thursday, September 23, 2010 8:07 AM
  • Thanks Vinoth and Prabhu,

     

    Both of your ideas are excellent espacially without reboot ... Boot argument option i did but for something else in this case i never thought ...

     

    I shall implement it .

     

    Thanks

    Misbah

    Friday, September 24, 2010 10:09 AM
  • Hi Prabu,

    The link which you mentioned is not working. Could you please provide an active url?

    I want to disable the debug port (COM2) in wince 6.0. After modifying the debug.c the debug messages are stopped but the port is not released. So, I am not able to use it.

    Could you please hlep?

     

    Monday, October 25, 2010 11:13 PM
  • Hi Chris,
     
    Currently the site is under maintenance,i feel sorry for it.
     
    After disabling it from the debug.c file, did you added the corresponding registry settings for the serial driver COM2 port in the platform.reg?
     
    Are you still getting the debug messages in the COM2 port?
    Tuesday, October 26, 2010 2:01 AM
  • Hi Prabu,

    I totally want to disable the debug port. My board provides 3 COM ports and all are requred for other purpose. Below is the OEMInitDebugSerial function. Also I didn't added/modified the .reg file additionally. Also, please see the reg entry below:

    Regards,
    Chris

    VOID

    OEMInitDebugSerial(

    )

    {

    s_pUartRegs = NULL;

    return;

     

    //----------------------------------------------------------------------

     

    // Initialize UART1

     

    //----------------------------------------------------------------------

     

    // LPD 2.0 Bring up - changing to UART 1 as the debugging port

    s_pUartRegs = OALPAtoUA(OMAP_UART1_REGS_PA);

     

    // Reset UART & wait until it completes

    OUTREG8(&s_pUartRegs->SYSC, UART_SYSC_RST);

     

    while ((INREG8(&s_pUartRegs->SYSS) & UART_SYSS_RST_DONE) == 0);

     

    // Set baud rate

    OUTREG8(&s_pUartRegs->LCR, UART_LCR_DLAB);

    OUTREG8(&s_pUartRegs->DLL, BSP_UART_DSIUDLL);

    OUTREG8(&s_pUartRegs->DLH, BSP_UART_DSIUDLH);

     

    // 8 bit, 1 stop bit, no parity

    OUTREG8(&s_pUartRegs->LCR, BSP_UART_LCR);

     

    // Enable FIFO

    OUTREG8(&s_pUartRegs->FCR, UART_FCR_FIFO_EN);

     

    // Pool

    OUTREG8(&s_pUartRegs->IER, 0);

     

    // Set DTR/RTS signals

    OUTREG8(&s_pUartRegs->MCR, UART_MCR_DTR|UART_MCR_RTS);

     

    // Configuration complete so select UART 16x mode

    OUTREG8(&s_pUartRegs->MDR1, UART_MDR1_UART16);

    }

     

    ;

     

    @CESYSGEN IF CE_MODULES_SERIAL

    IF

     

    BSP_COM

     

    IF BSP_COM1

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Uart1]

    "Prefix"="COM"

    "Dll"="uart.dll"

    "Index"=dword:1

    "Order"=dword:1

    ;"Order"=dword:9

    "PowerFlags"=dword:00000103

    ; send pre/post device state changes

    "DeviceArrayIndex"=dword:0

    "MemBase"=multi_sz:"4806A000", "48056080"

    "MemLen"=multi_sz:"00000400", "00001000"

    "Irq"=dword:48

    ; IRQ 72

    "RxBuffer" = dword:2000

     

    ;"TxDmaRequest"=dword:31 ; S_DMA_48 TX DMA Request Line, use ffffffff to disable TX DMA

    "TxDmaRequest"=dword:ffffffff

    ; TxDma has issues after RX of break, disabled with ffffffff

    "TxDmaBufferSize"=dword:2000

    ; Size of DMA transmit buffer

     

    ;"RxDmaRequest"=dword:32 ; S_DMA_49 RX DMA Request Line, use ffffffff to disable RX DMA

    "RxDmaRequest"=dword:ffffffff

    "RxDmaBufferSize"=dword:2000

    ; Size of DMA receive buffer

    "RtsCtsEnable"=dword:0

    ; 1=enable RTS/CTS handshake support, 0=disable

    "HWMode"=dword:1

    ; Use hardware auto RTS/CTS

     

    ; PMCLASS_PMEXT_GUID, CE_DRIVER_POWER_MANAGEABLE_GENERIC_GUID

    "IClass"=multi_sz:"{0AE2066F-89A2-4D70-8FC2-29AEFA68413C}",

    "{A32942B7-920C-486b-B0E6-92A702A99B35}"

     

    ENDIF BSP_COM1

     

    IF BSP_COM2

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Uart2]

    "Prefix"="COM"

    "Dll"="uart.dll"

    "Index"=dword:2

    "Order"=dword:9

    "PowerFlags"=dword:00000103

    ; send pre/post device state changes

    "DeviceArrayIndex"=dword:0

    "MemBase"=multi_sz:"4806C000", "48056080"

    "MemLen"=multi_sz:"00000400", "00001000"

    "Irq"=dword:49

    ; IRQ 73

    "RxBuffer" = dword:2000

     

    ;"TxDmaRequest"=dword:33 ; S_DMA_50 TX DMA Request Line, use ffffffff to disable TX DMA

    "TxDmaRequest"=dword:ffffffff

    ; TxDma has issues after RX of break, disabled with ffffffff

    "TxDmaBufferSize"=dword:2000

    ; Size of DMA transmit buffer

    "RxDmaRequest"=dword:34

    ; S_DMA_51 RX DMA Request Line, use ffffffff to disable RX DMA

    "RxDmaBufferSize"=dword:2000

    ; Size of DMA receive buffer

    "RtsCtsEnable"=dword:0

    ; 1=enable RTS/CTS handshake support, 0=disable

    "HWMode"=dword:1

    ; Use hardware auto RTS/CTS

    "XcvrEnableGpio"=dword:d5

    ; GPIO pin that controls external transceiver (comment out if unused)

    "XcvrEnabledLevel"=dword:1

    ; Level of gpio pin that enables the transceiver (comment out if unused)

     

    ; PMCLASS_PMEXT_GUID, CE_DRIVER_POWER_MANAGEABLE_GENERIC_GUID

    "IClass"=multi_sz:"{0AE2066F-89A2-4D70-8FC2-29AEFA68413C}",

    "{A32942B7-920C-486b-B0E6-92A702A99B35}"

     

    ENDIF BSP_COM2

     

    IF BSP_COM3

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Uart3]

    "Prefix"="COM"

    "Dll"="uart.dll"

    "Index"=dword:3

    "Order"=dword:9

    "PowerFlags"=dword:00000103

    ; send pre/post device state changes

    "DeviceArrayIndex"=dword:0

    "MemBase"=multi_sz:"49020000", "48056080"

    "MemLen"=multi_sz:"00000400", "00001000"

    "Irq"=dword:4A

    ; IRQ 74

    "RxBuffer" = dword:2000

     

    ;"TxDmaRequest"=dword:35 ; S_DMA_52 TX DMA Request Line, use ffffffff to disable TX DMA

    "TxDmaRequest"=dword:ffffffff

    ; TxDma has issues after RX of break, disabled with ffffffff

    "TxDmaBufferSize"=dword:2000

    ; Size of DMA transmit buffer

    "RxDmaRequest"=dword:36

    ; S_DMA_53 RX DMA Request Line, use ffffffff to disable RX DMA

    "RxDmaBufferSize"=dword:2000

    ; Size of DMA receive buffer

     

    IF BSP_EVM2_RTS_CTS

    "RtsCtsEnable"=dword:1

    ; 1=enable RTS/CTS handshake support, 0=disable

     

    ELSE

    "RtsCtsEnable"=dword:0

    ; 1=enable RTS/CTS handshake support, 0=disable

     

    ENDIF

    "HWMode"=dword:1

    ; Use hardware auto RTS/CTS

    "XcvrEnableGpio"=dword:d6

    ; GPIO pin that controls external transceiver (comment out if unused)

    "XcvrEnabledLevel"=dword:1

    ; Level of gpio pin that enables the transceiver (comment out if unused)

     

    ; PMCLASS_PMEXT_GUID, CE_DRIVER_POWER_MANAGEABLE_GENERIC_GUID

    "IClass"=multi_sz:"{0AE2066F-89A2-4D70-8FC2-29AEFA68413C}",

    "{A32942B7-920C-486b-B0E6-92A702A99B35}"

     

    ENDIF BSP_COM3

    ENDIF

     

    BSP_COM

    ;

     

    @CESYSGEN ENDIF CE_MODULES_SERIAL

    Friday, October 29, 2010 1:02 AM
  • As per you previous posting you mentioned you are not able to use COM2.But as per your debug.c file it is using UART1 which is mapped to COM1 in the registry file.
     
    Did you tried using COM1 in the WinCE OS?And also did you enabled all the environment variable (like BSP_COM1) while building OS?
    Friday, October 29, 2010 6:30 AM
  • Yes, I have enabled BSP_COM1, BSP_COM2 and BSP_COM3 through the catelog which are under  Third Party->BSP->ARMV4I->Device Drivers->Serial->Uart->Uart1/Uart2/Uart3.

    Also, I tried using the COM1. Open succeeds but Write/Read not writing/reading anything through the port. GetLastError() returns 0.

    We are connecting an external device through COM1. But we have a vb application and it reads/writes correctly when we connect the external device to the desktop. So, we found the problem is with the windows ce configuration running under OMAP.

    Regards

    Chris

    Friday, October 29, 2010 4:56 PM