2010-06-02 06:28 PM
A BULK device works without its configuration been set
#usb-enumeration #usb-enumeration2011-05-17 04:53 AM
Hi,
Having bDeviceState not configured does not affect the functionalities of the device (it is normal that all other operations are OK). Now this variable is set to CONFGURED state mainly in one place: XXX_SetConfiguration function which is called when a SetConfig request is issued by the host. If it is not done it means that your device didn't receive correctly the SetConfig request or your number of configuration is not correct. Verify your device config descriptor to check this. There is no issue that the Host requests Device_Qualifier, the response of the device is correct (STALL). If you can send a snapshot of the USB analyser it would help understand the situation. Cheers.2011-05-17 04:53 AM
Hi! Chicos,
Thank you for your help. Really? it surprises me that an ''unconfigurated'' device can be seen as normal.The attached is the captured data from the ''Total Phase'' Beagle's data center during the enumeration. The first returned configuration descriptor is at index# 51, a complete descriptor is at index# 87 where the bInterfaceClass, subClass and protocol fields are all changed to 00. The ''STALL'' happens at index# 99.
I had look through them a few times but just can't see any wrong. Please take a look.
Best Regards,2011-05-17 04:53 AM
Hi,
''Really? it surprises me that an ''unconfigurated'' device can be seen as normal.''--> I just said that from device firmware point of view the fact the device is not configured does not affect in any way the functionalities of this particular example. It is not a correct scenario, but this variable (bDeviceState) is not checked anywhere in the code (that is not the case, for instance, for the Virtual COMPort demo or the CustomHID demo, where this variable is mandatory). Now from the communication snapshot, I can see Two things: 1) That the bInterfaceClass field in the interface descriptor is set to 0x00 while this value seems to be reserved in the usb2.0 specification:''Class code (assigned by the USB-IF).
A value of zero is reserved for future
standardization.
If this field is set to FFH, the interface
class is vendor-specific.
All other values are reserved for
assignment by the USB-IF.'' Try to use the value 0xFF instead. 2) That the host has never issued a SetConfiguration request and this is not normal at all. I think there are some possibilities: - Something wrong with the host driver (host assumes that device is already configured or assumes that device cannot be configured, unsupported protocol...): Are you sure that your host driver supports the provided protocol and sub-protocol (0x00) as well as the interface protocol 0x00 or 0xFF ... ? - Something wrong in the configuration or interface descriptors you are providing to the host (I think there is no issue in the configuration descriptor, but may be the interface descriptor is wrong as I mentioned above). - Something wrong with the device type recorded into the PC configuration (if you are using Windows): try to modify the VID/PID or the device serial string descriptor in order to make host understand that this is a new device and it should not assume that it is a known one. One hint: if you need simple mass storage example (so Bulk example) why don't you simply use the Virtual ComPort demo which is much easier to modify and more adapted to your needs ? I hope this could help you a little :) Cheers.
2011-05-17 04:53 AM
Hi! Chikos,
This morning I try on using 0xFF on bInterfaceClass, subClass and protocol fields and the result is the same. Later I changed the PID from 0x5721 to 0x6721. It gets the same result too. The analyzer catchs the same enumeration data as before. I test this on two different PC and get no difference. The host driver ''libusb-win32'' I used is a public one, get from the web. Its documents didn't mention anything about enumeration. I have no idea abut the USB driver either. Does the driver involves in the enumeration process? Thanks for your hint also. Yes, it will be much easier to modify the Virtual Com example instead of the Mass Storage one(at least the number of files is 7 vs. 17). I chose it is just because I had run this example before. No lucky:-( Best Regards,