hathach / tinyusb

An open source cross-platform USB stack for embedded system
https://www.tinyusb.org
MIT License
4.66k stars 996 forks source link

ESP32-S2 disconnection detection issue #564

Open hathach opened 3 years ago

hathach commented 3 years ago

Set up

Describe the bug ESP32-S2 currently doesn't detect disconnection event. Instead Suspend is detected as the side effect (since bus is idel > 3 ms). Worse, it detect suspend infinitely !!

To reproduce

  1. Run example with esp32s2 saola board with CFG_TUSB_DEBUG = 2
  2. Disconnect the usb connection while keeping the cp210x connection
  3. See error

Log Log from idf.py monitor

USBD Xfer Complete on EP 80 with 64 bytes
  Queue EP 80 with 16 bytes
USBD Xfer Complete on EP 80 with 16 bytes
  HID control complete
  Queue EP 00 with zlp Status
USBD Xfer Complete on EP 00 with 0 bytes
USBD Suspend 
USBD Suspend 
USBD Suspend 
USBD Suspend 
USBD Suspend 
USBD Suspend 
USBD Suspend 
USBD Suspend 
USBD Suspend 
USBD Suspend 
USBD Suspend 
USBD Suspend 

@dhalbert suspended and disconnected are not fully supported on all ports, may need a bit of time for overall testing later on :)

tore-espressif commented 1 year ago

Hi @hathach we updated our documentation about disconnection events, PTAL: https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/api-reference/peripherals/usb_device.html#self-powered-device

hathach commented 1 year ago

thank you @tore-espressif for the update, I will check this out next time I need to work on this issue.

gecko242 commented 9 months ago

Hey @hathach! Any news on this issue?

Thanks :)

hathach commented 9 months ago

no, I still haven't got time for this yet. Though It is on my TODO list when I get back to work on dwc2 driver