[求助]利用CH376的外部固件模式,不能獲取配置描述符

調(diào)試信息如下

Successfully Connect CPU with CH376

USB Device Disconnected

USB Device Out_Firmware

**(USB Bus Reset Successfully)**

**(USB Bus Reset Successfully)**

**(USB Bus Reset Successfully)**

**(USB Bus Reset Successfully)**

**(USB Bus Reset Successfully)**

**(USB Bus Reset Successfully)**

**(USB Endpoint 0 SETUP Successfully)**

Command Code: 0x80 0x06 0x00 0x01 0x00 0x00 0x40 0x00

USB Standard Input Request (Host to Device):GET_DESCRIPTOR--Device Descriptor

Data Wrote : 0x12 0x01 0x10 0x01 0x00 0x00 0x00 0x08

**(USB Endpoint 0 IN Successfully)**

Data Wrote : 0x88 0x88 0x01 0x00 0x00 0x01 0x01 0x02

**(USB Endpoint 0 OUT Successfully)**

**(USB Endpoint 0 OUT Successfully)**

**(USB Endpoint 0 SETUP Successfully)**

Command Code: USB Standard Input Request (Host to Device):GET_DESCRIPTOR--Device Descriptor

Data Wrote : 0x12 0x01 0x10 0x01 0x00 0x00 0x00 0x08

**(USB Bus Reset Successfully)**

**(USB Bus Reset Successfully)**

**(USB Endpoint 0 SETUP Successfully)**

Command Code: 0x80 0x06 0x00 0x01 0x00 0x00 0x40 0x00

USB Standard Input Request (Host to Device):GET_DESCRIPTOR--Device Descriptor

Data Wrote : 0x12 0x01 0x10 0x01 0x00 0x00 0x00 0x08

**(USB Endpoint 0 IN Successfully)**

Data Wrote : 0x88 0x88 0x01 0x00 0x00 0x01 0x01 0x02

**(USB Endpoint 0 OUT Successfully)**

**(USB Endpoint 0 OUT Successfully)**

**(USB Endpoint 0 SETUP Successfully)**

Command Code: 0x00 0x05 0x0E 0x00 0x00 0x00 0x00 0x00

USB Standard Output Request (Host to Device):SET_ADDRESS--ADDRESS: 0x0E

Data Wrote :

**(USB Endpoint 0 IN Successfully)**

**(USB Endpoint 0 SETUP Successfully)**

Command Code: 0x80 0x06 0x00 0x01 0x00 0x00 0x12 0x00

USB Standard Input Request (Host to Device):GET_DESCRIPTOR--Device Descriptor

Data Wrote : 0x12 0x01 0x10 0x01 0x00 0x00 0x00 0x08

**(USB Endpoint 0 IN Successfully)**

Data Wrote : 0x88 0x88 0x01 0x00 0x00 0x01 0x01 0x02

**(USB Endpoint 0 IN Successfully)**

Data Wrote : 0x03 0x01

**(USB Endpoint 0 IN Successfully)**

Data Wrote :

**(USB Endpoint 0 OUT Successfully)**

**(USB Endpoint 0 IN Successfully)**

Data Wrote :

**(USB Endpoint 0 IN Successfully)**

Data Wrote :

**(USB Endpoint 0 OUT Successfully)**

**(USB Endpoint 0 IN Successfully)**

Data Wrote :

**(USB Endpoint 0 IN Successfully)**

Data Wrote :

**(USB Endpoint 0 OUT Successfully)**

**(USB Endpoint 0 IN Successfully)**

Data Wrote :

**(USB Endpoint 0 IN Successfully)**

Data Wrote :

**(USB Endpoint 0 OUT Successfully)**

**(USB Bus Reset Successfully)**

**(USB Bus Reset Successfully)**

**(USB Endpoint 0 SETUP Successfully)**

Command Code: 0x80 0x06 0x00 0x01 0x00 0x00 0x40 0x00

USB Standard Input Request (Host to Device):GET_DESCRIPTOR--Device Descriptor

Data Wrote : 0x12 0x01 0x10 0x01 0x00 0x00 0x00 0x08

**(USB Endpoint 0 IN Successfully)**

Data Wrote : 0x88 0x88 0x01 0x00 0x00 0x01 0x01 0x02

**(USB Endpoint 0 OUT Successfully)**

**(USB Endpoint 0 OUT Successfully)**

**(USB Endpoint 0 SETUP Successfully)**

