Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

USB HOST - CDC support in wince 5.0

905 views
Skip to first unread message

dsrking

unread,
May 19, 2010, 6:12:21 AM5/19/10
to
Hi to all,

I have a Usb host driver for our own hardware. It is working fine with
Mass storage class, hid class. But i want to check with CDC devices
which is working with my host controller driver.

In wince 5.0, there is no CDC class driver. So is it possible to
support CDC device in host side driver?

If you have developed or supported CDC devices in host side driver,
could u please give me the steps to do the same.

Thanks in Advance.

with D.

Luca Calligaris [eMVP]

unread,
May 19, 2010, 9:07:17 AM5/19/10
to
Windows Embedded CE 6.0 has a CDC-ACM USB client driver, Windows CE 5.0 has
not. You can easily port the code from one to the other (although I cannot
say this is perfectly legal) with a few modifications:
A part (%_WINCEROOT%\PUBLIC\COMMON\OAK\DRIVERS\USB\CLASS\USBSER) you have to
import (%_WINCEROOT%\PUBLIC\COMMON\OAK\DRIVERS\USB\CLASS\CLIENTCMN which is
used by
the driver then you have to modify a function (sorry but I do not remember
the details) since it relies on a newer USB interface structure member (as
far I remember) which has been introduced in CE 6.0


--
Luca Calligaris (MVP-Windows Embedded)
l.calliga...@eurotech.it.nospam
www.eurotech.it


"dsrking" <dsrki...@gmail.com> ha scritto nel messaggio
news:a6a29bc6-d32a-4cd5...@z15g2000prh.googlegroups.com...

dsrking

unread,
May 20, 2010, 6:22:11 AM5/20/10
to
Thanks Luca,

I want to ask one more question regarding this.

Is it possible to write virtual com port driver in wince 5.0? I got
"wince600\PUBLIC\COMMON\OAK\DRIVERS\USB\CLASS\USBSER" usb serial class
driver in wince 6.0.

1. Is it possible to integrate this class driver to wince 5.0 for
virtual com port?
2. If yes, how much work will be there in porting?
2. How can we test the virtual com port in wince 5.0 board?

thanks in advance.

With- D.

Luca Calligaris [eMVP]

unread,
May 20, 2010, 9:52:50 AM5/20/10
to
You have to define better 'virtual port': the USBSER driver handle a USB
device which follows CDC-ACM USB specs. When you connect such a device a new
serial port (let's say "COM5:") will be activated.
For the porting:

create an USBSER folder under your BSP tree. copy in it the CLIENTCMN and
USBSER folder and create a dirs file to build the folders in the previous
order

***********************
CLIENTCMN sources file:
***********************

TARGETNAME=USBCLIB
TARGETTYPE=LIBRARY
RELEASETYPE=PLATFORM

INCLUDES = $(_COMMONDDKROOT)\inc;$(_COMMONOAKROOT)\inc;


SOURCES = usbinstl.cpp usbserv.cpp

MSC_WARNING_LEVEL = $(MSC_WARNING_LEVEL) /W3 /WX

!IF "$(BUILD_BROWSE)"=="1"
CDEFINES = $(CDEFINES) -FR
!ENDIF

#xref VIGUID {9cb7942b-3831-4104-a618-fda8981e639d}
#xref VSGUID {204c6c98-f452-42ae-87be-69c782955463}


***********************
USBSER sources file:
***********************

TARGETNAME=usbser

TARGETTYPE=DYNLINK
RELEASETYPE=PLATFORM
SYNCHRONIZE_DRAIN=1

DLLENTRY=_DllMainCRTStartup

DEFFILE=$(TARGETDEFNAME).def

SOURCELIBS=$(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\com_mdd2.lib

TARGETLIBS=$(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\ceddk.lib \
$(_TARGETPLATROOT)\lib\$(_CPUINDPATH)\usbclib.lib \
$(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\usbd.lib \
$(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\serpddcm.lib \
$(_COMMONSDKROOT)\lib\$(_CPUINDPATH)\coredll.lib

INCLUDES=$(INCLUDES);..\CLIENTCMN

SOURCES=\
USBSER.cpp \
USERDEV.cpp


CDEFINES=$(CDEFINES)

MSC_WARNING_LEVEL=$(MSC_WARNING_LEVEL) /W3 /WX

!IF "$(BUILD_BROWSE)"=="1"
CDEFINES=$(CDEFINES) -FR
!ENDIF

#xref VIGUID {a43d90c5-c1cd-4516-bac0-bdb8f1d44e8a}
#xref VSGUID {bd8488e3-a124-405f-8031-c45ae314bfc5}

**********************************************

Note that you have to modify GetClientRegistryPath function in
CLIENTCMN\usbclientfunc.h since Windows Embedded CE 6.0 uses USBDI 1.3 which
defines lpGetClientRegistyPath
otherwise you'll get compiler errors. You can do it this way:


BOOL GetClientRegistryPath(LPWSTR szRegistryPath, DWORD dwRegPathUnit,
LPCWSTR szUniqueDriverId) {
//Windows Embedded CE 6.0 uses USBDI 1.3 which defines
lpGetClientRegistyPath
#if (_WINCEOSVER > 500)
DWORD dwMajorVersion;
DWORD dwMinorVersion;
GetUSBDVersion(&dwMajorVersion, &dwMinorVersion) ;
if (dwMajorVersion>1 || (dwMajorVersion == 1 && dwMinorVersion>=3))
return
m_pUsbFuncsPtr->lpGetClientRegistyPath(szRegistryPath,dwRegPathUnit,szUniqueDriverId);
else
#endif
{
StringCchCopy (szRegistryPath, dwRegPathUnit,
LEGGACY_CLIENTDRIVER_PATH);
StringCchCat(szRegistryPath, dwRegPathUnit, szUniqueDriverId);
return TRUE;
}
}


--
Luca Calligaris (MVP-Windows Embedded)

lucaDOTcalligarisATeurotechDOTcom
www.eurotech.com


"dsrking" <dsrki...@gmail.com> ha scritto nel messaggio

news:d635c081-e0aa-43c6...@g1g2000pro.googlegroups.com...

dsrking

unread,
May 22, 2010, 7:29:00 AM5/22/10
to
Hi Luca Calligaris,

Thanks for your help,

I have followed your steps and compiled the source code of USBSER and
CLIENTCMN. The usbser.dll is created.

But the problem is, when i connect usb to serial cable in my target
device, it shows "Unidentified USB Device" and asked to "Enter the
name of the driver for this USB device". And also i can't find any
hyperterminal application in my wince5.0 start -> programs menu to see
the com port name.

Could you please help me to figure out the problem?

Many Thanks & Regards,
D.

Bruce Eitman [eMVP]

unread,
May 22, 2010, 9:52:54 AM5/22/10
to
Do you have any registry entries to cause the driver to load? Is usbser.dll
actually in your OS?

--
Bruce Eitman (eMVP)
Senior Engineer
Bruce.Eitman AT Eurotech DOT com
My BLOG http://geekswithblogs.net/bruceeitman

Eurotech Inc.
www.Eurotech.com

"dsrking" <dsrki...@gmail.com> wrote in message
news:571f50e3-0b72-4362...@h37g2000pra.googlegroups.com...

dsrking

unread,
May 24, 2010, 12:57:31 AM5/24/10
to
Thanks Bruce,

I have added usbser.dll in platform.reg and platform.bib. In
platform.reg, i pointed out the usbser.reg in the usbser folder. It
looks like,

------------------------------------------------------------------------------------------------------------------------------
[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\1118_121\Default\Default
\USBSER_CLASS]
"Prefix"="COM"
"Dll"="USBSer.DLL"

[HKEY_LOCAL_MACHINE\Drivers\USB\ClientDrivers\USBSER_CLASS]
"Prefix"="COM"
"Dll"="USBSer.DLL"
"DeviceArrayIndex"=dword:1
"RxBufferSize"=dword:4000
"IClass"="{CC5195AC-BA49-48a0-BE17-DF6D1B0173DD}"

[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\1118_206\Default\Default
\SERIAL_CLASS]
"Prefix"="COM"
"Dll"="USBSer.DLL"

[HKEY_LOCAL_MACHINE\Drivers\USB\ClientDrivers\SERIAL_CLASS]
"Prefix"="COM"
"Dll"="USBSer.DLL"
"RxBufferSize"=dword:4000
"DeviceArrayIndex"=dword:0
"IClass"="{CC5195AC-BA49-48a0-BE17-DF6D1B0173DD}"

-----------------------------------------------------------------------------------------------------------------------------

But the problem is occurred again n again. The debug output is,

151710 PID:8e7b9692 TID:6e5c7236 0x8e5c5cbc: >>> Loading module
usbser.dll at address 0x02250000-0x0226C000 (RW data at
0x01E08000-0x01E08658)
Loaded symbols for 'C:\WINCE500\PBWORKSPACES\SHTEST\RELDIR\Temp_DEBUG
\USBSER.DLL'
151716 PID:8e7b9692 TID:6e5c7236 0x8e5c5cbc: <<< Unloading module
usbser.dll at address 0x02250000-0x0226C000 (RW data at
0x01E08000-0x01E08658)
Unloaded symbols for 'C:\WINCE500\PBWORKSPACES\SHTEST\RELDIR\Temp_DEBUG
\USBSER.DLL'
151752 PID:e57e86a TID:6e5c7236 0x8e5c5cbc: DlgMgr: FindDlgItem id 1
returning NULL.
154150 PID:8e7b9692 TID:6e6a6fbe 0x8e6a4644: NeighborAdvertReceive:
Received option with bogus length
164152 PID:e57e86a TID:6e5c7236 0x8e5c5cbc: DlgMgr: FindDlgItem id 1
returning NULL.

================================================================

Waiting for your reply.

Thanks,
D.

dsrking

unread,
May 25, 2010, 11:01:01 AM5/25/10
to
Hi,

Actually the problem is that not loading of class driver. my host
controller driver is loading properly and the control transfer is
finished with set configuration. after that it can't find the class
driver. But i don't know how can we solve it?

Is there anyway to call my back ported usbser.dll to load?

with many thanks.

Regards- D.

Bruce Eitman [eMVP]

unread,
May 25, 2010, 11:29:46 AM5/25/10
to
What is the vendor ID and product ID of you USB device? Does it match the
registry settings that you added?

--
Bruce Eitman (eMVP)
Senior Engineer
Bruce.Eitman AT Eurotech DOT com
My BLOG http://geekswithblogs.net/bruceeitman

Eurotech Inc.
www.Eurotech.com

"dsrking" <dsrki...@gmail.com> wrote in message

news:c50a614a-dfc7-4dfa...@q36g2000prg.googlegroups.com...

dsrking

unread,
May 25, 2010, 11:52:26 AM5/25/10
to
hi Bruce,

i have connected the usb-serial cable for my testing. where we check
the vendor id and device id is added in registry setting?

Note: this usb-serial cable is working in windows xp machine. very
first time,when i connect this cable to xp machine, it asks for
driver. The vendor(usb-serial cable) gave one driver for windows xp. i
installed this driver n it works fine in xp.

In WinCE5.0, how can we give this driver.

please clarify my doubt.

thanks in advance.

--D.

Bruce Eitman [eMVP]

unread,
May 25, 2010, 12:13:22 PM5/25/10
to
The keys that you added to the registry:

[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\1118_121\Default\Default
\USBSER_CLASS]

[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\1118_206\Default\Default
\SERIAL_CLASS]

1118 is the vendor ID that you added (base 10)
121 and 206 are the product IDs that you added (also base 10)

--
Bruce Eitman (eMVP)
Senior Engineer
Bruce.Eitman AT Eurotech DOT com
My BLOG http://geekswithblogs.net/bruceeitman

Eurotech Inc.
www.Eurotech.com

"dsrking" <dsrki...@gmail.com> wrote in message

news:a54a692b-62f4-45ce...@n37g2000prc.googlegroups.com...

dsrking

unread,
May 26, 2010, 2:56:38 AM5/26/10
to
Thanks Bruce,

I have added the vendor/device id in usbser.reg. but the same problem
is occurred.

I am missing something in settings. but i don't exactly.

please advice on the same.

Regards - D.


dsrking

unread,
May 26, 2010, 2:56:43 AM5/26/10
to
Thanks Bruce,

I have added the vendor/device id in usbser.reg. but the same problem

dsrking

unread,
May 26, 2010, 2:56:59 AM5/26/10
to
Thanks Bruce,

I have added the vendor/device id in usbser.reg. but the same problem

dsrking

unread,
May 26, 2010, 2:56:55 AM5/26/10
to
Thanks Bruce,

I have added the vendor/device id in usbser.reg. but the same problem

Bruce Eitman [eMVP]

unread,
May 26, 2010, 7:33:30 AM5/26/10
to

At this point you need to do some debugging. The driver might not be
handling the attach request correctly for the device you are connecting.

--
Bruce Eitman (eMVP)
Senior Engineer
Bruce.Eitman AT Eurotech DOT com
My BLOG http://geekswithblogs.net/bruceeitman

Eurotech Inc.
www.Eurotech.com

"dsrking" <dsrki...@gmail.com> wrote in message

news:78b4f429-44c9-4a42...@u20g2000pru.googlegroups.com...

0 new messages