Skip to content
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

Merged

Conversation

jandriea
Copy link
Contributor

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.

@github-actions
Copy link

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. 😊

Copy link
Contributor

@gautierg-st gautierg-st left a 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.

@jandriea jandriea force-pushed the jandriea/stm32u5-pll-fracn branch 2 times, most recently from 3b88eb9 to f4cc493 Compare September 18, 2023 07:59
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>
gautierg-st
gautierg-st previously approved these changes Sep 22, 2023
Copy link
Member

@erwango erwango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise LGTM

@@ -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:
Copy link
Member

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 ?

Copy link
Contributor Author

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?

Copy link
Member

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>
@carlescufi carlescufi merged commit 3eea17c into zephyrproject-rtos:main Sep 26, 2023
18 checks passed
@github-actions
Copy link

Hi @jandriea!
Congratulations on getting your very first Zephyr pull request merged 🎉🥳. This is a fantastic achievement, and we're thrilled to have you as part of our community!

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! 🪁

@jandriea jandriea deleted the jandriea/stm32u5-pll-fracn branch September 26, 2023 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Clock Control area: Devicetree Binding PR modifies or adds a Device Tree binding platform: STM32 ST Micro STM32
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants