USB问题请教: 本人用国半的芯片USBN9604做一USB device,设备是自给电源式的,CPU用S3C4510B。 现在遇到的问题是:
1. 我本来想往PC报是USB demo的设备,但PC上往往只显示USB device。 2. 相同的程序,我延时几妙复位USBN9604芯片,并重新初始化,这样反复很多次后,PC机上能正确显示USB demo设备。 3. 用Bus hound抓包发现显示USB device时抓到的包比正常显示USB demo的包多了一些。 请问这可能是什么原因引起的?希望各位高人指点一下,万分感激!!!
附:用Bus hound抓到的包 1.PC正确显示USB demo设备时抓到的包: Bus Hound 5.00 capture. Complements of www.perisoft.net
demo
Device - Device ID (followed by the endpoint for USB devices) (14) USB Root Hub Phase - Phase Type CTL USB control transfer DI Data in Data - Hex dump of the data transferred Descr - Description of the phase Cmd... - Position in the captured data
Device Phase Data Description Cmd.Phase.Ofs(rep) ------ ----- ------------------------ ---------------- ------------------ 14.1 DI 04 . 1.1.0 14.0 CTL a3 00 00 00 02 00 04 00 GET STATUS 2.1.0(2) 14.0 DI 01 01 01 00 .... 2.2.0 14.0 CTL 23 01 10 00 02 00 00 00 CLEAR FEATURE 4.1.0 14.0 CTL a3 00 00 00 01 00 04 00 GET STATUS 5.1.0 14.0 DI 00 01 00 00 .... 5.2.0 14.0 CTL a3 00 00 00 02 00 04 00 GET STATUS 6.1.0(2) 14.0 DI 01 01 00 00 .... 6.2.0 14.0 CTL 23 03 04 00 02 00 00 00 SET FEATURE 8.1.0 14.1 DI 04 . 9.1.0 14.0 CTL a3 00 00 00 02 00 04 00 GET STATUS 10.1.0 14.0 DI 03 01 10 00 .... 10.2.0 14.0 CTL 23 01 14 00 02 00 00 00 CLEAR FEATURE 11.1.0 14.0 CTL a3 00 00 00 02 00 04 00 GET STATUS 12.1.0 14.0 DI 03 01 00 00 .... 12.2.0 14.0 CTL 80 06 00 01 00 00 40 00 GET DESCRIPTOR 13.1.0 14.0 DI 12 01 10 01 00 00 00 08 ........ 13.2.0 14.0 CTL a3 00 00 00 02 00 04 00 GET STATUS 14.1.0 14.0 DI 03 01 00 00 .... 14.2.0 14.0 CTL 23 03 04 00 02 00 00 00 SET FEATURE 15.1.0 14.1 DI 04 . 16.1.0 14.0 CTL a3 00 00 00 02 00 04 00 GET STATUS 17.1.0 14.0 DI 03 01 10 00 .... 17.2.0 14.0 CTL 23 01 14 00 02 00 00 00 CLEAR FEATURE 18.1.0 14.0 CTL 00 05 02 00 00 00 00 00 SET ADDRESS 19.1.0 14.0 CTL 80 06 00 01 00 00 12 00 GET DESCRIPTOR 20.1.0 14.0 DI 12 01 10 01 00 00 00 08 ........ 20.2.0 00 04 5d c3 00 01 01 02 ..]..... 20.2.8 00 01 .. 20.2.16 14.0 CTL 80 06 00 02 00 00 09 00 GET DESCRIPTOR 21.1.0 14.0 DI 09 02 53 00 01 01 00 80 ..S..... 21.2.0 64 d 21.2.8
2.PC显示USB 设备时抓到的包: Device Phase Data Description Cmd.Phase.Ofs(rep) ------ ----- ------------------------ ---------------- ------------------ 14.1 DI 04 . 1.1.0 14.0 CTL a3 00 00 00 02 00 04 00 GET STATUS 2.1.0(2) 14.0 DI 01 01 01 00 .... 2.2.0 14.0 CTL 23 01 10 00 02 00 00 00 CLEAR FEATURE 4.1.0 14.0 CTL a3 00 00 00 01 00 04 00 GET STATUS 5.1.0 14.0 DI 00 01 00 00 .... 5.2.0 14.0 CTL a3 00 00 00 02 00 04 00 GET STATUS 6.1.0(2) 14.0 DI 01 01 00 00 .... 6.2.0 14.0 CTL 23 03 04 00 02 00 00 00 SET FEATURE 8.1.0 14.1 DI 04 . 9.1.0 14.0 CTL a3 00 00 00 02 00 04 00 GET STATUS 10.1.0 14.0 DI 03 01 10 00 .... 10.2.0 14.0 CTL 23 01 14 00 02 00 00 00 CLEAR FEATURE 11.1.0 14.0 CTL a3 00 00 00 02 00 04 00 GET STATUS 12.1.0 14.0 DI 03 01 00 00 .... 12.2.0 14.0 CTL 80 06 00 01 00 00 40 00 GET DESCRIPTOR 13.1.0 14.0 DI 12 01 10 01 00 00 00 08 ........ 13.2.0 14.0 CTL a3 00 00 00 02 00 04 00 GET STATUS 14.1.0 14.0 DI 03 01 00 00 .... 14.2.0 14.0 CTL 23 03 04 00 02 00 00 00 SET FEATURE 15.1.0 14.1 DI 04 . 16.1.0 14.0 CTL a3 00 00 00 02 00 04 00 GET STATUS 17.1.0 14.0 DI 03 01 10 00 .... 17.2.0 14.0 CTL 23 01 14 00 02 00 00 00 CLEAR FEATURE 18.1.0 14.0 CTL 00 05 02 00 00 00 00 00 SET ADDRESS 19.1.0 14.0 CTL 80 06 00 01 00 00 12 00 GET DESCRIPTOR 20.1.0 14.0 DI 12 01 10 01 00 00 00 08 ........ 20.2.0 00 04 5d c3 00 01 01 02 ..]..... 20.2.8 00 01 .. 20.2.16 14.0 CTL 80 06 00 02 00 00 09 00 GET DESCRIPTOR 21.1.0 14.0 DI 09 02 53 00 01 01 00 80 ..S..... 21.2.0 64 d 21.2.8 14.0 CTL a3 00 00 00 02 00 04 00 GET STATUS 22.1.0 14.0 DI 03 01 00 00 .... 22.2.0 14.0 CTL 23 03 04 00 02 00 00 00 SET FEATURE 23.1.0 14.1 DI 04 . 24.1.0 14.0 CTL a3 00 00 00 02 00 04 00 GET STATUS 25.1.0 14.0 DI 03 01 10 00 .... 25.2.0 14.0 CTL 23 01 14 00 02 00 00 00 CLEAR FEATURE 26.1.0 14.0 CTL 80 06 00 01 00 00 40 00 GET DESCRIPTOR 27.1.0 14.0 DI 12 01 10 01 00 00 00 08 ........ 27.2.0 14.0 CTL a3 00 00 00 02 00 04 00 GET STATUS 28.1.0 14.0 DI 03 01 00 00 .... 28.2.0 14.0 CTL 23 03 04 00 02 00 00 00 SET FEATURE 29.1.0 14.1 DI 04 . 30.1.0 14.0 CTL a3 00 00 00 02 00 04 00 GET STATUS 31.1.0 14.0 DI 03 01 10 00 .... 31.2.0 14.0 CTL 23 01 14 00 02 00 00 00 CLEAR FEATURE 32.1.0 14.0 CTL 00 05 02 00 00 00 00 00 SET ADDRESS 33.1.0 14.0 CTL 80 06 00 01 00 00 12 00 GET DESCRIPTOR 34.1.0 14.0 DI 12 01 10 01 00 00 00 08 ........ 34.2.0 00 04 5d c3 00 01 01 02 ..]..... 34.2.8 00 01 .. 34.2.16 14.0 CTL 80 06 00 02 00 00 09 00 GET DESCRIPTOR 35.1.0 14.0 DI 09 02 53 00 01 01 00 80 ..S..... 35.2.0 64 d 35.2.8 14.0 CTL a3 00 00 00 02 00 04 00 GET STATUS 36.1.0 14.0 DI 03 01 00 00 .... 36.2.0 14.0 CTL 23 03 04 00 02 00 00 00 SET FEATURE 37.1.0 14.1 DI 04 . 38.1.0 14.0 CTL a3 00 00 00 02 00 04 00 GET STATUS 39.1.0 14.0 DI 03 01 10 00 .... 39.2.0 14.0 CTL 23 01 14 00 02 00 00 00 CLEAR FEATURE 40.1.0 14.0 CTL 80 06 00 01 00 00 40 00 GET DESCRIPTOR 41.1.0 14.0 DI 12 01 10 01 00 00 00 08 ........ 41.2.0 14.0 CTL a3 00 00 00 02 00 04 00 GET STATUS 42.1.0 14.0 DI 03 01 00 00 .... 42.2.0 14.0 CTL 23 03 04 00 02 00 00 00 SET FEATURE 43.1.0 14.1 DI 04 . 44.1.0 14.0 CTL a3 00 00 00 02 00 04 00 GET STATUS 45.1.0 14.0 DI 03 01 10 00 .... 45.2.0 14.0 CTL 23 01 14 00 02 00 00 00 CLEAR FEATURE 46.1.0 14.0 CTL 00 05 02 00 00 00 00 00 SET ADDRESS 47.1.0 14.0 CTL 80 06 00 01 00 00 12 00 GET DESCRIPTOR 48.1.0 14.0 DI 12 01 10 01 00 00 00 08 ........ 48.2.0 00 04 5d c3 00 01 01 02 ..]..... 48.2.8 00 01 .. 48.2.16 14.0 CTL 80 06 00 02 00 00 09 00 GET DESCRIPTOR 49.1.0 14.0 DI 09 02 53 00 01 01 00 80 ..S..... 49.2.0 64 d 49.2.8 14.0 CTL 23 01 01 00 02 00 00 00 CLEAR FEATURE 50.1.0