-
Notifications
You must be signed in to change notification settings - Fork 990
stm32: Move osc and clk to machine pkg #1751
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
Conversation
5618222
to
fd7000b
Compare
fd7000b
to
b7cb928
Compare
It failed on |
@ofauchon - fyi, since I know you're working on another STM32 |
I think this is good. See the little diagram at #1750 (comment) for how I understand the implications of this change. @aykevl or anyone else have any comments before I merge? |
Moving this to the machine package overall sounds like a good idea to me. However, there are a few things that may be better specified:
Here is a proposal:
This second point may be too much for this PR, maybe it can be done separately. The reason I'm so worried is that once you provide an API (even one that is not intended for use by user code), it is very hard to change it. Therefore, I very much prefer if the API is as simple, obvious and portable as possible so that there is no worry in changing the implementation later or porting code to a different chip. We already have a few APIs I'm not very happy about and would like to change, but changing it now is difficult. I would want to avoid to add this API to the list. |
In my mind In the current change, this is the full interface from
Ultimately, i think the tick counter needs to be in the
Option 3 is what the ST HAL does. If The more I think about it, option 3 may be the cleaner way to do it, and it would free up a timer peripheral for app usage. What do you think about option 3? - which I'd summarize as:
|
Closing this as it's superseded by other work to abstract TIM objects. |
See #1750
This is the first step in cleaning up the PLL and oscillator initialization logic for STM32. This first step moves the code into the machine package to avoid linker hacks enabling the tick count to be used by existing logic in the machine package.
This change has been verified on:
bluepill (stm32f103)
nucleo-f722ze
nucleo-l552ze
nucleo-l432kc
nucleo-l031k6