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

stm32f0: Improve RCC driver implementation #1439

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

bene42
Copy link

@bene42 bene42 commented Sep 18, 2022

Hi,
the stm32f0 rcc driver implemantation lacks support for 16MHz external clocks.
Patch 1 adds support for it,

Patch 2 is a consolitating and preperatory step towards struct based clock helpers,
while patch 3 adds them.

The series is tested on a custom STM32F030F4P6 based board (16MHz crystal).

Regards
Benedikt Spranger

lib/stm32/f0/rcc.c Outdated Show resolved Hide resolved
@karlp
Copy link
Member

karlp commented Sep 19, 2022

Commits 2 and 3 look good, but with commits 2 and 3, we simply don't need or ever want, commit 1.

Target coding style issues. No functional change.

Signed-off-by: Benedikt Spranger <b.spranger@linutronix.de>
@nvincent-vossloh
Copy link

nvincent-vossloh commented Jul 17, 2023

Hi, I am interested in this PR, how can I help get it merged ?

FYI, i had to fix a few things which are available in my fork: https://github.com/SiemaApplications/libopencm3/commits/f0_rcc

nvincent-vossloh and others added 5 commits July 20, 2023 14:16
Update the macro name used to avoid referencing a particular peripheral.
All STM32 achitectures exept STMF0 define RCC_CFGR_PLLMUL_X without shift.
The nessesary shift is done in rcc_set_pll_multiplication_factor().
Handle RCC_CFGR_PLLMUL_X as all other STM32 achitectures and consolidate
rcc_set_pll_multiplication_factor().

Signed-off-by: Benedikt Spranger <b.spranger@linutronix.de>
As on every other family.

Signed-off-by: Benedikt Spranger <b.spranger@linutronix.de>
When using HSI on stm32f0, the flash waitstates must be configured to 1.
libopencm3 lacks support for 16MHz external clocks.
Add support for these clocks.

Signed-off-by: Benedikt Spranger <b.spranger@linutronix.de>
@bene42
Copy link
Author

bene42 commented Jul 20, 2023

Hi, I am interested in this PR, how can I help get it merged ?

I have no clue, how this is handled.

FYI, i had to fix a few things which are available in my fork: https://github.com/SiemaApplications/libopencm3/commits/f0_rcc

Thanks for the fix.

Regards
Benedikt Spranger

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.

None yet

3 participants