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

【实战经验】HID与音频冲突问题

[复制链接]
zero99 发布时间:2016-11-18 16:30
前言0 D% d5 u) A+ y5 {
Demo 程序中,HID 和 Audio 单独运行都不会有问题,把 HID 和 Audio 整合在一起,同进传送数据时,会出现Audio 不能传送数据的情况。
/ R9 H* ]8 }/ V
% A0 z* G: r6 W  F6 }5 P根本原因8 o+ [7 Q3 L# ?1 N2 e5 ?

, t8 ]/ d# \0 k& d9 }基本情况:
% _0 u6 |/ r! z$ P* l9 o' x- t8 y             1. 当增加HID 的传输频率时,这种情况更容易出现。
' k; ?& }- ]' {! t$ G$ u/ R             2. 当HID 包在帧开始时,不会出现这个问题。5 M+ K. j: |2 D1 F
根本原因是相关的参考手册中描述的一个已知的问题。
1 @8 @: y6 c5 S9 H, C9 e! M: q                      35.13.8 Worst case response time( a8 c" g' ~9 u) o( M, i9 ^- ~
                      When the OTG_HS controller acts as a device, there is a worst case response time for any$ \6 ]& Y8 a  N7 w- [  C4 A
                      tokens that follow an isochronous OUT. This worst case response time depends on the AHB
& M4 m" R: ?8 Y5 K  h6 N0 v& u                      clock frequency.
: Q4 ?5 C5 ~& j  t                      The core registers are in the AHB domain, and the core does not accept another token
7 Z$ J- J$ L4 {3 N                      before updating these register values. The worst case is for any token following an
. |+ p, C5 {. h* C+ v+ J                      isochronous OUT, because for an isochronous transaction, there is no handshake and the
) q, o, a5 F9 }+ O- T                      next token could come sooner. This worst case value is 7 PHY clocks when the AHB clock
- M  }7 i6 f0 {) W( z  g8 s                      is the same as the PHY clock. When the AHB clock is faster, this value is smaller.9 ?! \" s; u, p+ c
                      If this worst case condition occurs, the core responds to bulk/interrupt tokens with a NAK
8 I- I4 f! S2 M5 [' D: ?+ S- u                      and drops isochronous and SETUP tokens. The host interprets this as a timeout condition' w- n( q& G9 w5 \- e" ]- D4 _' l0 g
                      for SETUP and retries the SETUP packet. For isochronous transfers, the Incomplete& a5 ]9 ]5 a" |5 F4 E& }
                      isochronous IN transfer interrupt (IISOIXFR) and Incomplete isochronous OUT transfer4 g7 Q+ U4 T$ A
                     interrupt (IISOOXFR) inform the application that isochronous IN/OUT packets were
" [3 T! n; O& S$ `                     dropped.4 m1 a# F- L9 W7 T6 |
因此,建议在帧开始的时候或帧结束前开始发送HID 数据包。
7 }, g; \) \- t8 u0 {2 p; i/ Z- \1 D) ^) ?. ?! L" q

) h3 `5 y  l# K7 F解决方案:
( r7 d$ j5 A+ I0 T              1. 在帧开始的时候发送数据。
% u" g8 K3 }6 a% t+ P; Q              2. 在帧80%,85%,90%,95%时发送数据。通过设置
, R  k2 I* Y, ?2 \: S9 n              #define DCFG_FRAME_INTERVAL_80                        0; q* m- Z8 X2 r7 Y9 S# r, i. g. Q
              #define DCFG_FRAME_INTERVAL_85                        1( K6 [% m8 m0 h
              #define DCFG_FRAME_INTERVAL_90                        2
6 l$ e% k( H8 [8 o: K% H              #define DCFG_FRAME_INTERVAL_95                        3  
' C3 \0 Q: J% p. r% ^6 Y1 }# a# I
. v2 I7 ?* a% a* l- E  h              USBx_DEVICE->DCFG |= DCFG_FRAME_INTERVAL_80;
) k% K% |/ U, r
9 _; g  s. a% M- Z" H* v/ X
6 D# m7 ~1 Y6 h$ |             RM00908 u- ]/ d0 n4 a2 ^5 H& B; E2 m
              34.16.4 Device-mode registers
1 [2 l$ i$ I! ~) a  g              OTG_FS device configuration register (OTG_FS_DCFG)
9 ?8 `! {( d/ P1 q7 E- z/ u% M4 h7 H2 T# j+ I
                     Bits 12:11 PFIVL: Periodic frame interval6 Z4 |) w7 u, m  i# {
                     Indicates the time within a frame at which the application must be notified using
$ Q8 o. g, i  g" y/ _                     the end of4 `2 Q4 |: i4 G4 P- b! X6 M
                     periodic frame interrupt. This can be used to determine if all the isochronous
! c5 j6 `% L3 T7 U. o                     traffic for that
) W/ S: X7 P( j; x                     frame is complete.) F# h# k* t7 o4 u
                     00: 80% of the frame interval
; z) H" x$ z) Q0 g5 I- C% {9 O                     01: 85% of the frame interval- ]7 _9 ~, v% `2 e% e3 t9 F
                     10: 90% of the frame interval
. z" N& `! Z9 L% P                     11: 95% of the frame interval
* s5 z& G9 x6 @" N
5 y) h! [( x8 S7 s; t
9 I# n1 n8 i! E# Y( R* Y
HID与音频冲突问题.pdf (74.99 KB, 下载次数: 18)
1 收藏 1 评论1 发布时间:2016-11-18 16:30

举报

1个回答
feixiang20 回答时间:2017-7-1 21:45:03
这些实验的视频介绍比较重要

所属标签

相似分享

关于意法半导体
我们是谁
投资者关系
意法半导体可持续发展举措
创新和工艺
招聘信息
联系我们
联系ST分支机构
寻找销售人员和分销渠道
社区
媒体中心
活动与培训
隐私策略
隐私策略
Cookies管理
行使您的权利
关注我们
st-img 微信公众号
st-img 手机版