一块STM32F103ZET6板子,官方下载4.0 usb固件库自带的usb虚拟串口例程用mdk编译可以正确识别该串口,改用gcc编译则不能枚举。
同一个代码,mdk中的C define参数跟gcc下的一样,都是-DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD -DUSE_STM3210E_EVAL,也试过O0和O3参数都不行。
其他代码,比如LED闪烁之类的例程gcc编译则正常,这会是什么问题呢
两次bus hound抓包,
失败的
Device Phase Data Description Cmd.Phase.Ofs(rep)
------ ----- ------------------------ ---------------- ------------------
9.1 IN 00 01 .. 1.1.0
9.0 CTL a3 00 00 00 08 00 04 00 GET STATUS 2.1.0
9.0 IN 01 01 01 00 .... 2.2.0
9.0 CTL 23 01 10 00 08 00 00 00 CLEAR FEATURE 3.1.0
9.0 CTL a3 00 00 00 08 00 04 00 GET STATUS 4.1.0
9.0 IN 01 01 00 00 .... 4.2.0
9.0 CTL 23 03 04 00 08 00 00 00 SET FEATURE 5.1.0(4)
9.1 IN 00 01 .. 6.1.0(4)
9.0 CTL a3 00 00 00 08 00 04 00 GET STATUS 7.1.0(4)
9.0 IN 03 01 10 00 .... 7.2.0
9.0 CTL 23 01 14 00 08 00 00 00 CLEAR FEATURE 8.1.0(4)
9.0 CTL a3 00 00 00 08 00 04 00 GET STATUS 9.1.0(4)
9.0 IN 03 01 00 00 .... 9.2.0
9.0 CTL 23 01 01 00 08 00 00 00 CLEAR FEATURE 25.1.0
成功的
Device Phase Data Description Cmd.Phase.Ofs(rep)
------ ----- ------------------------ ---------------- ------------------
9.1 IN 00 01 .. 1.1.0
9.0 CTL a3 00 00 00 08 00 04 00 GET STATUS 2.1.0
9.0 IN 01 01 01 00 .... 2.2.0
9.0 CTL 23 01 10 00 08 00 00 00 CLEAR FEATURE 3.1.0
9.0 CTL a3 00 00 00 08 00 04 00 GET STATUS 4.1.0
9.0 IN 01 01 00 00 .... 4.2.0
9.0 CTL 23 03 04 00 08 00 00 00 SET FEATURE 5.1.0(2)
9.1 IN 00 01 .. 6.1.0(2)
9.0 CTL a3 00 00 00 08 00 04 00 GET STATUS 7.1.0(2)
9.0 IN 03 01 10 00 .... 7.2.0
9.0 CTL 23 01 14 00 08 00 00 00 CLEAR FEATURE 8.1.0(2)
9.0 CTL a3 00 00 00 08 00 04 00 GET STATUS 9.1.0(3)
9.0 IN 03 01 00 00 .... 9.2.0
9.0 CTL 80 06 ee 03 00 00 12 00 GET DESCRIPTOR 16.1.0
9.0 USTS c0000004 stall pid 16.2.0
9.0 CTL 80 06 03 03 09 04 ff 00 GET DESCRIPTOR 17.1.0
9.0 IN 1a 03 34 00 38 00 45 00 ..4.8.E. 17.2.0
46 00 37 00 36 00 35 00 F.7.6.5. 17.2.8
43 00 33 00 35 00 33 00 C.3.5.3. 17.2.16
37 00 7. 17.2.24
9.0 CTL 80 06 00 03 00 00 ff 00 GET DESCRIPTOR 18.1.0
9.0 IN 04 03 09 04 .... 18.2.0
9.0 CTL 80 06 02 03 09 04 ff 00 GET DESCRIPTOR 19.1.0
9.0 IN 32 03 53 00 54 00 4d 00 2.S.T.M. 19.2.0
33 00 32 00 20 00 56 00 3.2. .V. 19.2.8
69 00 72 00 74 00 75 00 i.r.t.u. 19.2.16
61 00 6c 00 20 00 43 00 a.l. .C. 19.2.24
9.0 CTL 80 06 00 06 00 00 0a 00 GET DESCRIPTOR 20.1.0
9.0 USTS c0000004 stall pid 20.2.0
此帖出自
小平头技术问答
一周热门 更多>