阿莫电子网找了一个STM32F4单片机实现USB-Hid设备的程序,编译及烧录都正常,设备也能够被正确枚举及打开,但是USB调试助手始终无法收到数据。用"Bus Hound"工具看数据包,可见如下错误信息(红 {MOD}字体):
Device Phase Data Description Cmd.Phase.Ofs(rep)
------ ----- ------------------------------------------------------------------------------------------------------ -------------------------------- ------------------
16.0 CTL 80 06 00 01 00 00 12 00 GET DESCRIPTOR 1.1.0
16.0 IN 12 01 00 02 00 00 00 40 83 04 50 57 00 02 01 02 03 01
.......@..PW...... 1.2.0
16.0 CTL 80 06 00 02 00 00 09 00 GET DESCRIPTOR 2.1.0
16.0 IN 09 02 29 00 01 01 00 e0 32 ..).....2 2.2.0
16.0 CTL 80 06 00 02 00 00 29 00 GET DESCRIPTOR 3.1.0
16.0 IN 09 02 29 00 01 01 00 e0 32 09 04 00 00 02 03 00 00 00 09 21 10 01 00 01 22 a2 00 07 05 81 03 ff ..).....2..........!...."....... 3.2.0
16.0 CTL 00 09 01 00 00 00 00 00 SET CONFIG 4.1.0
16.0 CTL 21 0a 00 00 00 00 00 00 SET IDLE 5.1.0
16.0 CTL 81 06 00 22 00 00 e2 00 GET DESCRIPTOR 6.1.0
16.0 IN 05 8c 09 01 a1 01 85 01 09 01 15 00 25 01 75 08 95 01 b1 82 85 01 09 01 91 82 85 02 09 02 15 00 ............%.u................. 6.2.0
16.0 CTL 80 06 01 03 09 04 8a 01 GET DESCRIPTOR 7.1.0(2)
16.0 IN 0c 03 42 00 61 00 69 00 64 00 75 00 ..B.a.i.d.u. 7.2.0
16.0 CTL 80 06 02 03 09 04 8a 01 GET DESCRIPTOR 8.1.0(2)
16.0 IN 18 03 42 00 61 00 69 00 64 00 75 00 20 00 47 00 6c 00 61 00 73 00 73 00 ..B.a.i.d.u. .G.l.a.s.s. 8.2.0
16.0 CTL 80 06 03 03 09 04 8a 01 GET DESCRIPTOR 9.1.0(2)
16.0 IN 1a 03 30 00 30 00 30 00 30 00 30 00 30 00 30 00 30 00 30 00 31 00 31 00 43 00 ..0.0.0.0.0.0.0.0.0.1.1.C. 9.2.0
16.1 USTS c0000012 babble detected 13.1.0
16.1 USTS c0000030 endpoint halted 14.1.0
16 RESET 15.1.0
16 ok 15.2.0
16.1 RESET 16.1.0
16.0 CTL 80 06 00 02 00 00 09 00 GET DESCRIPTOR 17.1.0
16.0 IN 09 02 29 00 01 01 00 e0 32 ..).....2 17.2.0
16.0 CTL 80 06 00 02 00 00 29 00 GET DESCRIPTOR 18.1.0
16.0 IN 09 02 29 00 01 01 00 e0 32 09 04 00 00 02 03 00 00 00 09 21 10 01 00 01 22 a2 00 07 05 81 03 ff ..).....2..........!...."....... 18.2.0
16.1 USTS c0000012 babble detected 19.1.0(166)
16 RESET 20.1.0(166)
16.1 USTS 80000600 bad pipe handle 21.1.0(166)
16 ok 20.2.0
16.1 RESET 22.1.0(166)
不知是否有人遇到类似错误?请问是如何解决的?
//USB Device 配置成功
void USBD_USR_DeviceConfigured (void)
{
//bDeviceState=1; <-----------
printf("MSC Interface started. ");
}
//USB Device挂起
void USBD_USR_DeviceSuspended(void)
{
//bDeviceState=0; <-------------
printf("Device In suspend mode. ");
}
//USB Device连接成功
void USBD_USR_DeviceConnected (void)
{
bDeviceState=1; ++---------------------
printf("USB Device Connected. ");
}
//USB Device未连接
void USBD_USR_DeviceDisconnected (void)
{
bDeviceState=0; ++-------------------
printf("USB Device Disconnected. ");
}
则不会出现"babble detected"以及后边的错误了,但是数据还是接收不到。
一周热门 更多>