完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
尝试STM32F103VB上使用tinyusb,完成配置之后开始没有反应。调试后发现
这个上拉电阻的实现需要手动实现控制: dcd_disconnectdcd_connect 之后调试发现设备还是无法识别: 之后打开TinyUSB的调试日志 #define CFG_TUSB_DEBUG 3 之后上电出现调试信息: msh >USBD Bus Reset : Full Speed USBD Bus Reset : Full Speed USBD Setup Received 80 06 00 01 00 00 40 00 Get Descriptor Device Queue EP 80 with 18 bytes ... USBD Xfer Complete on EP 80 with 18 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Bus Reset : Full Speed USBD Setup Received 00 05 2A 00 00 00 00 00 Set Address USBD Xfer Complete on EP 80 with 0 bytes USBD Bus Reset : Full Speed USBD Setup Received 80 06 00 01 00 00 40 00 Get Descriptor Device Queue EP 80 with 18 bytes ... USBD Xfer Complete on EP 80 with 18 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Bus Reset : Full Speed USBD Setup Received 00 05 2B 00 00 00 00 00 Set Address USBD Xfer Complete on EP 80 with 0 bytes USBD Bus Reset : Full Speed USBD Setup Received 80 06 00 01 00 00 40 00 Get Descriptor Device Queue EP 80 with 18 bytes ... USBD Xfer Complete on EP 80 with 18 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Bus Reset : Full Speed USBD Setup Received 00 05 2C 00 00 00 00 00 Set Address USBD Xfer Complete on EP 80 with 0 bytes USBD Bus Reset : Full Speed USBD Setup Received 80 06 00 01 00 00 40 00 Get Descriptor Device Queue EP 80 with 18 bytes ... USBD Xfer Complete on EP 80 with 18 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Bus Reset : Full Speed USBD Setup Received 00 05 2D 00 00 00 00 00 Set Address USBD Xfer Complete on EP 80 with 0 bytes USBD Suspend : Remote Wakeup = 0 从调试信息上看,有获取设备描述符的指令执行 USBD Setup Received 80 06 00 01 00 00 40 00 Get Descriptor Device Queue EP 80 with 18 bytes ... USBD Xfer Complete on EP 80 with 18 bytes 此指令确实是有执行的,于是使用逻辑分析仪抓取USB数据 可以看到获取设备描述符的指令,在附近查找相关指令回复 展开回复: 看到设备也是有回复的 但是这个设备就是无法识别! 后面多抓取一些数据,发现,只是第一次有回应,后面的多次发送都没有回应 好像确实是没有回应PC的获取设备描述符,但是既然能回应一次,为何后面的数据就发送不出来了? 我的配置参数如下: #define PKG_USING_TINYUSB #define PKG_TINYUSB_STACK_SIZE 2048 #define PKG_TINYUSB_THREAD_PRIORITY 8 #define PKG_TINYUSB_MEM_SECTION ".data" #define PKG_TINYUSB_MEM_ALIGN 4 #define PKG_TINYUSB_RHPORT_NUM_1 #define PKG_TINYUSB_RHPORT_NUM 0 #define PKG_TINYUSB_FULL_SPEED #define PKG_TINYUSB_DEVICE_PORT_SPEED 0x00 #define PKG_TINYUSB_DEVICE_ENABLE #define PKG_TINYUSB_DEVICE_VID 0x0483 #define PKG_TINYUSB_DEVICE_PID 0x5A4F #define PKG_TINYUSB_DEVICE_MANUFACTURER "RP552D" #define PKG_TINYUSB_DEVICE_PRODUCT "NL_v6.x.x" #define PKG_TINYUSB_EDPT0_SIZE 64 #define PKG_TINYUSB_DEVICE_CURRENT 500 #define PKG_TINYUSB_DEVICE_HID #define CFG_TUD_HID 1 #define PKG_TINYUSB_DEVICE_HID_STRING "RP552D_NL_v6.x.x" #define PKG_TINYUSB_DEVICE_HID_EPNUM 4 #define PKG_TINYUSB_DEVICE_HID_INT 1 #define PKG_TINYUSB_DEVICE_HID_KEYBOARD #define PKG_TINYUSB_DEVICE_HID_MOUSE #define PKG_TINYUSB_DEVICE_HID_CONSUMER #define PKG_TINYUSB_DEVICE_HID_EP_BUFSIZE 64 #define PKG_TINYUSB_DEVICE_EXAMPLE #define PKG_TINYUSB_DEVICE_EXAMPLE_HID #define PKG_TINYUSB_DEBUG_ERROR #define CFG_TUSB_DEBUG 1 #define PKG_USING_TINYUSB_V01300 |
|
相关推荐
2个回答
|
|
尝试STM32F103VB上使用tinyusb,完成配置之后开始没有反应。调试后发现
[img]https://oss-club.rt-thread.org/uploads/20220527/b5e525821e315efd3f78425dd13fd9e3.png[/img] 这个上拉电阻的实现需要手动实现控制: dcd_disconnectdcd_connect [img]https://oss-club.rt-thread.org/uploads/20220527/2247da43e8023adf485fb02ae2fbb952.png[/img] 之后调试发现设备还是无法识别: [img]https://oss-club.rt-thread.org/uploads/20220527/37edf44a84cc779462b82ae3542dfa28.png[/img] 之后打开TinyUSB的调试日志 #define CFG_TUSB_DEBUG 3 之后上电出现调试信息: msh >USBD Bus Reset : Full Speed USBD Bus Reset : Full Speed USBD Setup Received 80 06 00 01 00 00 40 00 Get Descriptor Device Queue EP 80 with 18 bytes ... USBD Xfer Complete on EP 80 with 18 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Bus Reset : Full Speed USBD Setup Received 00 05 2A 00 00 00 00 00 Set Address USBD Xfer Complete on EP 80 with 0 bytes USBD Bus Reset : Full Speed USBD Setup Received 80 06 00 01 00 00 40 00 Get Descriptor Device Queue EP 80 with 18 bytes ... USBD Xfer Complete on EP 80 with 18 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Bus Reset : Full Speed USBD Setup Received 00 05 2B 00 00 00 00 00 Set Address USBD Xfer Complete on EP 80 with 0 bytes USBD Bus Reset : Full Speed USBD Setup Received 80 06 00 01 00 00 40 00 Get Descriptor Device Queue EP 80 with 18 bytes ... USBD Xfer Complete on EP 80 with 18 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Bus Reset : Full Speed USBD Setup Received 00 05 2C 00 00 00 00 00 Set Address USBD Xfer Complete on EP 80 with 0 bytes USBD Bus Reset : Full Speed USBD Setup Received 80 06 00 01 00 00 40 00 Get Descriptor Device Queue EP 80 with 18 bytes ... USBD Xfer Complete on EP 80 with 18 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Bus Reset : Full Speed USBD Setup Received 00 05 2D 00 00 00 00 00 Set Address USBD Xfer Complete on EP 80 with 0 bytes USBD Suspend : Remote Wakeup = 0 从调试信息上看,有获取设备描述符的指令执行 USBD Setup Received 80 06 00 01 00 00 40 00 Get Descriptor Device Queue EP 80 with 18 bytes ... USBD Xfer Complete on EP 80 with 18 bytes 此指令确实是有执行的,于是使用逻辑分析仪抓取USB数据 [img]https://oss-club.rt-thread.org/uploads/20220527/e5aadc4b527e820aa9600e0c781aa3f7.png.webp[/img] 可以看到获取设备描述符的指令,在附近查找相关指令回复 [img]https://oss-club.rt-thread.org/uploads/20220527/0ae4b837431e8a2cba1acfa845d83f98.png.webp[/img] 展开回复: [img]https://oss-club.rt-thread.org/uploads/20220527/3e7d574e212fd45a29b0244a96f6b7af.png.webp[/img] 看到设备也是有回复的 但是这个设备就是无法识别! 后面多抓取一些数据,发现,只是第一次有回应,后面的多次发送都没有回应 [img]https://oss-club.rt-thread.org/uploads/20220527/ad04cc19d6c8cfba752eea940086663c.png.webp[/img] [img]https://oss-club.rt-thread.org/uploads/20220527/59377ac338697c8fed074efb060de71e.png.webp[/img] [img]https://oss-club.rt-thread.org/uploads/20220527/4219d8085045c0f9a242d3dc9ea2be08.png.webp[/img] 好像确实是没有回应PC的获取设备描述符,但是既然能回应一次,为何后面的数据就发送不出来了? 我的配置参数如下: #define PKG_USING_TINYUSB #define PKG_TINYUSB_STACK_SIZE 2048 #define PKG_TINYUSB_THREAD_PRIORITY 8 #define PKG_TINYUSB_MEM_SECTION ".data" #define PKG_TINYUSB_MEM_ALIGN 4 #define PKG_TINYUSB_RHPORT_NUM_1 #define PKG_TINYUSB_RHPORT_NUM 0 #define PKG_TINYUSB_FULL_SPEED #define PKG_TINYUSB_DEVICE_PORT_SPEED 0x00 #define PKG_TINYUSB_DEVICE_ENABLE #define PKG_TINYUSB_DEVICE_VID 0x0483 #define PKG_TINYUSB_DEVICE_PID 0x5A4F #define PKG_TINYUSB_DEVICE_MANUFACTURER "RP552D" #define PKG_TINYUSB_DEVICE_PRODUCT "NL_v6.x.x" #define PKG_TINYUSB_EDPT0_SIZE 64 #define PKG_TINYUSB_DEVICE_CURRENT 500 #define PKG_TINYUSB_DEVICE_HID #define CFG_TUD_HID 1 #define PKG_TINYUSB_DEVICE_HID_STRING "RP552D_NL_v6.x.x" #define PKG_TINYUSB_DEVICE_HID_EPNUM 4 #define PKG_TINYUSB_DEVICE_HID_INT 1 #define PKG_TINYUSB_DEVICE_HID_KEYBOARD #define PKG_TINYUSB_DEVICE_HID_MOUSE #define PKG_TINYUSB_DEVICE_HID_CONSUMER #define PKG_TINYUSB_DEVICE_HID_EP_BUFSIZE 64 #define PKG_TINYUSB_DEVICE_EXAMPLE #define PKG_TINYUSB_DEVICE_EXAMPLE_HID #define PKG_TINYUSB_DEBUG_ERROR #define CFG_TUSB_DEBUG 1 #define PKG_USING_TINYUSB_V01300 |
|
|
|
我用官方的usb设备也是无法识别
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
809 浏览 0 评论
5200 浏览 0 评论
如何使用python调起UDE STK5.2进行下载自动化下载呢?
2672 浏览 0 评论
开启全新AI时代 智能嵌入式系统快速发展——“第六届国产嵌入式操作系统技术与产业发展论坛”圆满结束
3017 浏览 0 评论
获奖公布!2024 RT-Thread全球巡回线下培训火热来袭!报名提问有奖!
32232 浏览 11 评论
73244 浏览 21 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-27 17:13 , Processed in 0.612682 second(s), Total 41, Slave 35 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号