stm32f103c8t6的代碼移植到ch32f103c8t6,stm32端點2是正常工作的
ch32嘗試了,端點2和端點3讀出來的數(shù)據(jù)不對
ch32先使能了USB_HP_CAN1_TX_IRQ,要不然觸發(fā)不了USB_HP_CAN1_TX_IRQ
USB 高優(yōu)先級中斷(通道 19):僅能由同步和雙緩沖批量傳輸?shù)恼_傳輸事件觸發(fā),目的是保證最 大的傳輸速率
觸發(fā)中斷后進入,EP3_OUT_CALLBACK
g_blaster_rx_req = TRUE
開始緩沖區(qū)拷貝數(shù)據(jù)
到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端點設置操作
端點緩沖區(qū)設置,這里我不確定有沒有設置正確
ENDP0,ENDP1是正常的能識別驅(qū)動
各位大佬幫忙看看到底啥問題啊