8000 Basic system clock management for the STM32F4 family by Ioan-Cristian · Pull Request #3528 · tock/tock · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Basic system clock management for the STM32F4 family #3528

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 265 commits into from
Sep 22, 2023

Conversation

Ioan-Cristian
Copy link
Contributor

Pull Request Overview

This pull request adds support for basic clock management for the STM32F4 family:

  • high-speed internal (HSI) clock configuration
  • main phase-locked loop (PLL) clock configuration
  • Dynamic system clock source and frequency management with system integrity
    checks

Testing Strategy

This pull request was thoroughly tested through unit tests, integration tests
and logic analyzer. The tests were run on STM32F429ZI Nucleo-144 and STM32F446
Nucleo-64 boards.

TODO or Help Wanted

TODO:

  • Add support for high-speed external (HSE) clock
  • Add support for secondary PLL clock

Documentation Updated

  • Updated the relevant files in /docs.

Formatting

  • Ran make prepush.

@Ioan-Cristian
Copy link
Contributor Author

Hello!

As discussed last Friday, I reimplemented this pull request using type parameters and trait bounds. What do you think about it? @bradjc @ppannuto

Note that documentation is still missing. I'll fix that once the changes are approved.

Also, tests still rely on features. Probably I'll reimplement them using the same strategy as for the implementation itself.

Copy link
Contributor
@bradjc bradjc left a comment

Choose a reason for hiding this comment

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

Wow this is great.

One question, should the chip-specific implementations go in the specific chip crates? Is there a benefit to centralizing them?

@Ioan-Cristian
Copy link
Contributor Author

Wow this is great.

One question, should the chip-specific implementations go in the specific chip crates? Is there a benefit to centralizing them?

Hmm, good question. I assumed that you wanted them to be centralized just like as with features. There might be a small benefit from implementing them in the stm32f4xx crate: the respective modules can be made pub(crate), exposing to the other crates just ChipSpecs trait. This can help in hiding implementation details giving more freedom to change them in the future. However, both solutions seem fine to me. As a side note, I first implemented them in the chip-specific crates.

@bradjc
Copy link
Contributor
bradjc commented Sep 20, 2023

I think from the perspective of "if I'm updating/creating a specific variant, I shouldn't have to change the shared crate" it would make sense to me to put the chip-specific content in the specific crates.

@Ioan-Cristian
Copy link
Contributor Author

Moved all ChipSpecs implementations to chip-specific crates.

@bradjc bradjc added the last-call Final review period for a pull request. label Sep 20, 2023
@bradjc bradjc added this pull request to the merge queue Sep 22, 2023
Merged via the queue into tock:master with commit dd844b6 Sep 22, 2023
@Ioan-Cristian Ioan-Cristian mentioned this pull request Nov 9, 2023
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
last-call Final review period for a pull request. stm32 Change pertains to the stm32 family of MCUSs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0