We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hey!
we're having a problem with our USB-device...it's a composite device with 3 interfaces, a normal cdc interface, a cdc data interface and a costum interface.
Using windows XP, everthing is fine, it work's as intended, but with Windows Vista/Seven it doesn't.
Logging the transfers it say's an illegal_parameter while selecting the configuration. (seven/vista).
000029: Select Configuration (UP), 25.09.2009 22:07:21.463 +0.0. Status: 0x80000300 Configuration Index: 1 Configuration Handle: 0x0
Somehow strange is that the device works using a Win Seven/Vista - VM (VMWare Workstation 6.5) on a Seven host - no idea why ;)
We're using the interface association descriptor...maybe that's the problem.
Here's the complete config descriptor
/* USB configuration descriptor */ 9, /* sizeof(usbDescrConfig): length of descriptor in bytes */ USBDESCR_CONFIG, /* descriptor type */ 84, 0, /* total length of data returned (including inlined descriptors) */ 3, /* number of interfaces in this configuration */ 1, /* index of this configuration */ 0, /* configuration name string index */ #if USB_CFG_IS_SELF_POWERED USBATTR_SELFPOWER, /* attributes */ #else USBATTR_BUSPOWER, /* attributes */ #endif USB_CFG_MAX_BUS_POWER/2, /* max USB current in 2mA units */ /* IAD descriptor */ 8, 11, // bDescriptorType = 11 0x00, // bFirstInterface 0x02, // bInterfaceCount 0x02, // bFunctionClass (Communication Class) 0x02, // bFunctionSubClass (Abstract Control Model) 0x01, // bFunctionProcotol (V.25ter, Common AT commands) 0x00, // iInterface /* Test */ /* interface descriptor follows inline: */ 9, /* sizeof(usbDescrInterface): length of descriptor in bytes */ USBDESCR_INTERFACE, /* descriptor type */ 0, /* index of this interface */ 0, /* alternate setting for this interface */ USB_CFG_HAVE_INTRIN_ENDPOINT, /* endpoints excl 0: number of endpoint descriptors to follow */ USB_CFG_INTERFACE_CLASS, USB_CFG_INTERFACE_SUBCLASS, USB_CFG_INTERFACE_PROTOCOL, 0, /* string index for interface */ /* CDC Class-Specific descriptor */ 5, /* sizeof(usbDescrCDC_HeaderFn): length of descriptor in bytes */ 0x24, /* descriptor type */ 0, /* header functional descriptor */ 0x10, 0x01, 4, /* sizeof(usbDescrCDC_AcmFn): length of descriptor in bytes */ 0x24, /* descriptor type */ 2, /* abstract control management functional descriptor */ 0x02, /* SET_LINE_CODING, GET_LINE_CODING, SET_CONTROL_LINE_STATE */ 5, /* sizeof(usbDescrCDC_UnionFn): length of descriptor in bytes */ 0x24, /* descriptor type */ 6, /* union functional descriptor */ 0, /* CDC_COMM_INTF_ID */ 1, /* CDC_DATA_INTF_ID */ 5, /* sizeof(usbDescrCDC_CallMgtFn): length of descriptor in bytes */ 0x24, /* descriptor type */ 1, /* call management functional descriptor */ 3, /* allow management on data interface, handles call management by itself */ 1, /* CDC_DATA_INTF_ID */ /* Endpoint Descriptor */ 7, /* sizeof(usbDescrEndpoint) */ USBDESCR_ENDPOINT, /* descriptor type = endpoint */ 0x83, /* IN endpoint number 3 */ 0x03, /* attrib: Interrupt endpoint */ 8, 0, /* maximum packet size */ USB_CFG_INTR_POLL_INTERVAL, /* in ms */ /* Interface Descriptor */ 9, /* sizeof(usbDescrInterface): length of descriptor in bytes */ USBDESCR_INTERFACE, /* descriptor type */ 1, /* index of this interface */ 0, /* alternate setting for this interface */ 2, /* endpoints excl 0: number of endpoint descriptors to follow */ 0x0A, /* Data Interface Class Codes */ 0, 0, /* Data Interface Class Protocol Codes */ 0, /* string index for interface */ /* Endpoint Descriptor */ 7, /* sizeof(usbDescrEndpoint) */ USBDESCR_ENDPOINT, /* descriptor type = endpoint */ 0x01, /* OUT endpoint number 1 */ 0x02, /* attrib: Bulk endpoint */ HW_CDC_BULK_OUT_SIZE, 0, /* maximum packet size */ 0, /* in ms */ /* Endpoint Descriptor */ 7, /* sizeof(usbDescrEndpoint) */ USBDESCR_ENDPOINT, /* descriptor type = endpoint */ 0x81, /* IN endpoint number 1 */ 0x02, /* attrib: Bulk endpoint */ HW_CDC_BULK_IN_SIZE, 0, /* maximum packet size */ 0, /* in ms */ /* usbasp descriptor */ 9, /* sizeof () usbasp descriptor */ USBDESCR_INTERFACE, /* descriptor Type */ 2, /* index for this interface */ 0, /* alternate Setting for this interface */ 0, /* number of endpoint descriptros to follow */ 0, /* interface class */ 0, /* interface subclass */ 0, /* interface protocol */ 0, /* string index for interface */
Here's the device descriptor:
18, /* sizeof(usbDescriptorDevice): length of descriptor in bytes */ USBDESCR_DEVICE, /* descriptor type */ 0x10, 0x01, /* USB version supported */ 0xEF, /* USB_CFG_DEVICE_CLASS */ 0x02, /* USB_CFG_DEVICE_SUBCLASS */ 1, /* protocol */ 8, /* max packet size */ /* the following two casts affect the first byte of the constant only, but * that's sufficient to avoid a warning with the default values. */ (char)USB_CFG_VENDOR_ID,/* 2 bytes */ (char)USB_CFG_DEVICE_ID,/* 2 bytes */ USB_CFG_DEVICE_VERSION, /* 2 bytes */ USB_CFG_DESCR_PROPS_STRING_VENDOR != 0 ? 1 : 0, /* manufacturer string index */ USB_CFG_DESCR_PROPS_STRING_PRODUCT != 0 ? 2 : 0, /* product string index */ USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER != 0 ? 3 : 0, /* serial number string index */ 1, /* number of configurations */
if you need the complete config descriptor, i'll post it, but it's pretty long ;)
Every idea will be appreciated ;)
Thanks, Kai
I don't see any error on the descriptors.
On the sniffer, you'll see Get_Descriptor( Config ) twice just before Set_Configuration (Select Config). First one requests just 9 bytes, for config descriptor. And second one does full set of config descriptors. Check the contents of replies for these Get_Descriptor. Do they match to this descriptor?
The major difference of VM from real machine is timing. VM is slower than real. Shorter request interval may cause timing error on the firmware.
Another difference of Vista / Win7 vs XP is INF file for CDC. Vista / Win7 stores usbser.sys in .cab file as the default, not in the driver folder. In this reason, INF file refers in-box mdmcpq.inf, which defines the source disk as FakeModemCopyFileSection, as follows.
[MYDEV000.NT] include=mdmcpq.inf CopyFiles=FakeModemCopyFileSection AddReg=MYDEV000.NT.AddReg
Tsuneo
hey!
at first: thanks for your response!
second, yes, they match...it's the right descriptor arriving at the PC...
As we actually only modified 2 devices and merged them into a composite we didn't changed much from the original devices, both working under Vista/Seven.
As we're getting an INVALID_PARAMETER return from the URB set config i don't know whether it's a timing error... is there a possibility to test it and to exclude this possible issue?
@the CDC inf: yeah, right :) using the VM I'm using a different inf for these systems now.
yesterday i tested another usb-sniffer and found another error:
PnP IRP Query Interface failed Device Object USBPDO-8 Driver Object usbhub IRP Minor Function IRP_MN_QUERY_INTERFACE IRP Status STATUS_NOT_SUPPORTED
and
PnP IRP Query Interface failed Device Object 00000091 Driver Object usbccgp IRP Minor Function IRP_MN_QUERY_INTERFACE IRP Status STATUS_NOT_SUPPORTED
using googel i haven't found anything helpfull... maybe here's the real problem?
PnP event is not helpful to find clue for enumeration problem.
Did you change VID/PID (at least PID) for this new device configuration? Windows holds device configuration on the registry. It isn't refreshed when the device config changed. This Windows feature often causes problem on enumeration of new device.
mmh ok...
no, we actually didn't as we're trying to upgrade an existing device and we don't want to change existing libraries which use that pair...
but this seven here has never seen old versions as i installed it after we made the actual version.
i just tried the usb command verifier 2.0 from usb.org... our (low-speed) device kicks the standard at some parts, but as i said we only combined two devices we have the errors joined by both devices which are working under seven...
is there any way to get more information than the "illegal parameter"? if i would know what is illegal it'll maybe help :)
> is there any way to get more information than the "illegal parameter"?
It's configuration "1", as it tells. :-) ie. Windows doesn't like configuration 1 on your descriptor.
It also suggests conflict of the descriptor with the registry.
Delete (uninstall) all device instances of the VID/PID once using USBDeview, And re-install the INF file.
USBDeview www.nirsoft.net/.../usb_devices_view.html
I posted an example of a composite device of CDC + HID using IAD at the top of this topic on SiLabs USB forum,
USB composite device www.cygnal.org/.../001050.html USB_CDC_HID_IAD_10.zip
It has enumerated fine on XP-SP3 and Vista-SP1 (not tested on Win7 yet). Compare descriptors and INF file with yours. These are common to the implementations of all USB chips.
> our (low-speed) device kicks the standard at some part
I noticed this comment, Are you making CDC on Low-Speed (LS)?
Umm... The bulk EPs on CDC are not allowed on LS. One of my friend has implemented CDC on LS on XP, changing the bulk EPs into interrupt ones. But I don't know if such a trick work on Vista and Win7 or not.
Why do you make it on LS? Change it to Full-Speed.
ok, I think I'm one little step further in understanding the issue :)
let me at first reply to your posts:
I compared the descriptors but there wasn't a big difference, I tried a few changes, but no success.
Yeah, I'm trying to create a low speed cdc...and yes, it's not allowed, but as I'm using a simple atmega8 with a software usb lib (vusb) there's no way for high speed usb. Maybe your referring to the avr-cdc project, but that's what I wanted to use to make low-speed cdc devices possible under vista/seven. it work's under seven, I tested it this afternoon ;) recursion.jp/.../driver.html
just trying out some small things i noticed that the descriptor is accepted as long as a valid inf (actually an inf for only one part of the device) is there...so I tried what you said, I installed my infs as legacy devices, address USB\VID_16C0&PID_05DC&MI_00 and USB\VID_16C0&PID_05DC&MI_02. after plugging the device in, it still doesn't want the descriptor...
now here's a guess: plugging the device in gives the illegal parameter, rejecting the device so that the usb common class generic parent driver (which splits the device and appends the MI_xx to the identifier) doesn't do a thing, and further the inf's aren't mapped to the right device.
in your example you need the usbccgp so the cdc-inf is mapped to the device at MI_00...
what i see now there are 2 possibilitys...
1.) creating an inf for both parts of the composite device to install before the first plugin as a legacy device (maybe without requiring the usbccgp?) i would be happy if it would be able to plug'n'play as it does under xp :(
or
2.) making the device stop saying "invalid parameter" so the usbccgp can do it's job with the MI_xy so 2 seperate infs are ok.
is that correct?
thanks for your responses, kai
Ah, bit-banging USB...
Sorry, I don't have no interest on it. Making bit-banging USB is fun as a hobby. So, I send cheer to you.
But using bit-banging USB is another story. It goes out of USB spec, sacrifices reliability to force the code and timing into the poor MCU. On the market, low-cost MCUs with full-speed USB are available. AT90USB for AVR, C8051F326/7, PIC18F1XK50, MSP430F55xx, MC9S08JS16, etc.
Then, why we need to use poor bit-banging USB?
:(
well, I can understand you ;)
Why we need a bit banging driver? - it's supposed to be a beginners project -> no tqfp packages and the usb atmels are only produced in smd. - many people have that isp programmer with the hardware feature...would be cool to activate that feature without changing the hardware ;)
I don't think the software usb is the reason for the descriptor problems... (ok, not more than forcing us to low-speed) maybe that's enough motivation, I would hope so, you're actually my only hope at the moment :)
If not, thank you very much for your help!
Possible reason is, Host controller rejects the endpoint setting, because of low-speed.
- bulk --> interrupt or - endpoint wMaxPacketSize <= 8 byte
Though the config exceeds 2 endpoints limit of low-speed, it doesn't matter.
VM assigns a virtual host controller, which is different from the real one. Host controller behavior of out of spec depends on (virtual) chip.
usbccgp is common in real and virtual. So, it can't be the reason.
> it's supposed to be a beginners project
Project? It's a toy for beginners, to use it as is :-) I don't think they are able to change the coding in precise timing.