一块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 |
GCC用的人少,太多参数不确定 |
gcc用的 CoIDE很好用的哇,都设置好的, |
|
楼主你好,我想请问虚拟串口例程为什么需要再用到串口呢,不是usb虚拟串口了吗? |
【MCU实战经验】基于STM32F103C8T6的hart总线调试器设计
求教STM32F103进入STOP模式后用外部中断唤醒的问题
基于STM32F103RCT6的无源蜂鸣器音乐播放(生日快乐歌)
STM32F103c8t6有没有DAC 功能?
STM32F103x中文数据手册
新手求教,为何在我电脑上找不到STM32F1Xx.h文件
金龙107例程汇总(STM32F107)
万利STM32F107VC 原理图
STM32F103 ADC多通道检测必须要DMA吗?
【官方例程】STM32F107以太网官方例程