RE: How to Add COM2 ?



Please check the registry setting of serial port.
You must assign the correct setting for each UART.
Check the following value in your serial registry setting:
1. IoBase (registry setting):
According to you memey configuration, assign correct "uncached virtual"
IoBase to each serial port. The registry settings in the following example
are "just" examples. You need refer to your BSP and fill them correctly.
ex:
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial2]
"Dll"="xsc1bd_serial.Dll"
IF USE_HWUART !
"IoBase"=dword:a6400000 ;BTUART_BASE_U_VIRTUAL
"IoLen"=dword:24
ENDIF
IF USE_HWUART
"IoBase"=dword:a7800000 ;HWUART_BASE_U_VIRTUAL
"IoLen"=dword:30
ENDIF





-----------------------------------------------------------------------
According to your BSP, "sometime" you need to assign corresponding
DeviceArrayIndex and Hardware Object for your specific serial port.

1. DeviceArrayIndex (Registry Setting):
Please refer to the serial driver and assign the DeviceArrayIndex.
// xsc1_ser_pdd.c
PHWOBJ GetSerialObject(DWORD DeviceArrayIndex)
{
//FFUART's DeviceArrayIndex is zero in the registry.
if (0 == DeviceArrayIndex)
return(&SerObj1);
//STUART's DeviceArrayIndex is four in the registry
else if ( 4 == DeviceArrayIndex)
return (&IRObj1);
//External modem
else if ( 1 == DeviceArrayIndex)
return (&SerCardObj);
//BTUART's DeviceArrayIndex is two in the registry.
if (2 == DeviceArrayIndex)
return(&SerObj2);
else
return(NULL);
}

2. Hardware Object (Serial Driver)
In addition to registry setting, you "may" need modify the serial driver.
Pass the corresponding hardware object.
ex:
// xsc1_ser_pdd.c
HWOBJ SerObj2 =
{
THREAD_AT_INIT,
SYSINTR_SERIAL2,
(PHW_VTBL) &XSC1_SerVTbl ;&XSC1_IRVTbl
};



Not all above advices are useful to you. You may need to trace your BSP/OS
configuration and assign necessary info to your serial driver/registry
setting.

I hope it helpful.

nucca

"harber" wrote:

There are 2 uart in my board(PXA255 + winCe.net 4.2),One is STUart and
another is HWUart.
I use STUart as COM1,but now I need to add COM2.The registry file and
driver was modified by PXA255 reference board(LUBBOCK).and I add
Com16550 Com16550(Second Instance) to my project from the "Common Device
Drive"->"serial driver".
But my app can only use COM2 and COM3 to send data from HWUart.
COM1 can be opened but I got nothing from the STUart.Why?

Any advice is appreciated~

.


Loading