在讀出設(shè)備描述符之后,無(wú)論設(shè)置usb地址,或者讀配置描述符,都能產(chǎn)生中斷,但返回狀態(tài)0x28,這可是375的讀端點(diǎn)數(shù)據(jù)命令,這么會(huì)返回命令而不是狀態(tài)呢?程序在讀其他usb設(shè)備過(guò)程中正常,但usb藍(lán)牙適配器就發(fā)生這現(xiàn)象,請(qǐng)各位大俠支支招[Emot]20[/Emot][Emot]20[/Emot]
連芯片都做出來(lái)了,沁恒的客服們沒(méi)理由解決不了這個(gè)問(wèn)題吧?至少幫我推測(cè)一下原因啊
返回的0X28,并不是讀端點(diǎn)數(shù)據(jù)的命令,而是操作設(shè)備的中斷狀態(tài)(超時(shí))。 你前面讀取的設(shè)備描述符是正確成功的嗎?你在獲取設(shè)備描述符之后,延時(shí)幾MS之后再去設(shè)置地址試下。你用Bus Hound 抓取一下電腦是怎么對(duì)其操作的,按電腦的操作步驟試下。
bushound截得pc以下初始化過(guò)程:
Device Phase Data Description Cmd.Phase.Ofs(rep) ------ ----- ------------------------ ---------------- ------------------ 16.0 CTL a3 00 00 00 01 00 04 00 GET STATUS 1.1.0 16.0 DI 00 01 03 00 .... 1.2.0 16.0 CTL 23 01 11 00 01 00 00 00 CLEAR FEATURE 2.1.0 16.0 CTL a3 00 00 00 01 00 04 00 GET STATUS 3.1.0(2) 16.0 DI 00 01 01 00 .... 3.2.0 16.0 CTL 23 01 10 00 01 00 00 00 CLEAR FEATURE 5.1.0 16.0 CTL a3 00 00 00 01 00 04 00 GET STATUS 6.1.0 16.0 DI 00 01 00 00 .... 6.2.0 16.0 CTL a3 00 00 00 02 00 04 00 GET STATUS 7.1.0 16.0 DI 03 03 00 00 .... 7.2.0 16.0 CTL a3 00 00 00 01 00 04 00 GET STATUS 8.1.0(2) 16.0 DI 01 01 01 00 .... 8.2.0 16.0 CTL 23 01 10 00 01 00 00 00 CLEAR FEATURE 10.1.0 16.0 CTL a3 00 00 00 01 00 04 00 GET STATUS 11.1.0(2) 16.0 DI 01 01 00 00 .... 11.2.0 16.0 CTL 23 03 04 00 01 00 00 00 SET FEATURE 13.1.0 16.0 CTL a3 00 00 00 01 00 04 00 GET STATUS 14.1.0 16.0 DI 03 01 10 00 .... 14.2.0 16.0 CTL 23 01 14 00 01 00 00 00 CLEAR FEATURE 15.1.0 16.0 CTL a3 00 00 00 01 00 04 00 GET STATUS 16.1.0(2) 16.0 DI 03 01 00 00 .... 16.2.0 16.0 CTL 23 03 04 00 01 00 00 00 SET FEATURE 18.1.0 16.0 CTL a3 00 00 00 01 00 04 00 GET STATUS 19.1.0 16.0 DI 03 01 10 00 .... 19.2.0 16.0 CTL 23 01 14 00 01 00 00 00 CLEAR FEATURE 20.1.0 16.0 CTL 80 06 00 02 00 00 ff 00 GET DESCRIPTOR 21.1.0 16.0 DI 09 02 ba 00 03 01 00 c0 ........ 21.2.0 00 09 04 00 00 03 e0 01 ........ 21.2.8 01 00 07 05 81 03 10 00 ........ 21.2.16 01 07 05 02 02 40 00 01 .....@.. 21.2.24 16.0 CTL a3 00 00 00 02 00 04 00 GET STATUS 22.1.0 16.0 DI 03 03 00 00 .... 22.2.0 30.0 CTL 80 06 00 01 00 00 12 00 GET DESCRIPTOR 23.1.0 30.0 DI 12 01 10 01 e0 01 01 10 ........ 23.2.0 31 11 01 10 73 03 01 02 1...s... 23.2.8 00 01 .. 23.2.16 30.0 CTL 80 06 00 02 00 00 09 02 GET DESCRIPTOR 24.1.0 30.0 DI 09 02 ba 00 03 01 00 c0 ........ 24.2.0 00 09 04 00 00 03 e0 01 ........ 24.2.8 01 00 07 05 81 03 10 00 ........ 24.2.16 01 07 05 02 02 40 00 01 .....@.. 24.2.24 30.0 CTL 00 09 01 00 00 00 00 00 SET CONFIG 25.1.0 30.0 CTL 01 0b 00 00 01 00 00 00 SET INTERFACE 26.1.0 30.0 CTL 20 00 00 00 00 00 03 00 SEND HCI 27.1.0 30.0 DO 03 0c 00 ... 27.2.0 30.1 DI 0e 04 01 03 0c 00 ...... 28.1.0 30.0 CTL 20 00 00 00 00 00 05 00 SEND HCI 29.1.0 30.0 DO 16 0c 02 00 b0 ..... 29.2.0 30.1 DI 0e 04 01 16 0c 00 ...... 30.1.0 30.0 CTL 20 00 00 00 00 00 05 00 SEND HCI 31.1.0 30.0 DO 18 0c 02 10 27 ....' 31.2.0 30.1 DI 0e 04 01 18 0c 00 ...... 32.1.0 30.0 CTL 20 00 00 00 00 00 03 00 SEND HCI 33.1.0 30.0 DO 15 0c 00 ... 33.2.0 30.1 DI 0e 06 01 15 0c 00 00 b0 ........ 34.1.0 30.0 CTL 20 00 00 00 00 00 03 00 SEND HCI 35.1.0 30.0 DO 05 10 00 ... 35.2.0 30.1 DI 0e 0b 01 05 10 00 a6 02 ........ 36.1.0 30 08 00 0a 00 0.... 36.1.8 30.0 CTL 20 00 00 00 00 00 04 00 SEND HCI 37.1.0 30.0 DO 31 0c 01 00 1... 37.2.0 30.1 DI 0e 04 01 31 0c 00 ...1.. 38.1.0 30.0 CTL 20 00 00 00 00 00 0a 00 SEND HCI 39.1.0 30.0 DO 33 0c 07 80 02 ff a0 00 3....... 39.2.0 14 00 .. 39.2.8 30.1 DI 0e 04 01 33 0c 00 ...3.. 40.1.0 30.0 CTL 20 00 00 00 00 00 03 00 SEND HCI 41.1.0 30.0 DO 03 10 00 ... 41.2.0 30.1 DI 0e 0c 01 03 10 00 bf fe ........ 42.1.0 8d 78 08 18 00 00 .x.... 42.1.8 30.0 CTL 20 00 00 00 00 00 04 00 SEND HCI 43.1.0 30.0 DO 0a 0c 01 00 .... 43.2.0 30.1 DI 0e 04 01 0a 0c 00 ...... 44.1.0 30.0 CTL 20 00 00 00 00 00 04 00 SEND HCI 45.1.0 30.0 DO 1a 0c 01 01 .... 45.2.0 30.1 DI 0e 04 01 1a 0c 00 ...... 46.1.0 30.0 CTL 20 00 00 00 00 00 03 00 SEND HCI 47.1.0 30.0 DO 14 0c 00 ... 47.2.0 30.1 DI 0e fc 01 14 0c 00 49 53 ......IS 48.1.0 53 43 42 54 41 00 00 00 SCBTA... 48.1.8 00 00 00 00 00 00 00 00 ........ 48.1.16 00 00 00 00 00 00 00 00 ........ 48.1.24 30.1 DI 00 00 00 00 00 00 00 00 ........ 49.1.0 00 00 00 00 00 00 00 00 ........ 49.1.8 00 00 00 00 00 00 00 00 ........ 49.1.16 00 00 00 00 00 00 00 00 ........ 49.1.24 30.0 CTL 20 00 00 00 00 00 03 00 SEND HCI 50.1.0 30.0 DO 09 10 00 ... 50.2.0 30.1 DI 0e 0a 01 09 10 00 79 56 ......yV 51.1.0 20 67 11 00 g.. 51.1.8 30.0 CTL 20 00 00 00 00 00 03 00 SEND HCI 52.1.0 30.0 DO 23 0c 00 #.. 52.2.0 30.1 DI 0e 07 01 23 0c 00 00 00 ...#.... 53.1.0 00 . 53.1.8 30.0 CTL 20 00 00 00 00 00 06 00 SEND HCI 54.1.0 30.0 DO 24 0c 03 00 00 00 $..... 54.2.0 30.1 DI 0e 04 01 24 0c 0
我這邊找了個(gè)藍(lán)牙適配置試了下,并不會(huì)出現(xiàn)你所說(shuō)的獲取不到配置描述符的情況。你采用的是外置固件模式還是內(nèi)值固件模式去獲取的?你可以參考下附件程序中獲取描述的部分,你最好能檢控下在哪一步返回超時(shí)。 還有就是你的Bus Hound緩沖區(qū)設(shè)置的不夠大,配置描述符并沒(méi)有獲取完整,總共長(zhǎng)度為0XBA個(gè)字節(jié),你只獲取了32個(gè)字節(jié)。UploadImages/2007101211311593.rar