Skip to content

USB stops working after Windows host computer sleep #8107

Open
@asafteirobert

Description

@asafteirobert

Board

LOLIN S2 mini

Device Description

LOLIN S2 mini with ESP32-S2FH4 chip

Hardware Configuration

LOLIN S2 mini with some buttons attached to IO pins, connected to a Windows PC through USB.

Version

v2.0.8

IDE Name

Arduino IDE

Operating System

Windows 10 21H2

Flash frequency

40MHz

PSRAM enabled

no

Upload speed

921600

Description

Reproduction steps:

  • Setup: LOLIN S2 mini connected to a Windows PC through USB
  • Load the examples\USB\Keyboard\KeyboardMessage\
  • Pressing the button types the message correctly.
  • Put Windows to sleep using Start->Power->Sleep
  • Wake up Windows
  • Pressing the button no longer types the message.

It appears the whole USB ends up in a broken state as uploading to the port(which still shows as connected) is no longer possible. Trying to access the debug serial port gives Error 31 "A device attached to the system is not functioning".
Unplugging the USB cable USBLogView shows the USB Composite device, USB Input Device and USB Serial Device being unplugged.
Reconnecting the USB cable (and thus also resetting the device) makes the sketch and upload port work again.

What I tried:

  • USB CDC On Boot Enabled or Disabled
  • Calling USB.usbAttributes(TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP); before USB.begin();
  • Disabling "Allow the computer to turn off this device to save power" on the HID device.

I can confirm that USB power is not turned off.

Sketch

The official example USB\Keyboard\KeyboardMessage

Debug Message

No output

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions