USB 枚举过程

来源:互联网 发布:医学宝典软件怎么注册 编辑:程序博客网 时间:2024/05/08 08:03

HS/FS

  1. connection detect(注意,这里的connection指的是检测到attach/termination等开始的connection,从软件层面看来是link status chg)
    在这一步,因为host/device端都可以检测到对端的termination阻抗,因此确定设备插上,VBUS开始供电。通过对端termination阻抗的检测,可以确定进入SS枚举还是HS/FS或者LS枚举。
  2. port stabilization debounce
    在这一步,需要约200ms的debounce时间,保持插入连接的稳定性(由于很多时候在U口插入的过程中就能检测到connection了,因此需要一个debounce时间保证用户完成插入动作)
  3. port reset
    在这一步,host先发起在总线上拉起SE0,宣布开始速度枚举。device根据自己支持的传输速度,在dp/dm上拉起JK序列表达速度能力。
    HS:device保持dp上拉,同时发起chirpK,host检测到chirpK后在总线上交替发出chirpK-chirpJ,device检测到后去掉dp的上拉,速度枚举完成,速度HS
    FS:device保持dp上拉,结束
  4. first device descriptor request
    这一步仅仅用于host查询device的control endpoint支持的maximum packet size,device必须至少回复device descriptor中的前8个byte
  5. (only in windows)second port reset
    该步骤是为了兼容早起的usb device,不支持连续两次get descriptor的命令请求,故插入一次port reset
  6. set usb address
    host为device分配device address
  7. device descriptor request
    这一步需要获取完整的device descriptor
  8. configuration descriptor request
    这一步需要获取device的configuration descriptor
  9. (only in windows)MS OS descriptor query
    MS定义了一些额外的vendor specific的descriptor,在该步骤内获取
    如果device descriptor的 bcdUSB 为 0x0100 或 0x0110,则host会跳过该步骤
  10. serial number string descriptor
    如果device descriptor的serial number string index非零,则发起该步骤
  11. (only in windows) MS OS extended configuration descriptor request
    MS针对特定设备增加的configuration descriptor
  12. OS container ID descriptor query
    从windows7起,windows引入了container ID的概念,可以将设备的某些功能组合在一起
  13. language ID query
    查询device支持的language ID
  14. product ID string query
    查询device的product ID
  15. device qualifier descriptor query
    如果设备的bcdUSB大于等于0x200,host会发起该查询确认设备是否支持HS
  16. duplicate device detection 
    为了确认该device是否被重复枚举过了。当usb host驱动从EHCI切换至USB1.1时,会发生该种重复枚举的情形

SS:(to be continured)

0 0
原创粉丝点击