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

Full RCC support for STM32F107 #3779

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

algesten
Copy link

@algesten algesten commented Jan 16, 2025

STM32F107 has a two more PLLs than F013, which means using f013.rs config options doesn't let us configure the entire RCC.

My use case is to use STM32F107 for ethernet with an external HSE.

This PR adds a special case for F107 with a fuller RCC config.

@algesten algesten marked this pull request as ready for review January 16, 2025 11:16
@Dirbaio
Copy link
Member

Dirbaio commented Jan 16, 2025

instead of adding a new f107.rs file, could you add support for the PLLs in f013.rs using cfg's like cfg(stm32f107)?

(We used to have code duplication like this in RCC a while ago and it proved to be an unmaintainable mess. Hard to keep them in sync with fixes and features. the file you've added is already out of sync, for example it does .unwrap() instead of unwrap!(..) and is missing the asserts for min/max frequencies)

@algesten
Copy link
Author

@Dirbaio sure. Is there some thinking of how these are bundled together? Like, why is f107 sorted under f013? Like is there some arch concept that certain groups of STM32 belongs together?

@Dirbaio
Copy link
Member

Dirbaio commented Jan 16, 2025

Yes, they're grouped by "what STM32 families are more similar". ST did some design for the F1, then F107, F3, F0 are incremental improvements on top of that but the "overall structure" stays very similar. OTOH they designed the PLLs very differently for F2, then F4, F7 are incremental improvements on top of that. Etc etc.

(f013 means "STM32F0 + STM32F1 + STM32F3", not "STM32F013")

@algesten
Copy link
Author

@Dirbaio thanks for explaining.

I have pushed an update where I try to merge the changes into f013.rs. Hopefully it's closer to what you want.

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