-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
rp2/modmachine: Do not use deprecated XOSC_MHZ. #17746
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
rp2/modmachine: Do not use deprecated XOSC_MHZ. #17746
Conversation
Code size report:
|
Thanks for the contribution. This looks fine to me. But note that Also, pico-sdk provides defines of |
My added definitions are the following:
There is code for backwards compatibility in
Because of the test The other point about In theory we could/should also replace all usages of
What is your suggestion? |
Ah, right, that makes sense then. Your crystal is not an exact MHz multiple. So you definitely need the change in this PR to get the correct timing.
Yes, please make this change. Looking at pico-sdk, it seems they also updated their code to use
No, let's leave those as they are for now. Too much of a risk to change that just before a release. |
b7a1ae1
to
4eaec3b
Compare
I now also removed the usage of I hope this matches your expectations. And thanks again for this great project! |
XOSC_MHZ and XOSC_KHZ may not be defined if we use a custom XIN clock by defining PLL_SYS_REFDIV etc. calculated by vcocalc.py. Signed-off-by: Christian Lang <lang.chr86@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good now, thanks!
Tested on RPI_PICO2_W, everything seems fine.
😄 |
4eaec3b
to
ebc9525
Compare
Summary
I replaced the crystal on a
W5500_EVB_PICO
board by a custom clock source which is not 12 MHz. Therefore I need to configure the SYS and USB PLL with custom dividers. The scriptvcocalc.py
is used to calculate the needed values and to generate the compiler definitions that need to be added to cmake.But when using such custom defines the
XOSC_MHZ
is not defined and the build fails.Testing
I tested this change while compiling for a
W5500_EVB_PICO
board with custom PLL settings as described above.