Skip to content
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

ESP32-S3 USB peripheral freezes after light sleep at 40MHz (IDFGH-14711) #15451

Open
3 tasks done
dbeinder opened this issue Feb 23, 2025 · 0 comments
Open
3 tasks done
Labels
Status: Selected for Development Issue is selected for development Type: Bug bugs in IDF

Comments

@dbeinder
Copy link

dbeinder commented Feb 23, 2025

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.

v5.4 release

Espressif SoC revision.

ESP32-S3 (QFN56) revision 0.2

Operating System used.

Windows

How did you build your project?

VS Code IDE

If you are using Windows, please specify command line type.

None

Development Kit.

YD-ESP32-23 (ESP32-S3-WROOM-1)

Power Supply used.

USB

What is the expected behavior?

The USB peripheral working normally after returning from light sleep. (I know clock to USB is gated during sleep)

What is the actual behavior?

At 40MHz CPU frequency, USB-OTG works fine. However, after entering light-sleep and resuming, the USB peripheral is frozen. It doesn't matter if the peripheral was initialized or not. If uninitialized, the driver_install function will stall - if it was already initialized, the peripheral just stops handling any USB events.

Briefly switching to 80MHz and back to 40MHz after wakeup "fixes" the issue.

Steps to reproduce.

Here is a reproducuction using the tusb_hid sample: https://github.com/dbeinder/esp32s3-tusb-hid
Changes to the sample: dbeinder/esp32s3-tusb-hid@4a43223

tinyusb_driver_install() will stall in reset_core() in dwc2_common.c - see watchdog backtrace.

Uncommenting the two lines to switch to 80MHz and back to 40MHz makes the initialization work again.

Debug Logs.

I (302) example: Core Clock: 40 MHz
I (302) example: Entering Light Sleep...
I (312) example: Resumed (0) ESP_OK
I (312) example: USB initialization
W (322) tusb_desc: No Device descriptor provided, using default.
I (322) tusb_desc:
┌─────────────────────────────────┐
│  USB Device Descriptor Summary  │
├───────────────────┬─────────────┤
│bDeviceClass       │ 0           │
├───────────────────┼─────────────┤
│bDeviceSubClass    │ 0           │
├───────────────────┼─────────────┤
│bDeviceProtocol    │ 0           │
├───────────────────┼─────────────┤
│bMaxPacketSize0    │ 64          │
├───────────────────┼─────────────┤
│idVendor           │ 0x303a      │
├───────────────────┼─────────────┤
│idProduct          │ 0x4004      │
├───────────────────┼─────────────┤
│bcdDevice          │ 0x100       │
├───────────────────┼─────────────┤
│iManufacturer      │ 0x1         │
├───────────────────┼─────────────┤
│iProduct           │ 0x2         │
├───────────────────┼─────────────┤
│iSerialNumber      │ 0x3         │
├───────────────────┼─────────────┤
│bNumConfigurations │ 0x1         │
└───────────────────┴─────────────┘

E (10282) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:
E (10282) task_wdt:  - IDLE0 (CPU 0)
E (10282) task_wdt: Tasks currently running:
E (10282) task_wdt: CPU 0: main
E (10282) task_wdt: CPU 1: IDLE1
E (10282) task_wdt: Print CPU 0 (current core) backtrace


Backtrace: 0x42010E36:0x3FC94C90 0x4201124C:0x3FC94CB0 0x40377C1E:0x3FC94CE0 0x4200D73F:0x3FC99A90 0x4200D789:0x3FC99AB0 0x4200D8BF:0x3FC99AD0 0x4200D2E6:0x3FC99AF0 0x4200B8ED:0x3FC99B10 0x4200C426:0x3FC99B30 0x4200A898:0x3FC99B60 0x4200A748:0x3FC99BF0 0x4201DCB3:0x3FC99C70 0x4037BD29:0x3FC99CA0
--- 0x42010e36: task_wdt_timeout_handling at C:/Users/David/esp/v5.4/esp-idf/components/esp_system/task_wdt/task_wdt.c:434
0x4201124c: task_wdt_isr at C:/Users/David/esp/v5.4/esp-idf/components/esp_system/task_wdt/task_wdt.c:507
0x40377c1e: _xt_lowint1 at C:/Users/David/esp/v5.4/esp-idf/components/xtensa/xtensa_vectors.S:1240
0x4200d73f: reset_core at C:/proj/esp_debug/tusb_hid/managed_components/espressif__tinyusb/src/portable/synopsys/dwc2/dwc2_common.c:52 (discriminator 1)
0x4200d789: phy_fs_init at C:/proj/esp_debug/tusb_hid/managed_components/espressif__tinyusb/src/portable/synopsys/dwc2/dwc2_common.c:76
0x4200d8bf: dwc2_core_init at C:/proj/esp_debug/tusb_hid/managed_components/espressif__tinyusb/src/portable/synopsys/dwc2/dwc2_common.c:209
0x4200d2e6: dcd_init at C:/proj/esp_debug/tusb_hid/managed_components/espressif__tinyusb/src/portable/synopsys/dwc2/dcd_dwc2.c:403
0x4200b8ed: tud_rhport_init at C:/proj/esp_debug/tusb_hid/managed_components/espressif__tinyusb/src/device/usbd.c:504
0x4200c426: tusb_rhport_init at C:/proj/esp_debug/tusb_hid/managed_components/espressif__tinyusb/src/tusb.c:71
0x4200a898: tinyusb_driver_install at C:/proj/esp_debug/tusb_hid/managed_components/espressif__esp_tinyusb/tinyusb.c:72
0x4200a748: app_main at C:/proj/esp_debug/tusb_hid/main/tusb_hid_example_main.c:198
0x4201dcb3: main_task at C:/Users/David/esp/v5.4/esp-idf/components/freertos/app_startup.c:208
0x4037bd29: vPortTaskWrapper at C:/Users/David/esp/v5.4/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:139

More Information.

No response

@dbeinder dbeinder added the Type: Bug bugs in IDF label Feb 23, 2025
@github-actions github-actions bot changed the title ESP32-S3 USB peripheral freezes after light sleep at 40MHz ESP32-S3 USB peripheral freezes after light sleep at 40MHz (IDFGH-14711) Feb 23, 2025
@espressif-bot espressif-bot added Status: Opened Issue is new Status: Selected for Development Issue is selected for development and removed Status: Opened Issue is new labels Feb 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Selected for Development Issue is selected for development Type: Bug bugs in IDF
Projects
None yet
Development

No branches or pull requests

2 participants