-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Description
Describe the bug
After merging the changes from PR #88082 — which addresses STM32U5x clock disable behavior in sleep mode — a regression has been observed affecting USB HS device initialization on STM32U5x platforms.
This is the original commit 7a0c31c975aa1fea462ccc3edabd9b960a0add52 introduced a fix to disable the STM32U5 OTG HS and USBPHY clocks during sleep mode to address clock management.
Observed Issues
- USB CDC ECM reports failure to add the iMACAddress string descriptor.
- Network interface initialization times out.
- USB CDC ACM samples stall waiting for control signals such as DTR.
Root Cause:
Using the bitwise OR (|) is the correct approach to combine peripheral flags for the clock disable function. However, this change caused the simultaneous disabling of both OTG HS and USBPHY clocks during sleep, which leads to USB peripheral clocks being turned off unexpectedly.
Regression
- This is a regression.
Steps to reproduce
Steps to Reproduce
- Build Zephyr with PR drivers: usb: stm32: fix stm32u5x clock disable in sleep mode #88082 applied.
- Run USB CDC ECM or ACM sample applications on nucleo_u5a5zj_q / stm32u5g9j_dk2
- Observe USB initialization failures and network timeouts in logs.
$ west build -p -b nucleo_u5a5zj_q/stm32u5a5xx \
samples/net/zperf/ \
--extra-conf overlay-usbd_next.conf \
--extra-dtc-overlay usbd_next_ecm.overlay
Relevant log output
*** Booting Zephyr OS build v4.2.0-rc1-325-g2a2864e78260 ***
[00:00:00.003,000] <wrn> udc_stm32: speed: 16000000
[00:00:00.013,000] <err> cdc_ecm: Failed to add iMACAddress string descriptor
[00:00:00.013,000] <inf> net_config: Initializing network
[00:00:00.013,000] <inf> net_config: Waiting interface 1 (0x200011c8) to be up...
[00:00:30.014,000] <inf> net_config: IPv4 address: 192.0.2.1
[00:00:30.014,000] <err> net_config: Timeout while waiting network interface
[00:00:30.014,000] <err> net_config: Network initialization failed (-115)
Impact
The impact of this issue is significant for STM32U5 series SoCs with USB High-Speed (HS) peripherals, specifically affecting boards like nucleo_u5a5zj_q and stm32u5g9j_dk2. The key consequences include:
- USB Device Initialization Failures: The USB peripheral fails to properly initialize due to clocks (OTG HS and USBPHY) being disabled during sleep mode, causing enumeration issues.
- Network Connectivity Problems: For USB CDC ECM devices, failure to add the iMACAddress string descriptor leads to network interface initialization timeouts and overall network stack failures.
- USB Communication Stalls: USB CDC ACM samples may stall indefinitely waiting for control signals such as DTR, preventing normal serial communication.
- Potential Regression: This issue represents a regression introduced by recent clock management changes, impacting USB functionality on affected STM32U5 platforms.
Overall, this issue disrupts USB device operation, leading to degraded or non-functional USB communication and network features on impacted hardware.
Environment
-OS: Linux
-Zephyr: 31ef45e
Additional Context
No response