ch32f103c8t6雙緩沖區(qū)從緩沖區(qū)取出來的數(shù)據(jù)不對

stm32f103c8t6的代碼移植到ch32f103c8t6,stm32端點2是正常工作的

ch32嘗試了,端點2和端點3讀出來的數(shù)據(jù)不對

ch32先使能了USB_HP_CAN1_TX_IRQ,要不然觸發(fā)不了USB_HP_CAN1_TX_IRQ

企業(yè)微信截圖_16359021156068.png

USB 高優(yōu)先級中斷(通道 19):僅能由同步和雙緩沖批量傳輸?shù)恼_傳輸事件觸發(fā),目的是保證最 大的傳輸速率

觸發(fā)中斷后進入,EP3_OUT_CALLBACK

企業(yè)微信截圖_16359024294644.png

g_blaster_rx_req = TRUE

開始緩沖區(qū)拷貝數(shù)據(jù)

企業(yè)微信截圖_16359025541660.png

到s_recv_buffer這個64字節(jié)數(shù)組,

拷貝出來的數(shù)據(jù)前幾次是和stm32一樣,后面就和stm32拷貝的數(shù)據(jù)出來的數(shù)據(jù)不一樣了

下面這里是配置描述符,和設置端點的操作

/*?USB配置描述符?*/
/*???All?Descriptors?(Configuration,?Interface,?Endpoint,?Class,?Vendor?*/
const?uint8_t?Blaster_ConfigDescriptor[BLASTER_SIZ_CONFIG_DESC]?=?{
????/*?Configuration?Descriptor?*/
????/*?00?*/
????0x09,?????????/*?bLength:?Configuration?Descriptor?size?*/
????USB_CONFIGURATION_DESCRIPTOR_TYPE,?/*?bDescriptorType:?Configuration?*/
????BLASTER_SIZ_CONFIG_DESC,??/*?wTotalLength:?Bytes?returned?*/
????0x00,
????0x01,?????????/*?bNumInterfaces:?1?interface?*/
????0x01,?????????/*?bConfigurationValue:?Configuration?value?*/
????0x00,?????????/*?iConfiguration:?Index?of?string?descriptor?describing?the?configuration*/
????0x80,?????????/*?bmAttributes:?Bus?powered(bit6=0)?*/
????0xE1,?????????/*?MaxPower?450mA(225*2)?*/

????/*?Interface?Descriptor?*/
????/*?09?*/
????0x09,?????????/*?bLength:?Interface?Descriptor?size?*/
????USB_INTERFACE_DESCRIPTOR_TYPE,/*?bDescriptorType:?Interface?descriptor?type?*/
????0x00,?????????/*?bInterfaceNumber:?Number?of?Interface?*/
????0x00,?????????/*?bAlternateSetting:?Alternate?setting?*/
????EP_NUM?-?1,???/*?bNumEndpoints?*/
????0xFF,?????????/*?bInterfaceClass:?NA?*/
????0xFF,?????????/*?bInterfaceSubClass?:?NA?*/
????0xFF,?????????/*?nInterfaceProtocol?:?NA?*/
????0,????????????/*?iInterface:?Index?of?string?descriptor?*/
????
????/*?Endpoint?Descriptor?*/
????/*?18?*/
????0x07,??????????/*?bLength:?Endpoint?Descriptor?size?*/
????USB_ENDPOINT_DESCRIPTOR_TYPE,?/*?bDescriptorType:?Endpoint?descriptor?*/
????EP1_IN,????????/*?bEndpointAddress:?Endpoint?1?IN?*/
????0x02,??????????/*?bmAttributes:?Bulk?endpoint?*/
????ENDP1_TXSIZE,??/*?wMaxPacketSize:?64?Bytes?max?*/
????0x00,
????0x01,??????????/*?bInterval:?Polling?Interval?(1?ms)?*/
????/*?25?*/
????0x07,??????????/*?bLength:?Endpoint?Descriptor?size?*/
????USB_ENDPOINT_DESCRIPTOR_TYPE,???/*?bDescriptorType:?Endpoint?descriptor?*/
????EP3_OUT,???????/*bEndpointAddress:端點2輸出這里修改為EP3*/?
????0x02,??????????/*bmAttributes:批量端點*/
????ENDP2_RXSIZE,??/*wMaxPacketSize:最大64字節(jié)*/
????0x00,
????0x01,??????????/*bInterval:輪詢間隔(1毫秒)*/
????/*?32?*/
};

ENDP3端點設置操作

企業(yè)微信截圖_1635902821451.png

端點緩沖區(qū)設置,這里我不確定有沒有設置正確

企業(yè)微信截圖_16359030352197.png

ENDP0,ENDP1是正常的能識別驅(qū)動

各位大佬幫忙看看到底啥問題啊

你好,理論上端點1跟端點2的操作流程是一樣的啊,實現(xiàn)上存在區(qū)別的話那主要看一下配置,比如端點地址的配置等.


是緩沖區(qū)地址嗎,還是就是端點地址


只有登錄才能回復,可以選擇微信賬號登錄

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