Skip to content

USBHost: Wait for device to implement SET ADDRESS #10651

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 31, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions features/unsupported/USBHost/USBHost/USBHost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down