-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
drivers: clock_control: Added PLL fractional mode for STM32U5 #62739
drivers: clock_control: Added PLL fractional mode for STM32U5 #62739
Conversation
Hello @jandriea, and thank you very much for your first pull request to the Zephyr project! A project maintainer just triggered our CI pipeline to run it against your PR and ensure it's compliant and doesn't cause any issues. You might want to take this opportunity to review the project's Contributor Expectations and make any updates to your pull request if necessary. 😊 |
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.
Please split in several commits, at least the test part.
Otherwise looks good to me.
3b88eb9
to
f4cc493
Compare
Based on RM0456, each PLL in the STM32U5 has the capability to work either in integer or fractional mode. In this update, the fractional mode can be enabled by setting the fracn value in the device tree. Signed-off-by: Jatty Andriean <jandriea@outlook.com>
f4cc493
to
e01d904
Compare
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.
Otherwise LGTM
...rivers/clock_control/stm32_clock_configuration/stm32u5_core/boards/pll_hse_fracn_160.overlay
Outdated
Show resolved
Hide resolved
...rivers/clock_control/stm32_clock_configuration/stm32u5_core/boards/pll_hse_fracn_160.overlay
Show resolved
Hide resolved
...rivers/clock_control/stm32_clock_configuration/stm32u5_core/boards/pll_hse_fracn_160.overlay
Show resolved
Hide resolved
@@ -24,3 +24,7 @@ tests: | |||
extra_args: DTC_OVERLAY_FILE="boards/clear_clocks.overlay;boards/pll_hse_160.overlay" | |||
# Build only as HSE not implemened on available boards | |||
build_only: true | |||
drivers.stm32_clock_configuration.u5.sysclksrc_pll_hse_fracn_160: |
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.
What about using HSI as PLL input which would allow a "runable" test ?
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.
I can add a test case using HSI with a fraction value of 0. Just to make sure that it still generates the correct PLL output. I will think about any other cases later. But for now, I can only suggest using HSI with a fraction value of 0. Perhaps, you have some test cases in mind?
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.
Let's go with 0
Added a test case that generates a 160 MHz system clock using a 16777216 Hz HSE clock and also using a 16 MHz HSI Signed-off-by: Jatty Andriean <jandriea@outlook.com>
e01d904
to
b0998b1
Compare
Hi @jandriea! To celebrate this milestone and showcase your contribution, we'd love to award you the Zephyr Technical Contributor badge. If you're interested, please claim your badge by filling out this form: Claim Your Zephyr Badge. Thank you for your valuable input, and we look forward to seeing more of your contributions in the future! 🪁 |
Based on RM0456, each PLL in the STM32U5 has the capability to work either in integer or fractional mode. In this update, the fractional mode can be enabled by setting the
fracn
value in the device tree. This update also includes a test case that generates a 160 MHz system clock using a 16777216 Hz HSE clock.