On Thu, Aug 29, 2019 at 8:12 AM Antonio Galea <[email protected]> wrote:
>
> > Since you are using #11250 already, I suggest you to add #10075 and adapt
> > it for SAMR34 to have 48MHz clock support (which is needed by USB IP). This
> > should be pretty straightforward.
> > You should have a working USB after this.
I have followed your advice and tested #10075: USB works, but serial
output is garbled - I guess UART would also need adjusting when
changing the main clock.
Enabling 48MHz DFLL on a different clock generator without messing
with main CPU clock does work correctly, though, so I went for it. I
added the clock code in sam0_common/periph/usbdev.c, and used DFLL in
USB Clock Recovery mode (DFLL locks on 1kHz SOF USB signals) instead
of XOSC32.
Haven't created a pull request since I don't know if my approach is
conforming with RIOT code, but here is my final result:
https://github.com/ant9000/RIOT/tree/pr/saml21_usbdev_48mhz_clock
Very willing to adapt to the correct practice before opening a PR -
just tell me if there's anything needs to be fixed.
Thanks again for your tip, it helped me greatly.
Antonio
_______________________________________________
users mailing list
[email protected]
https://lists.riot-os.org/mailman/listinfo/users