你的浏览器版本过低,可能导致网站不能正常访问!
为了你能正常使用网站功能,请使用这些浏览器。

STM32F407VE使用USB_HOST接上HID设备不能接收数据?

[复制链接]
anyonezhang 发布时间:2020-7-2 11:05
请教FAE,使用CUbeMX建立USB_HOST工程,已经能够识别鼠标和键盘,也能收到数据。但是接上电磁屏(HID设备,类似鼠标),不能接收数据是什么原因?
设备已经连接成功了如下:
USB Device Connected
USB Device Reset Completed
PID: 6dh
VID: 256ch
Address (#1) assigned.
Manufacturer : GAOMON
Product : Gaomon Tablet
Serial Number :
Enumeration done.
This device has only 1 configuration.
Default configuration set.
Device remote wakeup enabled
Switching to Interface (#0)
Class    : 3h
SubClass : 1h
Protocol : 2h
Mouse device found!
HID class started.
收藏 评论3 发布时间:2020-7-2 11:05

举报

3个回答
天臆弄人 回答时间:2020-7-2 13:55:06
改下端口就是了
anyonezhang 回答时间:2020-7-2 14:49:43

十分感谢  能具体一点吗?在usbh_ioreq.c usbh_core.c usbh_ctlreq.c usbh_pipes.c usbh_hid.c的哪个文件里面改?
anyonezhang 回答时间:2020-7-4 13:37:45
获取的报告描述符如下:
bLength: 12h
bDescriptorType: 1h
bcdUSB: 200h
bDeviceClass: 0h
bDeviceSubClass: 0h
bDeviceProtocol: 0h
bMaxPacketSize: 8h
bDeviceClass: 0h
PID: 6dh
VID: 256ch
bcdDevice: 100h
iManufacturer: 1h
iProduct: 2h
iSerialNumber: 3h
bNumConfigurations: 1h
Address (#1) assigned.
bLength: 9h
bDescriptorType: 2h
wTotalLength: 3bh
bDescriptorType: 2h
bNumInterfaces: 2h
bConfigurationValue: 1h
iConfiguration: 0h
bmAttributes: a0h
bMaxPower: f0h
Itf_Desc[0].bLength: 9h
Itf_Desc[0].bDescriptorType: 4h
Itf_Desc[0].bInterfaceNumber: 0h
Itf_Desc[0].bAlternateSetting: 0h
Itf_Desc[0].bNumEndpoints: 1h
Itf_Desc[0].bInterfaceClass: 3h
Itf_Desc[0].bInterfaceSubClass: 1h
Itf_Desc[0].bInterfaceProtocol: 2h
Itf_Desc[0].iInterface: 0h
Itf_Desc[0].Ep_Desc.bLength: 7h
Itf_Desc[0].Ep_Desc.bDescriptorType: 5h
Itf_Desc[0].Ep_Desc.bEndpointAddress: 81h
Itf_Desc[0].Ep_Desc.bmAttributes: 3h
Itf_Desc[0].Ep_Desc.wMaxPacketSize: 40h
Itf_Desc[0].Ep_Desc.bInterval: 2h

Itf_Desc[1].bLength: 9h
Itf_Desc[1].bDescriptorType: 4h
Itf_Desc[1].bInterfaceNumber: 1h
Itf_Desc[1].bAlternateSetting: 0h
Itf_Desc[1].bNumEndpoints: 1h
Itf_Desc[1].bInterfaceClass: 3h
Itf_Desc[1].bInterfaceSubClass: 1h
Itf_Desc[1].bInterfaceProtocol: 2h
Itf_Desc[1].iInterface: 0h
Itf_Desc[1].Ep_Desc.bLength: 7h
Itf_Desc[1].Ep_Desc.bDescriptorType: 5h
Itf_Desc[1].Ep_Desc.bEndpointAddress: 82h
Itf_Desc[1].Ep_Desc.bmAttributes: 3h
Itf_Desc[1].Ep_Desc.wMaxPacketSize: 10h
Itf_Desc[1].Ep_Desc.bInterval: 2h
Manufacturer : GAOMON
Product : Gaomon Tablet
Serial Number :
Enumeration done.
This device has only 1 configuration.
Default configuration set.
Device remote wakeup enabled
interface;0
Switching to Interface (#0)
Class    : 3h
SubClass : 1h
Protocol : 2h
Mouse device found!
HID class started.
HID_Handle->HID_Desc.bLength:9h
HID_Handle->HID_Desc.bDescriptorType:21h
HID_Handle->HID_Desc.bcdHID:111h
HID_Handle->HID_Desc.bCountryCode:0h
HID_Handle->HID_Desc.bNumDescriptors:1h
HID_Handle->HID_Desc.bReportDescriptorType:22h
HID_Handle->HID_Desc.wItemLength:12h
报告描述符如下:
0x06 0x00 0xff
0x09 0x01
0xa1 0x01
0x85 0x08
0x75 0x58
0x95 0x01
0x09 0x01
0x81 0x02
0xc0 0xff


2、函数  status = USBH_HID_GetReport(phost, 0x01U, 0U, HID_Handle->pData, (uint8_t)HID_Handle->length);  返回的一直是USBH_BUSY

3、设备有两个接口描述符,STM32的USB_LIb不支持两个接口的设备?

所属标签

STM32团队

意法半导体微控制器和微处理器拥有广泛的产品线,包含低成本的8位单片机和基于ARM® Cortex®-M0、M0+、M3、M4、M33、M7及A7内核并具备丰富外设选择的32位微控制器及微处理器


最新内容

相似技术帖

官网相关资源

关于
我们是谁
投资者关系
意法半导体可持续发展举措
创新与技术
意法半导体官网
联系我们
联系ST分支机构
寻找销售人员和分销渠道
社区
媒体中心
活动与培训
隐私策略
隐私策略
Cookies管理
行使您的权利
官方最新发布
STM32N6 AI生态系统
STM32MCU,MPU高性能GUI
ST ACEPACK电源模块
意法半导体生物传感器
STM32Cube扩展软件包
关注我们
微信公众号二维码 微信公众号
手机版二维码 手机版