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

No way for user to get system clock frequency from embassy-stm32 #3909

Open
dlaw opened this issue Feb 21, 2025 · 1 comment
Open

No way for user to get system clock frequency from embassy-stm32 #3909

dlaw opened this issue Feb 21, 2025 · 1 comment

Comments

@dlaw
Copy link
Contributor

dlaw commented Feb 21, 2025

After configuring clocks with embassy-stm32, peripheral clock frequencies are available through the .frequency() methods of the corresponding peripherals. However, there seems to be no way for user code to find out the system clock frequency.

Internal embassy-stm32 code is able to use the private get_freqs() method for this:
https://github.com/search?q=repo%3Aembassy-rs%2Fembassy%20unsafe%20%7B%20crate%3A%3Arcc%3A%3Aget_freqs()%20%7D.sys&type=code

Would it be possible to provide a public RCC method which returns the system clock frequency?

I would be happy to attempt the implementation if this is deemed desirable.

@diondokter
Copy link
Contributor

Ah yes, I've run into this a couple of times as well. Would be nice to get access to the clocks (also more than just the system clock).
I guess the reason it's not public is because it's not considered a stable API.

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