Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
tinyusb
USB
如何运行TinyUSB的CDC demo程序 please open port and make sure DTR=1
发布于 2024-11-12 15:36:14 浏览:115
订阅该版
硬件: STM32H743XIH6 系统: 4.1.1 配置: ![screenshot_image.png](https://oss-club.rt-thread.org/uploads/20241112/036ec3828c5c33b63ab1dcd1ee52e906.png.webp) ![screenshot_image.png](https://oss-club.rt-thread.org/uploads/20241112/4f3743014981515f17cefc43ffb783af.png.webp) 现象: HID程序能正常工作, 也成功枚举了CDC串口 我打开串口助手, 波特率115200, 8位, 无校验, 停止1 运行 `cdc_example` 结果: ![screenshot_image.png](https://oss-club.rt-thread.org/uploads/20241112/f7bf2553235fd1a1b3c90337b371a086.png) 显示没有连接 ![screenshot_image.png](https://oss-club.rt-thread.org/uploads/20241112/e7a0b10d4d72f67a83e94e7ddabed136.png) 使用了复合设备, 我也试过关闭HID也不能运行 TinyUSB调试信息: ``` msh >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 28 00 00 00 00 00 Set Address USBD Xfer Complete on EP 80 with 0 bytes USBD Setup Received 80 06 00 01 00 00 12 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 Setup Received 80 06 00 02 00 00 FF 00 Get Descriptor Configuration[0] Queue EP 80 with 64 bytes ... USBD Xfer Complete on EP 80 with 64 bytes Queue EP 80 with 36 bytes ... USBD Xfer Complete on EP 80 with 36 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 80 06 03 03 09 04 FF 00 Get Descriptor String[3] Queue EP 80 with 50 bytes ... USBD Xfer Complete on EP 80 with 50 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 80 06 00 03 00 00 FF 00 Get Descriptor String[0] Queue EP 80 with 4 bytes ... USBD Xfer Complete on EP 80 with 4 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 80 06 02 03 09 04 FF 00 Get Descriptor String[2] Queue EP 80 with 30 bytes ... USBD Xfer Complete on EP 80 with 30 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 80 06 00 06 00 00 0A 00 Get Descriptor Device Qualifier Stall EP0 USBD Setup Received 80 06 00 01 00 00 12 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 Setup Received 80 06 00 02 00 00 09 00 Get Descriptor Configuration[0] Queue EP 80 with 9 bytes ... USBD Xfer Complete on EP 80 with 9 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 80 06 00 02 00 00 64 00 Get Descriptor Configuration[0] Queue EP 80 with 64 bytes ... USBD Xfer Complete on EP 80 with 64 bytes Queue EP 80 with 36 bytes ... USBD Xfer Complete on EP 80 with 36 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 00 09 01 00 00 00 00 00 Set Configuration Open EP 81 with Size = 8 Allocated 8 bytes at offset 4024 Open EP 02 with Size = 64 Open EP 82 with Size = 64 Allocated 64 bytes at offset 3960 Queue EP 02 with 64 bytes ... CDC opened Bind EP 81 to driver id 0 Bind EP 02 to driver id 0 Bind EP 82 to driver id 0 Open EP 84 with Size = 16 Allocated 16 bytes at offset 3944 HID opened Bind EP 84 to driver id 1 Queue EP 80 with 0 bytes ... USBD Xfer Complete on EP 80 with 0 bytes USBD Setup Received 80 06 04 03 09 04 04 00 Get Descriptor String[4] Queue EP 80 with 4 bytes ... USBD Xfer Complete on EP 80 with 4 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 80 06 00 03 00 00 FF 00 Get Descriptor String[0] Queue EP 80 with 4 bytes ... USBD Xfer Complete on EP 80 with 4 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 80 06 04 03 09 04 18 00 Get Descriptor String[4] Queue EP 80 with 24 bytes ... USBD Xfer Complete on EP 80 with 24 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 80 06 01 03 09 04 FF 00 Get Descriptor String[1] Queue EP 80 with 16 bytes ... USBD Xfer Complete on EP 80 with 16 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 80 06 06 03 09 04 04 00 Get Descriptor String[6] Queue EP 80 with 4 bytes ... USBD Xfer Complete on EP 80 with 4 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 80 06 02 03 09 04 FF 00 Get Descriptor String[2] Queue EP 80 with 30 bytes ... USBD Xfer Complete on EP 80 with 30 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 80 06 06 03 09 04 18 00 Get Descriptor String[6] Queue EP 80 with 24 bytes ... USBD Xfer Complete on EP 80 with 24 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received A1 21 00 00 00 00 07 00 CDC control request Get Line Coding Queue EP 80 with 7 bytes ... USBD Xfer Complete on EP 80 with 7 bytes CDC control complete Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 21 22 00 00 00 00 00 00 CDC control request Queue EP 80 with 0 bytes ... USBD Xfer Complete on EP 80 with 0 bytes Set Control Line State: DTR = 0, RTS = 0 USBD Setup Received 21 20 00 00 00 00 07 00 CDC control request Set Line Coding Queue EP 00 with 7 bytes ... USBD Xfer Complete on EP 00 with 7 bytes 0000: 00 C2 01 00 00 00 08 |.......| CDC control complete Queue EP 80 with 0 bytes ... USBD Xfer Complete on EP 80 with 0 bytes USBD Setup Received A1 21 00 00 00 00 07 00 CDC control request Get Line Coding Queue EP 80 with 7 bytes ... USBD Xfer Complete on EP 80 with 7 bytes CDC control complete Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 21 0A 00 00 02 00 00 00 HID control request Queue EP 80 with 0 bytes ... USBD Xfer Complete on EP 80 with 0 bytes USBD Setup Received 81 06 00 22 02 00 EB 00 Get Descriptor HID control request Queue EP 80 with 64 bytes ... USBD Xfer Complete on EP 80 with 64 bytes Queue EP 80 with 64 bytes ... USBD Xfer Complete on EP 80 with 64 bytes Queue EP 80 with 43 bytes ... USBD Xfer Complete on EP 80 with 43 bytes HID control complete Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 21 09 01 02 02 00 02 00 HID control request Queue EP 00 with 2 bytes ... USBD Xfer Complete on EP 00 with 2 bytes 0000: 01 01 |..| HID control complete Queue EP 80 with 0 bytes ... USBD Xfer Complete on EP 80 with 0 bytes USBD Setup Received 80 06 06 03 09 04 02 04 Get Descriptor String[6] Queue EP 80 with 24 bytes ... USBD Xfer Complete on EP 80 with 24 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 80 06 03 03 09 04 02 04 Get Descriptor String[3] Queue EP 80 with 50 bytes ... USBD Xfer Complete on EP 80 with 50 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 80 06 06 03 09 04 02 04 Get Descriptor String[6] Queue EP 80 with 24 bytes ... USBD Xfer Complete on EP 80 with 24 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 80 06 03 03 09 04 02 04 Get Descriptor String[3] Queue EP 80 with 50 bytes ... USBD Xfer Complete on EP 80 with 50 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 80 06 06 03 09 04 02 04 Get Descriptor String[6] Queue EP 80 with 24 bytes ... USBD Xfer Complete on EP 80 with 24 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 80 06 03 03 09 04 02 04 Get Descriptor String[3] Queue EP 80 with 50 bytes ... USBD Xfer Complete on EP 80 with 50 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes ``` 这个变量是 `0` 导致的 ![screenshot_image.png](https://oss-club.rt-thread.org/uploads/20241112/75389d43ae9217626570633888468cd3.png.webp) ![screenshot_image.png](https://oss-club.rt-thread.org/uploads/20241112/b775c925be834a91c18c826950506ac2.png) 我把检查cdc连接的换成检查连接, 它确实连上了, 运行也能正常工作, 难道是 `tud_cdc_connected()` 有bug?
查看更多
踩姑娘的小蘑菇
2024-11-13
这家伙很懒,什么也没写!
字面意思:勾选串口调试助手的DTR
1
个回答
默认排序
按发布时间排序
撰写答案
登录
注册新账号
关注者
0
被浏览
115
关于作者
ThinkCode
这家伙很懒,什么也没写!
提问
18
回答
16
被采纳
0
关注TA
发私信
相关问题
1
请教USB Host
2
STM32F4调试USB 读卡器(Slave)提示格式化
3
急求 STM32F4 USB Device MSC+SD 的相关问题
4
USB 框架问题
5
USB键盘
6
LPC17xx 如何添加USB HOST设备
7
RT-Thread目前支持USB HOST了吗?
8
USB HOST的支持问题
9
RTT 2.0.1 USB存储设备问题,枚举到USBREQ_GET_MAX_LUN后复位
10
USB库已经很久没更新了
推荐文章
1
RT-Thread应用项目汇总
2
玩转RT-Thread系列教程
3
国产MCU移植系列教程汇总,欢迎查看!
4
机器人操作系统 (ROS2) 和 RT-Thread 通信
5
五分钟玩转RT-Thread新社区
6
【技术三千问】之《玩转ART-Pi》,看这篇就够了!干货汇总
7
关于STM32H7开发板上使用SDIO接口驱动SD卡挂载文件系统的问题总结
8
STM32的“GPU”——DMA2D实例详解
9
RT-Thread隐藏的宝藏之completion
10
【ART-PI】RT-Thread 开启RTC 与 Alarm组件
最新文章
1
简单两步配置RTT源码阅读环境 vsc+clangd
2
恩智浦[FRDM-MCXN947]初探 之 ADC与DAC
3
LVGL使用字库IC芯片显示中文
4
基于STM32H750和Rt-Thread的CANFD通信实现的记录(一)
5
freemodbus主机在freertos的适配,参考rtthread例程
热门标签
RT-Thread Studio
串口
Env
LWIP
SPI
AT
Bootloader
Hardfault
CAN总线
FinSH
ART-Pi
USB
DMA
文件系统
RT-Thread
SCons
RT-Thread Nano
线程
MQTT
STM32
RTC
FAL
rt-smart
ESP8266
I2C_IIC
UART
WIZnet_W5500
ota在线升级
PWM
cubemx
freemodbus
flash
packages_软件包
BSP
潘多拉开发板_Pandora
定时器
ADC
GD32
flashDB
socket
中断
编译报错
Debug
SFUD
msh
rt_mq_消息队列_msg_queue
keil_MDK
ulog
MicroPython
C++_cpp
本月问答贡献
出出啊
1517
个答案
342
次被采纳
小小李sunny
1443
个答案
289
次被采纳
张世争
805
个答案
174
次被采纳
crystal266
547
个答案
161
次被采纳
whj467467222
1222
个答案
148
次被采纳
本月文章贡献
出出啊
1
篇文章
4
次点赞
小小李sunny
1
篇文章
1
次点赞
张世争
1
篇文章
1
次点赞
crystal266
2
篇文章
2
次点赞
whj467467222
2
篇文章
1
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部