Skip to content

STM32N6:Enable USB and UDC OTGPHY clock #90362

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 28, 2025

Conversation

marwaiehm-st
Copy link
Collaborator

@marwaiehm-st marwaiehm-st commented May 22, 2025

  • Reset specific configuration bits in USB1_HS_PHYC->USBPHYC_CR before setting new values.
  • Set the Frequency Selection (FSEL) bits to operate the USB PHY Control Register at 24 MHz for proper communication.
  • Enable the OTGPHY1 peripheral clock using LL_AHB5_GRP1_EnableClock.

These modifications resolve the USB/UDC initialization error encountered during normal boot mode, allowing the application to successfully enable USB/UDC functionality on the stm32n6570_dk and nucleo_n657x0_q boards.

** Booting Zephyr OS build v4.1.0-2103-g5c1bbb7e7715 ***
[00:00:35.236,000] <err> usb_dc_stm32: PCD_Init failed, 1
[00:00:35.236,000] <err> cdc_acm_echo: Failed to enable USB

Fix the issue.

@marwaiehm-st marwaiehm-st force-pushed the fix_stm32n6_usb_udc branch from a4e242f to 89a4c2c Compare May 22, 2025 21:49
@marwaiehm-st marwaiehm-st changed the title drivers: usb: Enable USB and UDC OTGPHY clock STM32N6:Enable USB and UDC OTGPHY clock May 23, 2025
@marwaiehm-st marwaiehm-st marked this pull request as ready for review May 23, 2025 09:53
@github-actions github-actions bot added platform: STM32 ST Micro STM32 area: USB Universal Serial Bus labels May 23, 2025
tmon-nordic
tmon-nordic previously approved these changes May 23, 2025
tmon-nordic
tmon-nordic previously approved these changes May 26, 2025
erwango
erwango previously approved these changes May 26, 2025
- Reset specific configuration bits in
  USB1_HS_PHYC->USBPHYC_CR before setting new values.
- Set the Frequency Selection (FSEL) bits to operate
  the USB PHY Control Register at 24 MHz for proper communication.
- Enable the OTGPHY1 peripheral clock using LL_AHB5_GRP1_EnableClock.

Signed-off-by: IBEN EL HADJ MESSAOUD Marwa <[email protected]>
@marwaiehm-st marwaiehm-st dismissed stale reviews from erwango and tmon-nordic via d094bf2 May 27, 2025 13:31
@marwaiehm-st marwaiehm-st force-pushed the fix_stm32n6_usb_udc branch from 78efb25 to d094bf2 Compare May 27, 2025 13:31
@marwaiehm-st marwaiehm-st requested a review from erwango May 27, 2025 13:33
Copy link

@kartben kartben merged commit 9b14f9b into zephyrproject-rtos:main May 28, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: USB Universal Serial Bus platform: STM32 ST Micro STM32
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants