# USB: suspend/resume failed, device not responding to resume signaling

- **ID:** `embedded/usb-suspend-resume-failed`
- **Domain:** embedded
- **Category:** protocol_error
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

Host initiated resume signaling but device USB peripheral failed to exit suspend state due to misconfigured clock gating or missing interrupt handler.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| STM32Cube_FW_H7 v1.11.0 | active | — | — |
| FreeRTOS v10.4.6 | active | — | — |
| USB_Device_Library v2.5.0 | active | — | — |

## Workarounds

1. **Ensure USB clock is enabled before entering suspend: modify HAL_PCD_SuspendCallback() to call __HAL_RCC_USB_OTG_FS_CLK_ENABLE() and set USB_OTG_FS->GINTMSK |= USB_OTG_GINTMSK_WUIM.** (92% success)
   ```
   Ensure USB clock is enabled before entering suspend: modify HAL_PCD_SuspendCallback() to call __HAL_RCC_USB_OTG_FS_CLK_ENABLE() and set USB_OTG_FS->GINTMSK |= USB_OTG_GINTMSK_WUIM.
   ```
2. **Add explicit wakeup pin handling: configure a GPIO EXTI line connected to USB_DP as falling edge trigger, and in the ISR call HAL_PCD_Resume() to force peripheral wakeup.** (88% success)
   ```
   Add explicit wakeup pin handling: configure a GPIO EXTI line connected to USB_DP as falling edge trigger, and in the ISR call HAL_PCD_Resume() to force peripheral wakeup.
   ```

## Dead Ends

- **Increase USB resume timeout in host driver** — Timeout increase does not address the device-side failure to re-enable clocks; resume signaling is already sent correctly by host. (85% fail)
- **Reinitialize USB peripheral on resume callback** — Full reinitialization resets endpoint state and can cause descriptor mismatch, leading to enumeration failure after resume. (70% fail)
