eclipse-threadx / usbx

Eclipse ThreadX - USBX is a high-performance USB host, device, and on-the-go (OTG) embedded stack, that is fully integrated with Eclipse ThreadX RTOS
https://github.com/eclipse-threadx/rtos-docs/blob/main/rtos-docs/usbx/index.md
MIT License
148 stars 88 forks source link

Suspend / resume support #88

Open BluesharkPD opened 1 year ago

BluesharkPD commented 1 year ago

Hi i have a question. How to support suspend /resume and remote wakeup in RTOS mode. ?

xiaocq2001 commented 1 year ago

When device suspended it should setup wakeup event, close or suspend most of peripherals and clocks, then put device in power saving mode, the code is stopped until wakeup event occurs.

So in RTOS mode when suspended RTOS is not running since all code is stopped. When resumed the code just continues and RTOS is resumed.

BluesharkPD commented 1 year ago

Hi, Is there any advice to suspend and resume threadx API when callbacks invoked

xiaocq2001 commented 1 year ago

You can refer to https://github.com/azure-rtos/threadx/tree/master/utility/low_power.

robert-kau commented 3 days ago

Hi I'm using usbx in CDC mode. I'm getting the Suspend interrupt when the cable is unplugged, but the resume interrupt doesn't occur when the cable is plugged in. Has anyone experienced this or have any guidance?