Author Topic: USB enumeration - 4 questions  (Read 14397 times)

dodge55

  • Member
  • ***
  • Posts: 2
USB enumeration - 4 questions
« on: November 02, 2010, 04:57:14 pm »
I have a security device that enumerates properly and the driver installs using COM25.  However, I get 'Cannot Start this Hardware.  The device cannot start Code (10).'  What causes this? 

I used Jan's Device Descriptor in the CDC Device Section with MAXPACKETSIZE = 8.  That causes enumeration not to work.  When I use 64, which is common from other descriptors I see online, it works.  Is this a made up size?  What would cause it to work with 64 and not with 8?

My device installs on COM25.  I was a little surprised, because I don't have that many devices installed.  In Device Manager (WinXP), I have 4 COM devices, 1,2,13, and 25.  If I go to my device and act like I'm going to change the port number, it shows 1-25 in use.  Why the discrepancy?  I tried rebooting, and no change.  Is there a tool that shows what processes are using which COM port?  Are there TSRs from startup that are creating virtual COM ports in the background that transparent to the user?

There are a lot of enumeration writeups online.  Jan's book is very good.  Is there a writeup on enumeration (say for a CDC) that shows more detailed steps on how the host and device send, receive, and interpret the data to get a better understanding of what is done behind the scenes.  For example, I use a analyzer to show USB data and for the most part, I understand the data.  However, there are cases where a GET STRING DESCRIPTOR command is done multiple times.  It looks like it gets through the index, manufacturer, version, etc.  However, it seems to ask for this info sometimes up to four times.  Some other times twice.  It's random.  It would be nice to understand what the host is wanting and for what reason.

Sutton

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: USB enumeration - 4 questions
« Reply #1 on: November 02, 2010, 05:56:51 pm »
"The device cannot start" means that the host had a problem with communications. It can be just about anything. A protocol analyzer would likely show the problem.

The descriptors can specify any legal packet size. The firmware is typically written to work with the max packet size in the descriptors, so changing the max packet size without also editing the firmware might not work.

A virtual COM-port device that doesn't contain a serial number gets a new COM port on each attachment to a different port on the system (assuming Windows). Perhaps the OS is remembering previous devices on your machine.

Multiple requests for a descriptor sometimes occur because multiple drivers are interested in the information. If a received string descriptor is flawed, the host might give it another try before giving up. I don't know why the requests would vary from time to time with the same device on the same host, but the device's job is to obey the host and not question why.

Hope that helps.

Jan




dodge55

  • Member
  • ***
  • Posts: 2
Re: USB enumeration - 4 questions
« Reply #2 on: November 03, 2010, 02:27:06 pm »
Yes.  Your comments helped.  Thanks.

However, on the 'Device cannot start', my analyzer just shows a timeout after the Set Configuration = 1 command.  So, not sure why the device 'cannot start'.

Sutton

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: USB enumeration - 4 questions
« Reply #3 on: November 03, 2010, 09:23:03 pm »
The device ACKs the Set_Configuration request?

No other traffic to the device?

Post your descriptors.

Jan