Command Code: 0x00 0x05 0x0E 0x00 0x00 0x00 0x00 0x00

USB Standard Output Request (Host to Device):SET_ADDRESS--ADDRESS: 0x0E

Data Wrote :

**(USB Endpoint 0 IN Successfully)**

**(USB Endpoint 0 SETUP Successfully)**

Command Code: 0x80 0x06 0x00 0x01 0x00 0x00 0x12 0x00

USB Standard Input Request (Host to Device):GET_DESCRIPTOR--Device Descriptor

Data Wrote : 0x12 0x01 0x10 0x01 0x00 0x00 0x00 0x08

**(USB Endpoint 0 IN Successfully)**

Data Wrote : 0x88 0x88 0x01 0x00 0x00 0x01 0x01 0x02

**(USB Endpoint 0 IN Successfully)**

Data Wrote : 0x03 0x01

**(USB Endpoint 0 IN Successfully)**

Data Wrote :

**(USB Endpoint 0 OUT Successfully)**

**(USB Endpoint 0 IN Successfully)**

Data Wrote :

**(USB Endpoint 0 IN Successfully)**

Data Wrote :

**(USB Endpoint 0 OUT Successfully)**

**(USB Endpoint 0 IN Successfully)**

Data Wrote :

**(USB Endpoint 0 IN Successfully)**

Data Wrote :

**(USB Endpoint 0 OUT Successfully)**

**(USB Endpoint 0 IN Successfully)**

Data Wrote :

**(USB Endpoint 0 IN Successfully)**

Data Wrote :

**(USB Endpoint 0 OUT Successfully)**

獲取完整設(shè)備描述符后就一直在EP0的IN和OUT之間中斷,怎么解決???[Emot]1[/Emot]

看你的程序設(shè)備描述符都沒有獲取完成啊,還有沒有看到你發(fā)送獲取配置描述符的命令下去獲取啊。


有了,第一次獲取部分設(shè)備描述符,然后設(shè)置地址之后獲取完整的描述符,之后就一直停留在EP0 IN 和EP0 OUT 以下是EP0 IN的中斷處理函數(shù): void USB_ep0_in(void) { #ifdef DEBUG0 Printf("**(USB Endpoint 0 IN Successfully)**\r\n"); #endif if(bRequest==0x06) //如果是USB請(qǐng)求獲取描述符,繼續(xù)返回發(fā)送剩余描述符 { USB_Ep0_send_data(); //發(fā)送剩余的字節(jié)數(shù) } else if(bRequest==0x05) //如果是USB請(qǐng)求設(shè)置地址,使用SET_USB_ADDR設(shè)置地址 { CH376_write_command(SET_USB_ADDR); //設(shè)置USB地址,設(shè)置下次事務(wù)的USB地址 CH376_write_byte(USB_address); } CH376_clear_buffer(); //釋放緩沖區(qū),UNLOCK_USB }

以下是EP0 OUT的中斷處理函數(shù) void USB_ep0_out(void) { #ifdef DEBUG0 Printf("**(USB Endpoint 0 OUT Successfully)**\r\n"); #endif CH376_write_command(RD_USB_DATA); if(m=CH376_read_byte()) //如果下傳數(shù)據(jù)的長(zhǎng)度不為0,讀出下傳數(shù)據(jù) { for(n=0;n { *(tem+n)=CH376_read_byte(); } } // CH376_clear_buffer(); //釋放緩沖區(qū),如果前面沒有CMD_RD_USB_DATA命令則使用本命令 } ////////////////////////End of function//////////////////////////////


你現(xiàn)在是不是設(shè)備沒被識(shí)別,你把EP0的IN和OUT串口輸出去掉,看能不能正常枚舉,用bushound抓取數(shù)據(jù)。


你現(xiàn)在是不是設(shè)備沒被識(shí)別,你把EP0的IN和OUT串口輸出去掉,看能不能正常枚舉,用bushound抓取數(shù)據(jù)。


你現(xiàn)在是不是設(shè)備沒被識(shí)別,你把EP0的IN和OUT串口輸出去掉,看能不能正常枚舉,用bushound抓取數(shù)據(jù)。


只有登錄才能回復(fù),可以選擇微信賬號(hào)登錄

国产91精品新入口,国产成人综合网在线播放,九热这里只有精品,本道在线观看,美女视频a美女视频,韩国美女激情视频,日本美女pvp视频