最近在学习USB相关知识,想弄一个鼠标出来,捣鼓了好久,终于能用stm32的USB模块收发枚举数据了,于是按照圈圈书上的各种描述符进行枚举,本以为就这样差不多了,结果又遇到了问题,捣鼓了好久实在无解了,在主机请求报告描述符后,主机就不搭理设备了,然后设备就挂起了,然后就没有下文了,下面是串口输出的调试信息:
USB复位
未收到SOF
未收到SOF
未收到SOF
USB挂起
USB_CNTR:fd08
唤醒中断
USB_CNTR:fd00
USB复位
CTR中断
SETUP
80 06 00 01 00 00 40 00
获取设备描述符
(18) 12 01 10 01 00 00 00 40 88 87 01 00 00 01 01 02 03 01
CTR中断
IN
CTR中断
OUT
USB复位
CTR中断
SETUP
00 05 3b 00 00 00 00 00
CTR中断
IN
CTR中断
SETUP
80 06 00 01 00 00 12 00
获取设备描述符
(18) 12 01 10 01 00 00 00 40 88 87 01 00 00 01 01 02 03 01
CTR中断
IN
CTR中断
OUT
CTR中断
SETUP
80 06 00 02 00 00 ff 00
获取配置描述符
(34) 09 02 22 00 01 01 00 c0 32 09 04 00 00 01 03 01 02 00 09 21 10 01 21 01 22 34 00 07 05 81 03 04 00 ff
CTR中断
IN
CTR中断
OUT
CTR中断
SETUP
80 06 03 03 09 04 ff 00
获取字符串描述符(3)
(22) 16 03 32 00 30 00 31 00 37 00 2d 00 30 00 39 00 2d 00 32 00 38 00
CTR中断
IN
CTR中断
OUT
CTR中断
SETUP
80 06 00 03 00 00 ff 00
获取字符串描述符(0)
(4) 04 03 09 04
CTR中断
IN
CTR中断
OUT
CTR中断
SETUP
80 06 00 01 00 00 12 00
获取设备描述符
(18) 12 01 10 01 00 00 00 40 88 87 01 00 00 01 01 02 03 01
CTR中断
IN
CTR中断
OUT
CTR中断
SETUP
80 06 00 02 00 00 09 00
获取配置描述符
(9) 09 02 22 00 01 01 00 c0 32
CTR中断
IN
CTR中断
OUT
CTR中断
SETUP
80 06 00 02 00 00 22 00
获取配置描述符
(34) 09 02 22 00 01 01 00 c0 32 09 04 00 00 01 03 01 02 00 09 21 10 01 21 01 22 34 00 07 05 81 03 04 00 ff
CTR中断
IN
CTR中断
OUT
CTR中断
SETUP
00 09 01 00 00 00 00 00
OUT0
设置配置
CTR中断
IN
CTR中断
SETUP
21 0a 00 00 00 00 00 00
OUT0
CTR中断
IN
CTR中断
SETUP
81 06 00 22 00 00 74 00
其它描述符
(52) 50 01 09 02 a1 01 09 01 a1 00 05 09 19 01 29 03 15 00 25 01 95 03 75 01 81 02 95 01 75 05 81 03 05 01 09 30 09 31 09 38 15 81 25 7f 75 08 95 03 81 06 c0 c0
CTR中断
IN
CTR中断
OUT
未收到SOF
未收到SOF
未收到SOF
USB挂起
USB_CNTR:fd08 |