Skip to content

USB reset in suspended state #14826

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

Closed
Qbicz opened this issue Mar 22, 2019 · 4 comments
Closed

USB reset in suspended state #14826

Qbicz opened this issue Mar 22, 2019 · 4 comments
Assignees
Labels
area: USB Universal Serial Bus bug The issue is a bug, or the PR is fixing a bug platform: nRF Nordic nRFx priority: low Low impact/importance bug

Comments

@Qbicz
Copy link
Collaborator

Qbicz commented Mar 22, 2019

Describe the bug
On startup, USB stack sends suspend and resume between CONNECTED and CONFIGURED states.

But sometimes USB stack will send RESET callback in between:

USB_DC_SUSPEND
USB_DC_RESET
USB_DC_RESUME

And we get RESUME when we are not suspended. Checked with @pawelzadrozniak - reset should not occur between suspend and resume.

To Reproduce
Using USB HID class. This sequence occurs right after boot, when boot is done with USB connected.

Environment (please complete the following information):

CONFIG_USB=y
CONFIG_USB_NRF52840=y
CONFIG_USB_DEVICE_STACK=y
CONFIG_USB_DEVICE_HID=y
CONFIG_USB_DEVICE_LOG_LEVEL_OFF=y
CONFIG_USB_DRIVER_LOG_LEVEL_OFF=y
CONFIG_USB_HID_POLL_INTERVAL_MS=1
CONFIG_USB_HID_BOOT_PROTOCOL=y
CONFIG_USB_HID_PROTOCOL_CODE=2
@Qbicz Qbicz added bug The issue is a bug, or the PR is fixing a bug area: USB Universal Serial Bus labels Mar 22, 2019
@Qbicz
Copy link
Collaborator Author

Qbicz commented Mar 22, 2019

Full sequence of USB state changes I get is the same as in #14627

@carlescufi
Copy link
Member

@pawelzadrozniak will you be able to send a fix for this?

@pawelzadrozniak
Copy link
Collaborator

@pawelzadrozniak will you be able to send a fix for this?

That's something we have discussed earlier today.
I'll investigate next week what is causing the wrong event order.

@carlescufi carlescufi added the platform: nRF Nordic nRFx label Mar 25, 2019
@rljordan-zz rljordan-zz added the priority: medium Medium impact/importance bug label Mar 26, 2019
@carlescufi carlescufi added priority: low Low impact/importance bug and removed priority: medium Medium impact/importance bug labels Mar 26, 2019
@Qbicz
Copy link
Collaborator Author

Qbicz commented Apr 17, 2019

@pawelzadrozniak This issue no longer occurs on 06ab394 (v1.14.0)

The sequence after plugging a cable is now

[04038208] <wrn> usb_state: USB connected
[04038310] <wrn> usb_state: USB suspend
[04042041] <wrn> usb_state: USB resume
[04042043] <wrn> usb_state: USB reset
[04045122] <wrn> usb_state: USB reset
[04050510] <wrn> usb_state: USB configured

There is no reset is suspended state.

@Qbicz Qbicz closed this as completed Apr 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: USB Universal Serial Bus bug The issue is a bug, or the PR is fixing a bug platform: nRF Nordic nRFx priority: low Low impact/importance bug
Projects
None yet
Development

No branches or pull requests

5 participants