stm32-usbd icon indicating copy to clipboard operation
stm32-usbd copied to clipboard

Device Triggered Wakeup of the Host

Open camrbuss opened this issue 4 years ago • 1 comments

I am implementing the Keyberon crate that uses stm32-usbd as a dependency and am struggling to get my firmware to wake-up my computer from suspend. Looking at other libraries, I believe this is implemented with register level access in the MCU.

This could be a trait from usb_device, but I don't think it is implemented in all micro controller USB devices. The Zephyr "Trait" like implementation is here.

Zephyr STM32 HAL Implementation ChibiOS STM32 HAL Implementation

I do not believe this is satisfied with the current suspend and resume method as those manipulate the fsusp bit of the cntr register, but I believe a device sent wakeup to the host would be manipulating the resume bit of the cntr register.

Does this seem like something that could be implemented? Should it be stm32 specific or be an implemented trait?

camrbuss avatar Feb 23 '21 01:02 camrbuss

I'm not sure what is the right way of implementing this, but as the first approximation this could be implemented in this driver as a regular method (if the hardware supports this at all).

Disasm avatar Feb 26 '21 17:02 Disasm