4.4.2. USB枚举的过程

此处摘录一个,[12]中的关于windows下USB枚举的过程的总结:

  1. The host or hub detects the connection of a new device via the device's pull up resistors on the data pair. The host waits for at least 100ms allowing for the plug to be inserted fully and for power to stabilise on the device.
  2. Host issues a reset placing the device is the default state. The device may now respond to the default address zero.
  3. The MS Windows host asks for the first 64 bytes of the Device Descriptor.
  4. After receiving the first 8 bytes of the Device Descriptor, it immediately issues another bus reset.
  5. The host now issues a Set Address command, placing the device in the addressed state.
  6. The host asks for the entire 18 bytes of the Device Descriptor.
  7. It then asks for 9 bytes of the Configuration Descriptor to determine the overall size.
  8. The host asks for 255 bytes of the Configuration Descriptor.
  9. Host asks for any String Descriptors if they were specified.

At the end of Step 9, Windows will ask for a driver for your device. It is then common to see it request all the descriptors again before it issues a Set Configuration request.

而相对来说,更加详细一点的解释,可以去看Enumeration: How the Host Learns about Devices

其实,单独看此文字描述,虽然解释的很是详细了,但是还是很难彻底搞懂。

所以,后面会专门通过第 4.4.3 节 “举例详解USB的枚举过程”来彻底的解析,到底USB的枚举的过程如何,以及发送的数据的详细所对应的含义。