I've been busy building a CDC + HID composite USB device for the past couple of weeks, and stuck with This device cannot start. (Code 10) error in Windows 7.
When looking at the device through USBlyzer, I can see the device successfully communicates with the PC, as USBlyzer is able to extract both the USB device and configuration descriptors. USBlyzer isn't pointing out any errors, making it difficult to see what exactly is wrong.
The project is really simple, and there are basically three important files:
- main.c - The main application source.
- usb_config.h - Some configuration defines.
- usb_descriptors.h - USB device and configuration descriptors.
The project is basically derived from the Device - Composite - MSD + CDC example from Microchips' Libraries for Applications. I've double checked that descriptor size values are correct, and been over the code a dozen times, but not sure what's causing my headaches.
My breadboard setup looks like this, and it is working quite well, since I've tested it with an HID only example, and it worked perfectly (So the problem is definitely somewhere in my code):
The setup uses a PIC32MX250F128B MCU from Microchip, with an LDO on the top right which steps the VUSB 5V down to 3.3V for the MCU Vdd supply. A 12MHz crystal supplies a clock signal to the MCU, which is used to configure the USB Module clock to 48MHz (see configuration bits in the source code). The green LED lights up when USBDeviceState == CONFIGURED_STATE and the red LED simply indicates that the 3.3V supply is on.
The device is visible in Device Manager:
...but off course Windows 7 isn't happy:
Here's the report from USBlyzer:
Some more output from USBTrace, could the problem be to do with configuration selection?
I have no idea what's wrong, and have been trying this entire week to fix this.
Please can someone try to help?