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

SAMD21 Clock Config #179

Closed
richbourne opened this issue Oct 28, 2021 · 5 comments
Closed

SAMD21 Clock Config #179

richbourne opened this issue Oct 28, 2021 · 5 comments

Comments

@richbourne
Copy link

In the crystalless clock config section of the system_init() funtion in init_samd21.c there is this line (setting up OSC8M on GCLK_gen 2):

GCLK->GENCTRL.reg = GCLK_GENCTRL_ID(2) | GCLK_GENCTRL_SRC_OSC8M_Val | GCLK_GENCTRL_GENEN;

Why is GCLK_GENCTRL_SRC_OSC8M_Val used? I would've expected his value to be bit-shifted into place using the GCLK_GENCTRL_SRC_OSC8M define.

Thanks

@dhalbert
Copy link

Hmm, that does seem wrong, and it's an accident that's it's working now, perhaps. If you fix this, does the bootloader still work?

@richbourne
Copy link
Author

It does appear to function correctly after the change, yes. Boots OK...can flash circuitpython with a .uf2 update file.

@dhalbert
Copy link

A PR would be welcome, if you feel so inclined.

@xyzzy42
Copy link

xyzzy42 commented Nov 30, 2023

This was fixed in #188 and can be closed.

@dhalbert
Copy link

Thanks!

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

3 participants