|
前言5 D) ?& N) H2 S0 s Q Demo 程序中,HID 和 Audio 单独运行都不会有问题,把 HID 和 Audio 整合在一起,同进传送数据时,会出现Audio 不能传送数据的情况。 9 h. r1 m6 c% X5 w* v 根本原因' h3 L3 ~6 z& Q0 Y' z/ w. E+ {+ m 6 M; J3 b/ O2 Y) S) N4 n0 g) T 基本情况: 1. 当增加HID 的传输频率时,这种情况更容易出现。 2. 当HID 包在帧开始时,不会出现这个问题。 根本原因是相关的参考手册中描述的一个已知的问题。# p( X) }" a% _2 ~" }0 a! q 35.13.8 Worst case response time When the OTG_HS controller acts as a device, there is a worst case response time for any tokens that follow an isochronous OUT. This worst case response time depends on the AHB clock frequency.; ]& i' q7 d8 ]9 ], F The core registers are in the AHB domain, and the core does not accept another token9 P$ o2 U6 X% h: U- y before updating these register values. The worst case is for any token following an* }- X+ P4 F2 ~8 M: e isochronous OUT, because for an isochronous transaction, there is no handshake and the next token could come sooner. This worst case value is 7 PHY clocks when the AHB clock is the same as the PHY clock. When the AHB clock is faster, this value is smaller.. M( H- d) `9 u. c M If this worst case condition occurs, the core responds to bulk/interrupt tokens with a NAK* i- u; k, l$ a+ w2 ?9 ^( t and drops isochronous and SETUP tokens. The host interprets this as a timeout condition for SETUP and retries the SETUP packet. For isochronous transfers, the Incomplete1 { L9 h) c2 t4 ?4 y7 v/ z isochronous IN transfer interrupt (IISOIXFR) and Incomplete isochronous OUT transfer8 X7 t9 }% `! Q% w. \# } interrupt (IISOOXFR) inform the application that isochronous IN/OUT packets were# E/ t2 h) z% e! _' `1 u2 h dropped." ]* i/ ] U6 Y6 {. a0 O 因此,建议在帧开始的时候或帧结束前开始发送HID 数据包。 . j4 i* b' J* Q, L) T: n2 X 解决方案: 1. 在帧开始的时候发送数据。 2. 在帧80%,85%,90%,95%时发送数据。通过设置. Y/ ]3 C% i/ T$ J #define DCFG_FRAME_INTERVAL_80 0 #define DCFG_FRAME_INTERVAL_85 1 #define DCFG_FRAME_INTERVAL_90 2 #define DCFG_FRAME_INTERVAL_95 3 USBx_DEVICE->DCFG |= DCFG_FRAME_INTERVAL_80;( E, G" P( N1 E 8 q* q5 o0 Y" U% u 7 Z8 i6 W7 K% g+ e RM0090; U6 t. R% T/ i( s! G 34.16.4 Device-mode registers OTG_FS device configuration register (OTG_FS_DCFG) Bits 12:11 PFIVL: Periodic frame interval1 K, f* D: ?; Q% v$ u/ O Indicates the time within a frame at which the application must be notified using2 z* `+ o3 w1 H. Q0 ~ the end of periodic frame interrupt. This can be used to determine if all the isochronous traffic for that frame is complete.4 v/ L' C/ e) d1 g 00: 80% of the frame interval$ O1 e3 j- ] {) F6 m0 ^3 s' B 01: 85% of the frame interval2 Y6 R, \+ ]3 X s' j 10: 90% of the frame interval) H: [; b- I9 n2 ^2 M( n2 u 11: 95% of the frame interval 8 N; ^. ` S( Z) K; ] 2 t8 z. U: P: a) E. o" @
HIDä¸é³é¢å²çªé®é¢.pdf
(74.99 KB, 下载次数: 18)
|
| 这些实验的视频介绍比较重要 |
|
我也出现这个问题,文章里的处理方法是有 otg 设备的,我的是 stm32f103c8t6,没有 otg,有什么其他解决方法吗? |
微信公众号
手机版