-
Notifications
You must be signed in to change notification settings - Fork 925
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
rp2040 / rp2350 xoscFreq setting is nonfuctional #4673
Comments
* Addresses tinygo-org#4673: input oscillator frequency can be changed for an individual board by filling in a custom PLL configuration
I created a clock configuration structure, made a default in machine_rp2_2xxx.go, then modified the board files to create a new object based on the default. This appears to work if I build a target locally, however the CI test fails because it appears to be building a test for WASM based on the board file, but not including the machine backend. So I imagine that this wasn't the right way to do this :-) If anyone has an example of a TinyGo way to achieve this let me know. Otherwise I'm out of guesses. |
Looking into this today... |
@deadprogram thanks! See #4674 for some more discussion about this |
* Addresses tinygo-org#4673: input oscillator frequency can be changed for an individual board by filling in a custom PLL configuration
This moves the clock definitions into the 2040 and 2350 machine files, and reverts them to constants. This also addresses tinygo-org#4673
The RP2040 and 2350 board files all specify a parameter for the external crystal frequency, xoscFreq. This appears to be so that a different external crystal could be used on a particular board.
Unfortunately, the PLL configurations for the system and USB clock are hard-coded to assume a 12MHz input clock, so this setting doesn't actually work. Finding an optimal setting for the PLL is complicated, and it's probably best not to do this on the fly during the startup code.
I can think of two straightforward solutions:
I think option 1 better, unless someone has a board with a nonstandard clock that they need to support. I couldn't find examples of other machines/boards that support a similar feature. If either of these sound reasonable, I'd be happy to make a pull request.
cc @soypat @deadprogram
The text was updated successfully, but these errors were encountered: