Skip to content

stm32g0: mco: enable usage of MCO for STM32G0 #90923

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 3 commits into from
Jun 6, 2025

Conversation

schuam
Copy link
Contributor

@schuam schuam commented Jun 1, 2025

To be able to use the microcontroller clock output of the STM32G0 microcontrollers some macros and device tree entries were missing. This pull requests add them. Additionally a sample overlay for the NUCLEO-G0B1RE board was added to the mco sample.

@@ -35,6 +35,9 @@
#define STM32_SRC_PLL_Q (STM32_SRC_PLL_P + 1)
#define STM32_SRC_PLL_R (STM32_SRC_PLL_Q + 1)

/** @brief RCC_CFGR register offset */
#define CFGR_REG 0x08
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nitpicking: could you indent the macro value with 2 tabs, as done for the other macro definitions above and below?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@etienne-lms Thank you for your review.

Before I opened the pull request, I had the macro (and some others for that matter) formatted as you suggested (two tabs). When I ran ./scripts/ci/check_compliance.py -c upstream/main.. as suggested by Running CI Tests Locally, I got errors. For example:

You may want to run clang-format on this change:
-#define CFGR_REG		0x08
+#define CFGR_REG 0x08

So my question would be: Ignore the errors given by check_compliance.py and use tabs? Or comply to the checker?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Good question! I don't think I have enough background in Zephyr to ask you to go against some of its compliance sanity tools. I'll cross-check. In the mean time, I guess you can feel free to dismiss my old developer habits driven comments.

Copy link
Contributor Author

@schuam schuam Jun 3, 2025

Choose a reason for hiding this comment

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

Well, I appreciate your sense for consistency, I just didn't know what to do here.
I did remove the second empty line you mentioned in your other comment.

@fabiobaltieri
Copy link
Member

Hey, this needs a rebase and force push to pick up the CI error workaround.

schuam added 3 commits June 4, 2025 21:56
Adds macros to be able to use the microcontroller clock output (MCO) on the
STM32G0 microcontroller.

Signed-off-by: Andreas Schuster <[email protected]>
The newly added mcos node contains two childreen `mco1` and `mco2` that can
be used to output different clocks on the MCO pins of the stm32g0
microcontrollers.

Signed-off-by: Andreas Schuster <[email protected]>
Add overlay file to enable the MCO1&2 output clock on the nucleo_g0b1re.

Signed-off-by: Andreas Schuster <[email protected]>
Copy link

sonarqubecloud bot commented Jun 4, 2025

@schuam
Copy link
Contributor Author

schuam commented Jun 6, 2025

Dear @ALL,

as this is my first pull request that has been reviewed and passed all checks, I don't exactly know the further process. Do I have to do anything, or does someone with write access to the mainline just eventually merges the request?

@etienne-lms
Copy link
Collaborator

You don't have anything more to do, just wait this gets merged.

@fabiobaltieri fabiobaltieri assigned erwango and unassigned nordic-krch Jun 6, 2025
@kartben kartben merged commit 3060ee2 into zephyrproject-rtos:main Jun 6, 2025
26 checks passed
Copy link

github-actions bot commented Jun 6, 2025

Hi @schuam!
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! 🪁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants