Problem with USB v2.0 for CDC Serial Demo Code

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Problem with USB v2.0 for CDC Serial Demo Code

1,957 次查看
raven
Contributor I
I'm having a real problem with the code on cdc-serial-demo. I'm trying to configure the device descriptors on cdcs_usb_config.c specifically on the USB version part. The default is 0x0110 for USB ver1.1 but I want to make it 0x0200 for USB ver2.0. However when i tried this, a "!" symbol on the com port where the USB is connected appears and says
 
The device cannot start.(code 10)
 
So what seems to be the problem for this? Do i need to add additional codes or does the .inf file has something to do with this?
 
Please help me on this guys.
 
Thanks!
标签 (1)
0 项奖励
回复
2 回复数

813 次查看
fabio
Contributor IV
Hello Raven,

The USB standard descriptors (as well as all requests and responses) use little-endian ordering, so the 2.00 must be written as 0x0002!

Also, I think you mistyped the default value (in my case it is 0x0101).

I tried it here and it worked ok.

Regards,
0 项奖励
回复

813 次查看
raven
Contributor I
Hi Fabio,
 
But here is the trick part.. I've done an experiment with the hex code and here's what i've found out.
 
1. When I tried writing 0x01YY to the hex code (the YY  is any number combination from 00-99), the    
    computer can recognize the device and the device works properly.
2. When I tried writing 0x00YY to the hex code (the YY is number combination from 00-99), the
    computer can recognize the device and it works well.
3. When I tried writing 0xZZYY to the hex code ( the ZZ is any number combination from 02-99), the
    computer cannot recognize the device and it says The device cannot start(code 10). What is the main
    reason for this?
0 项奖励
回复