Recently, I am working on the optimization of the burning and Writing Tools. Some content about USB needs to be summarized, including the device initialization process and enumeration process.
During the enumeration process, the device will always wait for the status of the PC. When the reset command is executed, the device will be reenumerated. But how does this Reset terminal come from?
Halt Conditions
A control endpoint may recover from a halt condition upon processing ing a setup packet. if the endpoint does not recover from a setup packet, it may need to be recovered via a different pipe. if an endpoint with the endpoint number 0 does not recover with a setup packet, the host shoshould issue a device reset.
The above description is available in the USB protocol, which roughly means that when the control power-off receives the setup package, HC suspends the status and recovers. If the endpoint is not restored from the setup package, it may need to be restored through different pipelines. If endpoint 0 is not recovered from the setup package, the host generates a device restart event.
In this way, it can be explained that during the DFU file operation, the program must continuously receive interruptions. After the reset, the device will be re-enumerated. The specific operation will be described later.