EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

USB CDC-ACM INF File?

Started by thirdshoedrops December 31, 2008
I set about learning how USB works, and managed to put together a
CDC-ACM device. (I thought I'd be able to do a cleaner, more flexible
implementation than LPCUSB, but mine turned out to just be different.
Perhaps there isn't any clean way to do USB -- it's just a complex,
stateful, highly-interconnected mess.)

Anyway, my device enumerates under Linux and I can talk to it using
Minicom, but I can't convince Windows to recognize it. I think I need
an INF file, but none of the examples posted to this group (or others
I've found through Google) work.

My device identifies itself as VID=0x1234, PID=0xABCD, and my INF file
is below. Windows says "Can't load this device" (or something very
similar). The USB enumeration that Linux sees (which shows my
interfaces, endpoints & etc.):

Bus 001 Device 009: ID 1234:abcd
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.01
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x1234
idProduct 0xabcd
bcdDevice 0.99
iManufacturer 1 EMF Inc.
iProduct 2 Simple Serial Interface
iSerial 3 THX1138
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 67
bNumInterfaces 2
bConfigurationValue 1
iConfiguration 4 Primary Configuration
bmAttributes 0x80
(Bus Powered)
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 2 Communications
bInterfaceSubClass 2 Abstract (modem)
bInterfaceProtocol 1 AT-commands (v.25ter)
iInterface 5 Control Interface
CDC Header:
bcdCDC 1.20
CDC Call Management:
bmCapabilities 0x01
call management
bDataInterface 0
CDC ACM:
bmCapabilities 0x0f
connection notifications
sends break
line coding and serial state
get/set/clear comm features
CDC Union:
bMasterInterface 0
bSlaveInterface 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 30
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 10 CDC Data
bInterfaceSubClass 0 Unused
bInterfaceProtocol 0
iInterface 6 Data Interface
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Device Status: 0x0000
(Bus Powered)

---------------- INF File --------------------------

; Windows USB CDC ACM Setup File
; Copyright (c) 2000 Microsoft Corporation
; Copyright (C) 2007 Microchip Technology Inc.
; Modified by Xiaofan Chen for lpcusb CDC example

[Version]
Signature="$Windows NT$"
Class=Ports
ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
Provider=%MFGNAME%
LayoutFile=layout.inf
CatalogFile=%MFGFILENAME%.cat
DriverVer/15/2007,5.1.2600.0

[Manufacturer]
%MFGNAME%iceList, NTamd64

[DestinationDirs]
DefaultDestDir

;----------------------
; Windows 2000/XP/Vista-32bit Sections
;----------------------

[DriverInstall.nt]
include=mdmcpq.inf
CopyFiles=DriverCopyFiles.nt
AddReg=DriverInstall.nt.AddReg

[DriverCopyFiles.nt]
usbser.sys,,,0x20

[DriverInstall.nt.AddReg]
HKR,,DevLoader,,*ntkern
HKR,,NTMPDriver,,%DRIVERFILENAME%.sys
HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"

[DriverInstall.nt.Services]
AddService=usbser, 0x00000002, DriverService.nt

[DriverService.nt]
DisplayName=%SERVICE%
ServiceType=1
StartType=3
ErrorControl=1
ServiceBinary=%12%\%DRIVERFILENAME%.sys

;----------------------
; Vista-64bit Sections
;----------------------

[DriverInstall.NTamd64]
include=mdmcpq.inf
CopyFiles=DriverCopyFiles.NTamd64
AddReg=DriverInstall.NTamd64.AddReg

[DriverCopyFiles.NTamd64]
%DRIVERFILENAME%.sys,,,0x20

[DriverInstall.NTamd64.AddReg]
HKR,,DevLoader,,*ntkern
HKR,,NTMPDriver,,%DRIVERFILENAME%.sys
HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"

[DriverInstall.NTamd64.Services]
AddService=usbser, 0x00000002, DriverService.NTamd64

[DriverService.NTamd64]
DisplayName=%SERVICE%
ServiceType=1
StartType=3
ErrorControl=1
ServiceBinary=%12%\%DRIVERFILENAME%.sys

;----------------------
; Vendor and Product ID Definitions
;----------------------
; When developing your USB device, the VID and PID used in the PC side
; application program and the firmware on the microcontroller must match.
; Modify the below line to use your VID and PID. Use the format as shown
below.
; Note: One INF file can be used for multiple devices with different
VID and PIDs.
; For each supported device, append ",USB\VID_xxxx&PID_yyyy" to the
end of the line.
;----------------------
[SourceDisksFiles]
[SourceDisksNames]
[DeviceList]
%DESCRIPTION%=DriverInstall, USB\VID_1234&PID_abcd

[DeviceList.NTamd64]
%DESCRIPTION%=DriverInstall, USB\VID_1234&PID_abcd

;----------------------
; String Definitions
;----------------------
;Modify these strings to customize your device
;----------------------
[Strings]
MFGFILENAME="EMF Inc."
DRIVERFILENAME ="usbser"
MFGNAME="Simple Serial Interface"
INSTDISK="EMF Installation Disc"
DESCRIPTION="Fake Communications Port"
SERVICE="USB RS-232 Emulation Driver"

An Engineer's Guide to the LPC2100 Series

On Thu, Jan 1, 2009 at 8:05 AM, thirdshoedrops
wrote:

> My device identifies itself as VID=0x1234, PID=0xABCD, and my INF file
> is below. Windows says "Can't load this device" (or something very
> similar). The USB enumeration that Linux sees (which shows my
> interfaces, endpoints & etc.):
>
> Bus 001 Device 009: ID 1234:abcd
> Device Descriptor:
> bLength 18
> bDescriptorType 1
> bcdUSB 1.01
> bDeviceClass 0 (Defined at Interface level)

Try use 2 (Communication device). That is the value
I see in the USB to serial converters and lpcusb example.

> bDeviceSubClass 0
> bDeviceProtocol 0
Regards,
Xiaofan

--- In l..., "Xiaofan Chen" wrote:
> > bDeviceClass 0 (Defined at Interface level)
>
> Try use 2 (Communication device). That is the value
> I see in the USB to serial converters and lpcusb example.
>
> > bDeviceSubClass 0
> > bDeviceProtocol 0

I tried 2/0/0 and 2/2/1, but no luck. (I also compiled a standard
LPCUSB serial port and tried that, but I couldn't get any of the .INF
files in the distribution to cause the proper driver to be loaded on
XP.) I guess I'll have to find a Windows guru to help me -- this is
way outside my area of competence.

Fortunately, it all works correctly on Linux, which is all I really
care about. I just thought it'd be nice if I could figure out how to
get it working on Windows too.
Hello,

do you have a fully patched Win XP with SP3 ?

If yes, it could be helpful to search forum of www.usb.org
or even post your message (including descriptors) there.

Regards,

Martin

--- In l..., "thirdshoedrops"
wrote:
>
> --- In l..., "Xiaofan Chen" wrote:
> > > bDeviceClass 0 (Defined at Interface level)
> >
> > Try use 2 (Communication device). That is the value
> > I see in the USB to serial converters and lpcusb example.
> >
> > > bDeviceSubClass 0
> > > bDeviceProtocol 0
>
> I tried 2/0/0 and 2/2/1, but no luck. (I also compiled a standard
> LPCUSB serial port and tried that, but I couldn't get any of the .INF
> files in the distribution to cause the proper driver to be loaded on
> XP.) I guess I'll have to find a Windows guru to help me -- this is
> way outside my area of competence.
>
> Fortunately, it all works correctly on Linux, which is all I really
> care about. I just thought it'd be nice if I could figure out how to
> get it working on Windows too.
>

> [DeviceList]
> %DESCRIPTION%=DriverInstall, USB\VID_1234&PID_abcd
>
> [DeviceList.NTamd64]
> %DESCRIPTION%=DriverInstall, USB\VID_1234&PID_abcd
>
>

I'm not an M$ expert, anyway try to change "abcd" with "ABCD" ;)

...ad seriously: you have to analyze some USB traffic with software or
hardware tools.
Dig this list for more info.

Regards.


The 2024 Embedded Online Conference