drivers: usb: udc: stm32: device never enumerates with CONFIG_PM=y
Author: oliverhuahuaCreated Sep 27, 2026Updated Sep 27, 2026
Labelspriority: lowplatform: STM32
Describe the bug
udc_stm32 takes no PM policy lock, so with CONFIG_PM=y an STM32F4 enters Stop while the USB controller is enabled. Stop turns the PLLs off (RM0090 Rev 22 section 5.3.5), which stops the 48 MHz USB clock, and the device never enumerates.
Measured on an STM32F429I-DISC1 with samples/subsys/usb/cdc_acm. The host watched for the device for 60 s and echoed one line per second:
| Runs | Enumerated | Echo | |
|---|---|---|---|
| PM off | 1 | yes | 58/58 |
CONFIG_PM=y |
2 | no | - |
CONFIG_PM=y, Stop locked while the controller is enabled |
2 | yes | 58/58, 57/57 |
Regression
- This is a regression.
Steps to reproduce
west build -b stm32f429i_disc1 samples/subsys/usb/cdc_acm -- -DCONFIG_PM=ywest flash, then connect CN6 to a host.- The device does not enumerate. Without
-DCONFIG_PM=yit does.
Relevant log output
*** Booting Zephyr OS build v4.4.0-17057-g6d2e535ecbc8 ***
[00:00:00.010,000] <inf> cdc_acm_echo: USB device support enabled
[00:00:00.010,000] <inf> cdc_acm_echo: Wait for DTR
[00:00:01.016,000] <inf> cdc_acm_echo: USBD message: Device suspendedImpact
Functional Limitation – Some features not working as expected, but system usable.
Environment
- OS: Ubuntu 24.04 (VM on macOS 26.6)
- Toolchain: Zephyr SDK 1.0.1
- Commit: 6d2e535ecbc
- Board: STM32F429I-DISC1 (MB1075 rev E)
Additional Context
Only F4 tested. #120456 locks PM_STATE_SUSPEND_TO_IDLE, and PM_STATE_SUSPEND_TO_RAM with CONFIG_PM_S2RAM, while the controller is enabled, as the other STM32 drivers do while they are busy.
Source: zephyrproject-rtos/zephyr