374做主機(jī)的BULK-only時(shí) in事務(wù)問題。

1、本人使用光盤中CH374\EVT\PUB\EXAM\HOST\下的HOST.C想完成U盤的讀,請(qǐng)問IN事務(wù)是不是可以直接調(diào)用函數(shù)WaitHostTransact374(in_endp_addr, DEF_USB_PID_IN,FALSE, 1000 );來(lái)完成?有哪些注意點(diǎn)? 2、枚舉成功了,現(xiàn)發(fā)送CWB,其中31BYTE的CBW是(out事務(wù))發(fā)送成功,但是接下來(lái)的IN的事務(wù)都沒成功,錯(cuò)誤號(hào),0x2a,或者0x20,給點(diǎn)建議。

cbw.dCBWSignature=0x43425355;//我用的是小端點(diǎn)的 cbw.dCBWTag=0X81c33b60; cbw.dCBWDataTransgerLength=0X00000012; cbw.bmCBWFlags=0x80; cbw.bCBWLUN=0x00; cbw.bCBWCBLength=0x0c; cbw.CBWCB[0]=0x03; cbw.CBWCB[1]=0; cbw.CBWCB[2]=0; cbw.CBWCB[3]=0; cbw.CBWCB[4]=0x12; cbw.CBWCB[5]=0; cbw.CBWCB[6]=0; for(i=7;i<31;i++) { cbw.CBWCB[i]=0; } len = 31;//out_endp_size; Write374Block( RAM_HOST_TRAN, len, (UINT8)cbw.v ); Write374Byte( REG_USB_LENGTH, len ); s = WaitHostTransact374(out_endp_addr, DEF_USB_PID_OUT, FALSE, 1000 ); ///////////////// 發(fā)送成功。 if(s!=USB_INT_SUCCESS) printf( "cbw cmd ERROR = %02X\n", (UINT16)s ); else { printf( "cbw cmd ok\n"); } s1 = WaitHostTransact374(in_endp_addr, DEF_USB_PID_IN,FALSE, 1000 ); //////////////// 失敗了。 if(s1!=USB_INT_SUCCESS) printf( "cbw read read ERROR = %02X\n", (UINT16)s1 ); else { printf( "cbw read ok,len:"); len = Read374Byte( REG_USB_LENGTH ); printf( "%02X data:",(UINT16)(len)); Read374Block( RAM_HOST_RECV, len, allbuf ); for ( i = 0; i < len; i ++ ) printf( "%02X ", (UINT16)(allbuf[i] ) ); printf( "\n"); } s3 =WaitHostTransact374( in_endp_addr, DEF_USB_PID_IN, TRUE, 1000 );//(UINT8)csw.dCSWSignature); if(s3!=USB_INT_SUCCESS) printf( "csw read ERROR = %02X\n", (UINT16)s3 ); else { printf( "csw ok,len:"); len = Read374Byte( REG_USB_LENGTH ); printf( "%02X data:",(UINT16)(len)); Read374Block( RAM_HOST_RECV, len, allbuf ); for ( i = 0; i < len; i ++ ) printf( "%02X ",(UINT16)( allbuf[i] ) );// (UINT16)(csw++) ); printf( "\n"); }

數(shù)據(jù)應(yīng)該是這樣的吧,你發(fā)的數(shù)據(jù)估計(jì)有點(diǎn)問題: 55 53 42 43 08 70 11 82 24 00 00 00 80 00 06 12 00 00 00 24 00 00 00 00 00 00 00 00 00 00 00


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

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