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

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

[复制链接]
anyonezhang 发布时间:2020-7-2 11:05
请教FAE,使用CUbeMX建立USB_HOST工程,已经能够识别鼠标和键盘,也能收到数据。但是接上电磁屏(HID设备,类似鼠标),不能接收数据是什么原因?9 F3 a* n4 z. N4 X0 m5 k
设备已经连接成功了如下:$ I8 |9 T  T9 }) e7 Y( X& u7 j2 w
USB Device Connected
* E4 u) w, ~5 @" D* cUSB Device Reset Completed0 t% C$ U( d. \, F& Z9 |. i' j
PID: 6dh1 q3 J% G" M5 f" `% G6 k% Z
VID: 256ch
9 Q* Z0 X, v! q, m/ i/ BAddress (#1) assigned.' }4 M& M3 e0 T3 G" X. ]$ V6 x
Manufacturer : GAOMON+ ?7 r5 t' W/ H/ t/ ^5 u$ @3 a
Product : Gaomon Tablet4 P+ k2 N5 p2 A; j) Z( m$ A5 A
Serial Number :
& {) g/ p$ I+ ^- d6 J1 |3 P, @Enumeration done.
( A% c+ ~9 R% @+ cThis device has only 1 configuration.
1 _7 I- p9 I: m1 C) E! a7 WDefault configuration set.' M' a" \1 h# R0 r4 F
Device remote wakeup enabled
% v, L' Q; C4 n! b# BSwitching to Interface (#0)
; i1 p) J- R% ^7 Z( EClass    : 3h
, M: w& w4 P6 i: Y! CSubClass : 1h
0 ?1 Y# g4 ~) D# ~% nProtocol : 2h
% H3 f5 D; o6 r; qMouse device found!. x6 ^+ H9 J. d6 X8 S) Z
HID class started.
赞 收藏 评论3 发布时间:2020-7-2 11:05

举报

3个回答
天臆弄人 回答时间:2020-7-2 13:55:06
改下端口就是了
anyonezhang 回答时间:2020-7-2 14:49:43
天臆弄人 发表于 2020-7-2 13:55
! P& p3 q& T0 _4 V8 p. h! F改下端口就是了

8 `# ~1 N0 r- m! U十分感谢  能具体一点吗?在usbh_ioreq.c usbh_core.c usbh_ctlreq.c usbh_pipes.c usbh_hid.c的哪个文件里面改?
anyonezhang 回答时间:2020-7-4 13:37:45
获取的报告描述符如下: " d4 \; G7 K( C
bLength: 12h
- ]) r% j8 k. @5 S0 D; H$ YbDescriptorType: 1h
: _+ j( G- x  ^4 vbcdUSB: 200h7 o+ S. M) a. W; A' B% H
bDeviceClass: 0h  s9 A8 R/ p6 P9 ~
bDeviceSubClass: 0h# V* i$ |4 ]3 a9 F+ _' R
bDeviceProtocol: 0h, a+ A* y, t3 N0 H, x7 |1 m2 o
bMaxPacketSize: 8h
1 l8 s+ N8 `" @bDeviceClass: 0h
5 Z, F5 }) j1 [# L, `; d: {7 ZPID: 6dh
8 _" h4 O4 [6 c: l/ H6 \- fVID: 256ch& R/ b' u% k: Z( F0 J
bcdDevice: 100h
& C4 A# B  M$ Q  i: qiManufacturer: 1h
! J$ O5 U- r4 s8 f) l( `iProduct: 2h
4 D( v' N# t1 J0 o6 oiSerialNumber: 3h! o. l9 ?- @7 y, g+ ^9 ~5 n
bNumConfigurations: 1h4 [3 e6 f9 U8 k6 t! ?; h* Z
Address (#1) assigned.
  @* c2 F: I( Y1 xbLength: 9h
+ b3 ~+ M9 q4 `! f# ~& PbDescriptorType: 2h
6 L, P7 E3 f4 [wTotalLength: 3bh* H- S' P( B( K3 C8 u  |
bDescriptorType: 2h4 P% f! B/ y5 T& i! P6 |
bNumInterfaces: 2h
4 K7 S, f: t6 I3 M  _bConfigurationValue: 1h
3 E! \) C3 ]  x0 giConfiguration: 0h0 m) q" I1 ^8 ?) I& _
bmAttributes: a0h" [/ ]9 h( Z2 @
bMaxPower: f0h
2 V9 ^8 B8 s2 yItf_Desc[0].bLength: 9h  O( t( L1 d1 P7 g
Itf_Desc[0].bDescriptorType: 4h. c% X4 I" @) ?7 @1 x
Itf_Desc[0].bInterfaceNumber: 0h
& r, j6 G% L( \9 K' _Itf_Desc[0].bAlternateSetting: 0h$ X% I& Q1 [: C
Itf_Desc[0].bNumEndpoints: 1h
7 \9 u6 w" x2 l2 A; L7 \Itf_Desc[0].bInterfaceClass: 3h, E+ k: d( u& Q5 [! z) }
Itf_Desc[0].bInterfaceSubClass: 1h
. S/ r; V4 q; r# N  h! [Itf_Desc[0].bInterfaceProtocol: 2h/ V* `; q0 U8 C6 a  f
Itf_Desc[0].iInterface: 0h7 B' U; E1 O# W
Itf_Desc[0].Ep_Desc.bLength: 7h
  S  M) z4 S( K6 e) PItf_Desc[0].Ep_Desc.bDescriptorType: 5h
% M% L% q* D3 |Itf_Desc[0].Ep_Desc.bEndpointAddress: 81h. C5 g+ _! u) b
Itf_Desc[0].Ep_Desc.bmAttributes: 3h
" e) P4 `7 Z% G. kItf_Desc[0].Ep_Desc.wMaxPacketSize: 40h
4 s+ l9 r' ]& [7 B* q" EItf_Desc[0].Ep_Desc.bInterval: 2h) M3 K& y4 `' s9 D
' T* {0 G& m4 s0 P) N4 @1 E; o
Itf_Desc[1].bLength: 9h0 f' l& V6 I% j1 T& b
Itf_Desc[1].bDescriptorType: 4h+ @$ Z7 f' Z) [: T
Itf_Desc[1].bInterfaceNumber: 1h* v! W9 W$ |( c* Y% g
Itf_Desc[1].bAlternateSetting: 0h. k- Z1 \$ R( g, m% ]6 h, w, f
Itf_Desc[1].bNumEndpoints: 1h
% G: V4 q. I& w6 w* F, G" PItf_Desc[1].bInterfaceClass: 3h% {+ h3 S4 Y* _! r; ~
Itf_Desc[1].bInterfaceSubClass: 1h# M% C' H; f1 N% y, y; O
Itf_Desc[1].bInterfaceProtocol: 2h3 h+ j7 N/ K" s! C
Itf_Desc[1].iInterface: 0h7 k1 B) W5 ]0 P. @# l6 h! y4 ?
Itf_Desc[1].Ep_Desc.bLength: 7h% V. [& m/ @# P, x" \
Itf_Desc[1].Ep_Desc.bDescriptorType: 5h
9 F% o/ N. S: F+ z4 K/ NItf_Desc[1].Ep_Desc.bEndpointAddress: 82h
3 k2 j. F3 W5 A& kItf_Desc[1].Ep_Desc.bmAttributes: 3h
5 ?$ U$ t- ^. @) ^: U+ m2 oItf_Desc[1].Ep_Desc.wMaxPacketSize: 10h  u0 S; H- N8 I! k
Itf_Desc[1].Ep_Desc.bInterval: 2h
% A9 @" b: s8 r* v* q! C4 t0 V% F/ c4 \Manufacturer : GAOMON/ I8 O- A0 ]9 x5 r& H8 C: e5 T; }
Product : Gaomon Tablet% l7 P% X$ O& @) X/ j( V. s+ u
Serial Number : 7 _6 z! y# L7 B- m
Enumeration done.* R; `8 I; r# d. I/ ^; ~$ g  p5 o
This device has only 1 configuration.8 h3 I/ @! o+ W9 E: S" @8 _
Default configuration set.0 u" d) \! M1 r% S
Device remote wakeup enabled. d+ s- t* K0 R2 W2 f5 R! n4 E
interface;0! A2 {9 A% o% L( k
Switching to Interface (#0)
2 `/ m& p, X% {' F% QClass    : 3h& w$ O" N) l/ r4 B' M1 |
SubClass : 1h
/ n8 f/ T8 g) g% [) s; {4 ?* RProtocol : 2h
/ ]3 P$ U( z: ]" f; oMouse device found!
- w3 D. D& p2 g/ Q2 l- DHID class started.3 Q) I* `" s* @3 g. N7 v
HID_Handle->HID_Desc.bLength:9h& }( C9 Z! E& O, ~; B3 I4 {0 Y/ R
HID_Handle->HID_Desc.bDescriptorType:21h
( }# X- _* W$ J: i  r6 a: `HID_Handle->HID_Desc.bcdHID:111h
* A  I" ~  W& f  kHID_Handle->HID_Desc.bCountryCode:0h
. d1 b/ B8 [2 \/ I0 j. q4 }% pHID_Handle->HID_Desc.bNumDescriptors:1h
$ d) _( e( d2 W4 q  p: YHID_Handle->HID_Desc.bReportDescriptorType:22h
  w6 l) m  j* e6 g6 |' M% K/ QHID_Handle->HID_Desc.wItemLength:12h
8 P' h2 a) F1 y2 Y# B: D报告描述符如下:
4 w+ T3 Z7 f3 D- i% ?9 K9 L0x06 0x00 0xff 8 D( H' s! i# d7 H% Z- k$ K1 T4 p9 h
0x09 0x01
9 w3 F( Q; [, a! M: p9 p' U6 T0xa1 0x01
; J* }# T3 z/ t% U& J: F0x85 0x08   S) z, b* f) o$ C5 R8 t  G% {  ?
0x75 0x58 8 U; }( N: n6 u1 a) {+ I
0x95 0x01
" [# k9 T" \' ^. Q& X1 t. P0x09 0x01 ! K6 q! J. b" d: w
0x81 0x02 3 l) Q3 u# x* Z8 c/ R. i( @
0xc0 0xff 0 E5 ], E; v) I3 X; s

$ o+ F3 P1 c  V1 B) O% U0 g2 r) e4 S4 ~1 g6 [2 F( b0 D
2、函数  status = USBH_HID_GetReport(phost, 0x01U, 0U, HID_Handle->pData, (uint8_t)HID_Handle->length);  返回的一直是USBH_BUSY5 ]1 P. Z2 R& w. `7 N* |$ \7 m& u6 f

+ X2 n# Z! j) N9 k) p3、设备有两个接口描述符,STM32的USB_LIb不支持两个接口的设备?

所属标签

相似技术帖

官网相关资源

关于
我们是谁
投资者关系
意法半导体可持续发展举措
创新与技术
意法半导体官网
联系我们
联系ST分支机构
寻找销售人员和分销渠道
社区
媒体中心
活动与培训
隐私策略
隐私策略
Cookies管理
行使您的权利
官方最新发布
人形机器人运动控制、感知与智能配电
半导体创新技术与应用方向
EE架构与软件定义汽车
12V/48V 汽车智能配电(SPD)
区域控制单元(ZCU)与分区架构
关注我们
st-img 微信公众号
st-img 手机版