USB remote wakeup support

Hey,

After some messing with Interface Association Descriptors, I now have a working composite device that supports both HID and audio streaming. Now, I would like the HID to be able to wake the computer via remote wakeup. The HID device is recognized as having this capability by Windows, but what is the right way to actually initiate the remote wakeup sequence? Is there any support for this in the STM32 internal USB state machine or USB standard library?

Resume(RESUME_EXTERNAL) does not seem to work, and I couldn't find any reference to the proper wakeup sequence (D+ high, D- low for at least 12 ms). Is this implemented at all in the standard library or should I write my own routine for this?

Much obliged.

Parents
  • For STM32F103 / STM32L, this bit enables RESUME signaling from the device - ie. remote wakeup.

    USB control register (USB_CNTR)
    Bit 4 RESUME: Resume request
    The microcontroller can set this bit to send a Resume signal to the host. It must be activated, according to USB specifications, for no less than 1mS and no more than 15mS after which the Host PC is ready to drive the resume sequence up to its end.

    On the configuration descriptor, set D5 bit (Remote Wakeup) to 1 at bmAttributes field.

        /* Configuration 1 */
        0x09,                                 /* bLength */
        USB_CONFIGURATION_DESCRIPTOR_TYPE,    /* bDescriptorType */
        0x6D,                                 /* wTotalLength  110 bytes*/
        0x00,
        0x02,                                 /* bNumInterfaces */
        0x01,                                 /* bConfigurationValue */
        0x00,                                 /* iConfiguration */
        0xC0,                                 /* bmAttributes Self Powred*/ // <--- 0xE0
        0x32,                                 /* bMaxPower = 100 mA*/
    

    Tsuneo

Reply
  • For STM32F103 / STM32L, this bit enables RESUME signaling from the device - ie. remote wakeup.

    USB control register (USB_CNTR)
    Bit 4 RESUME: Resume request
    The microcontroller can set this bit to send a Resume signal to the host. It must be activated, according to USB specifications, for no less than 1mS and no more than 15mS after which the Host PC is ready to drive the resume sequence up to its end.

    On the configuration descriptor, set D5 bit (Remote Wakeup) to 1 at bmAttributes field.

        /* Configuration 1 */
        0x09,                                 /* bLength */
        USB_CONFIGURATION_DESCRIPTOR_TYPE,    /* bDescriptorType */
        0x6D,                                 /* wTotalLength  110 bytes*/
        0x00,
        0x02,                                 /* bNumInterfaces */
        0x01,                                 /* bConfigurationValue */
        0x00,                                 /* iConfiguration */
        0xC0,                                 /* bmAttributes Self Powred*/ // <--- 0xE0
        0x32,                                 /* bMaxPower = 100 mA*/
    

    Tsuneo

Children
More questions in this forum