Skip to main content
Visitor II
February 7, 2024
Question

USB Suspend/resume in STM32F7

  • February 7, 2024
  • 1 reply
  • 987 views

Hi,
I want to put the USB bus into SUSPEND/RESUME state, currently I'm using gState in USBH_HandleTypeDef to manually put the device into HOST_SUSPENDED state and similarly to move to the Idle state I'm manually assigning gState to be HOST_IDLE.

With this approach I'm able to move to suspend state, I have verified the same on oscilloscope, there is no bus activity in SUSPEND state
Issue with this approch is if we move from suspend to ideal state and back to suspend state we can't go to ideal state and we are stuck in the suspend state, I have called MX_USB_HOST_INIT() before making USB state=idle but its stuck in some state or its not getting enumerated again

Can anyone suggest any other way or why this is happening?

 

Thanks

    This topic has been closed for replies.

    1 reply

    Technical Moderator
    February 7, 2024

    Hello @tachyon701 

     

    gState is only meant to give current state in the global host state machine. It cannot change bus activity. I suggest you wake up through EXTI line interrupt through OTG_FS_WKUP while in suspended state.