USBHost: Wait for device to implement SET ADDRESS

The USB Device must change the address within 2 ms after completing
SET ADDRESS status stage.

Wait 2 ms before issuing GET DESCRIPTOR under the new address. In my
case, this completely resolves the timeout issues.
pull/10952/head
Tomasz Moń 2019-05-24 10:37:40 +02:00 committed by Arto Kinnunen
parent 5d3f0781fd
commit c92a24d57e
1 changed files with 7 additions and 0 deletions

View File

@ -163,6 +163,13 @@ void USBHost::usb_process()
devices[i].activeAddress(true);
USB_DBG("Address of %p: %d", &devices[i], devices[i].getAddress());
// Wait for the device to actually set the address. The Status stage
// of SET ADDRESS happens before the device implements the request.
// According to Universal Serial Bus Specification Revision 2.0 chapter
// 9.2.6.3 Set Address Processing, the device is allowed SetAddress()
// recovery interval of 2 ms.
ThisThread::sleep_for(2);
// try to read again the device descriptor to check if the device
// answers to its new address
res = getDeviceDescriptor(&devices[i], buf, 8);