USB device identification loading process __descriptor

Source: Internet
Author: User

(1) New equipment for hub detection
The host hub monitors the signal voltages of each port and is detectable when new devices are plugged in. (Each of the two signal lines on the hub port has a 15kω drop resistor, and each device has a 1.5kω pull resistor on the d+.) When using a USB cable

When the PC and the device are connected, the pull resistance of the device causes the potential of the signal line to rise, so it is detected by the host hub. )
(2) When the host knows the new device is connected
Each hub reports an event on the hub with an interrupt transfer. When the host knows this event, it sends a GET_STATUS request to the hub for more information. The returned message tells the host when a device is connected.
(3) Hubs reset this new device
When the host is aware of a new device, the host sends a SET_FEATURE request to the hub, requesting the hub to reset the port. The hub causes the device's USB cable to be in a reset (reset) state of at least 10ms.
(4) The hub establishes a signal path between the equipment and the host.
The host sends a GET_STATUS request to verify that the device is arousing the reboot state. One of the returned data indicates that the device is still in a reboot state. When the hub releases the reboot state, the device is in the default state, that is, the device is ready to pass

Endpoint 0 's default process response controls transmission. That is, the device now uses the default address 0x0 to communicate with the host.
(5) Hub detection equipment speed
The hub detects that the signal line (d+ or D) has a higher voltage at idle to detect whether the device is a low-speed device or full speed device. (Full speed and high speed equipment d+ has pull resistance, low speed equipment D has pull resistance).

Below, the USB firmware is required to intervene
(6) Get Maximum packet length
The PC sends the Get_device_descriptor command specified in the USB protocol to address 0 to obtain the maximum packet length supported by the default control pipe and waits for a limited amount of time for the USB device's response, which is included in the device descriptor's

The BMaxPacketSize0 field has an address offset of 7, so the host only needs to read the first 8 bytes of the descriptor. Note that the host can only enumerate one USB device at a time, so only one USB device can use the default address 0 at the same time.
The following operations are similar, different operating systems set the time delay is not the same, for example, Win2K is about a few milliseconds, if no response to send another command, repeat three times.
(7) The host assigns a new address to the device
The host assigns a unique address to the device by sending a set_address request. The device reads the request, returns a confirmation, and saves the new address. This new address is used for all communications since then.
(8) The host resend the Get_device_descriptor command to the new address, reading all the fields of its device descriptor to understand the overall information of the device, such as Vid,pid.
(9) The host sends the get_device_configuration command to the device, requiring the USB device to answer to read all the configuration information.
(10) The host sends the get_device_string command, obtains the character set description (Unicode), for example the production business, the product description, the model and so on.
(11) At this time the host will pop up the window, showing the discovery of new equipment information, production, product description, model and so on.
(12) According to Device_descriptor and device_configuration answer, PC judge whether can provide USB driver, general Win2K can provide several kinds of equipment, such as game joystick, storage, printer, scanner, etc. The operation is running in the background.

But Win98 can not, so at this time will be pop-up dialog box, ask for USB driver.
(13) After the USB device driver is loaded, the host sends the set_configuration (x) command to select an appropriate configuration for the device (x represents a configuration value other than 0). If the configuration is successful, the USB device is in the "configured" state and can be entered with the client software

Line data transfer. At this point, the general USB completes its necessary configuration and connection work. Review the Registry to find that the appropriate items have been added, so the device should be ready to use. However, the USB protocol also provides some user-selectable

Protocol, the device will not fail if it does not answer, but it will affect the functionality of the system.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.