The process of identifying the device and setting a unique address is referred as bus enumeration. The enumeration process is handled by the system software on the host and the USB logical layer on the device side. The enumeration process starts when a device is attached to the host and the device gets the power. The USB specification includes simple steps for enumeration.
- The USB device is attached to the host, which receives an event indicating a change in the pipe’s status. The USB device is in the powered state, and the port it is attached to is disabled.
- The host queries about the change in the bus.
- Once the host determines that a new device is attached, it waits for at least 100ms for the device to become stable after power, after which it enables and resets the port.
- After a successful reset, the USB device is in a default state and can draw power to a range of 100 mA from VBUS pin.
- Once the device is in a default state, the host assigns a unique address to the USB device, which moves the device to an address state.
- The host starts communicating with the USB device in the default control pipe and reads the device descriptor.
- Subsequently, the host reads the device configuration information
- The host selects the configuration, which moves the device to a configured state and makes it ready for use.