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

rcc: Correct apb1_freq and apb2_freq calculations. #137

Merged
merged 1 commit into from
Sep 1, 2024

Conversation

projectgus
Copy link
Contributor

@projectgus projectgus commented Sep 1, 2024

As per the Reference Manual Clock Tree (figure 17), these frequencies are divided from ahb_freq (HCLK) not sys_clk (SYSCLK).

Segment of Figure 17

Thanks for all your work maintaining this crate!

These frequencies are divided from AHB_FREQ not SYS_FREQ.
@usbalbin
Copy link
Contributor

usbalbin commented Sep 1, 2024

Wow, nice find! Thank you :)

@usbalbin usbalbin merged commit 39eb64a into stm32-rs:main Sep 1, 2024
23 checks passed
@usbalbin
Copy link
Contributor

usbalbin commented Sep 1, 2024

From what I can tell, the affected peripherals are:

  • All TIMx, LPTIMx, and HRTIM1 timers
  • All UARTs and I2Cx depending on clock source

@projectgus
Copy link
Contributor Author

@usbalbin Thanks for the quick review and merge!

FDCAN is affected as well (that's how I ran into it.) FDCAN can select its clock from multiple sources, but currently the HAL sets it to PCLK1.

@projectgus projectgus deleted the bugfix/apb_freq branch September 2, 2024 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants