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

stm32f1: add a struct based rcc clock setup like other families #1172

Closed
karlp opened this issue Feb 3, 2020 · 2 comments
Closed

stm32f1: add a struct based rcc clock setup like other families #1172

karlp opened this issue Feb 3, 2020 · 2 comments

Comments

@karlp
Copy link
Member

karlp commented Feb 3, 2020

Leave the existing static functions, but mark them all deprecated.
Add a new struct based method similar to other stm32s. Goal is for API unification, or at least consistency. Fixes the last major issue in #266 and makes requests like #1171 easier

@gollux
Copy link

gollux commented Feb 24, 2020

Also, the current stm32f1 clock switching routines assume that they are run directly after reset. For example, if you call rcc_clock_setup_in_hsi_out_48mhz() and then rcc_clock_setup_in_hse_8mhz_out_72mhz(), clocks are misconfigured for two different reasons:

  • The functions configure PLL without making sure that it is turned off first. (Documentation says that this must not be done.)
  • Some clock setup functions configure the USB prescaler, but the others assume that the default state is correct.

It would be great if the clock unification fixed these problems. (It seems that the unified method handles that, at least when I looked at stm32f4.)

@karlp
Copy link
Member Author

karlp commented Feb 26, 2020

it's a common problem yes, scaling up and down isn't always handled correctly, it was partly addressed for one family here: 095ed85 but it's definitely not robustly implemented for every possible use case.

karlp added a commit that referenced this issue Nov 27, 2020
@karlp karlp closed this as completed in 5f05124 Dec 1, 2020
BOJIT pushed a commit to BOJIT/PlatformIO-libopencm3 that referenced this issue Jan 30, 2021
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

No branches or pull requests

2 participants