Skip to content

add DFLL closed loop support in addition to crystalless configuration options#389

Open
hathach wants to merge 1 commit into
masterfrom
add-closed-loop-48M-DFLL-
Open

add DFLL closed loop support in addition to crystalless configuration options#389
hathach wants to merge 1 commit into
masterfrom
add-closed-loop-48M-DFLL-

Conversation

@hathach
Copy link
Copy Markdown
Member

@hathach hathach commented May 14, 2026

fix #386

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates SAMD51 startup clock initialization to restore closed-loop DFLL operation for crystal-based boards while preserving the existing USB clock recovery/open-loop behavior for CRYSTALLESS builds, addressing issue #386.

Changes:

  • Splits SAMD51 DFLL configuration into CRYSTALLESS and crystal-backed paths.
  • Adds DFLL reference clock routing through GCLK3 for non-crystalless boards.
  • Configures closed-loop DFLL multiplication against the 32.768 kHz crystal reference.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cores/arduino/startup.c Outdated
Comment on lines +181 to +184
while ( (OSCCTRL->STATUS.reg & (OSCCTRL_STATUS_DFLLRDY | OSCCTRL_STATUS_DFLLLCKC))
!= (OSCCTRL_STATUS_DFLLRDY | OSCCTRL_STATUS_DFLLLCKC) )
{
/* Wait for synchronization and coarse lock */
@hathach hathach force-pushed the add-closed-loop-48M-DFLL- branch from 11386ce to d4947b2 Compare May 14, 2026 05:05
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

Successfully merging this pull request may close these issues.

Make 48M DFLL more accurate again on crystal based boards

2 participants