From 49fda3e9005f745cd4f00fe628c8687bcbaff35d Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Thu, 2 Apr 2020 20:11:41 +0200 Subject: [PATCH] cpu/samd5x: don't run DFLL on-demand The DFLL on samd5x has a hardware bug that requires a special re-enabling sequence when it is disabled and then re-enabled again. When running the clock on-demand, the hardware handles the disabling and re-enabling so that sequence does not get executed. To reproduce, run `tests/periph_uart` on `same54-xpro`. Without this patch the test will get seemingly stuck on `sleep_test()`. (In fact it keeps running, but the DFLL has the wrong frequency so the UART baudrate is wrong). In this test, on `same54-xpro` only UART0 is sourced from DFLL. So if the UART is disabled the DFLL will be turned off as well. --- cpu/samd5x/cpu.c | 1 - 1 file changed, 1 deletion(-) diff --git a/cpu/samd5x/cpu.c b/cpu/samd5x/cpu.c index a1cf045119..5872a0ffa0 100644 --- a/cpu/samd5x/cpu.c +++ b/cpu/samd5x/cpu.c @@ -235,6 +235,5 @@ void cpu_init(void) /* set ONDEMAND bit after all clocks have been configured */ /* This is to avoid setting the source for the main clock to ONDEMAND before using it. */ - OSCCTRL->DFLLCTRLA.reg |= OSCCTRL_DFLLCTRLA_ONDEMAND; OSCCTRL->Dpll[0].DPLLCTRLA.reg |= OSCCTRL_DPLLCTRLA_ONDEMAND; }