-
Notifications
You must be signed in to change notification settings - Fork 769
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
Add OTG_HS support for STM32H7R/S #3337
Conversation
26ea410
to
fd40adf
Compare
The CI failure is apparently caused by a missing definition of the |
really appreciate your continued work on this! i'm pretty out of my depth here, would not have figured this out myself. |
wow that's annoying. I've tried updating the xmls from the latest Cube but OTG_HS is still missing. I'd just workaround it for now: use I'd wait for ST to fix it, perhaps report it. Where do you report cubemx bugs? 🤔 |
fd40adf
to
85b7c89
Compare
That's a great idea :) I've added a check in the latest commit and also tried reporting the issue to ST here on GitHub. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks! 🚀
This adds support for the embedded high-speed USB peripheral on the STM32H7R/S series. I've confirmed the
usb_serial
example works on a Nucleo-H7S3 board using the internal HS PHY.These changes build on prior work by @RileyLeff in #3289.
There are some remaining issues:
USBPHYCSEL
clock mux and generates the necessary 48 and 60MHz clocks for the OTG blocks internally (see the clock diagram below). I've simply addedUSBPHYC
as a fallback clock for theOTG_HS
peripheral instm32-data
to get the clock generator to generate a mux definition and then explicitly pick the corresponding reference clock in the H-series RCC driver, but this approach results in the PLL input frequency being registered as the actual OTG kernel clock.ahb_freq
inotg.rs
doesn't represent the AHB bus frequency, but just this USBPHYC PLL input frequency. I've just skipped the check of a sufficient AHB clock on the H7R/S, as I didn't find a straight-forward solution and the USBPHYC PLL input might very well be below 30MHz, but this is likely not ideal.