From c9ff1505715097b04fc1f9ce80f107cf466bcd59 Mon Sep 17 00:00:00 2001 From: Francisco Molina Date: Thu, 6 Feb 2020 15:20:08 +0100 Subject: [PATCH] boards/sam%21-xpro: prefer XOSC32K for RTC/RTT (GCLK2) --- boards/samd21-xpro/include/periph_conf.h | 12 ++++++++++-- boards/samr21-xpro/include/periph_conf.h | 12 ++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/boards/samd21-xpro/include/periph_conf.h b/boards/samd21-xpro/include/periph_conf.h index 2fea8f53a25b..734c012ed9ff 100644 --- a/boards/samd21-xpro/include/periph_conf.h +++ b/boards/samd21-xpro/include/periph_conf.h @@ -63,7 +63,16 @@ extern "C" { * * @{ */ -#define CLOCK_USE_PLL (1) +#define CLOCK_USE_PLL (1) +#define CLOCK_USE_XOSC32_DFLL (0) +/* + * 0: use XOSC32K (always 32.768kHz) to clock GCLK2 + * 1: use OSCULP32K factory calibrated (~32.768kHz) to clock GCLK2 + * + * OSCULP32K is factory calibrated to be around 32.768kHz but this values can + * be of by a couple off % points, so prefer XOSC32K as default configuration. + */ +#define GEN2_ULP32K (0) #if CLOCK_USE_PLL /* edit these values to adjust the PLL output frequency */ @@ -76,7 +85,6 @@ extern "C" { #define CLOCK_CORECLOCK (48000000U) #define CLOCK_XOSC32K (32768UL) #define CLOCK_8MHZ (1) -#define GEN2_ULP32K (1) #else /* edit this value to your needs */ #define CLOCK_DIV (1U) diff --git a/boards/samr21-xpro/include/periph_conf.h b/boards/samr21-xpro/include/periph_conf.h index 705d62f19aa3..7dd270d75e59 100644 --- a/boards/samr21-xpro/include/periph_conf.h +++ b/boards/samr21-xpro/include/periph_conf.h @@ -63,7 +63,16 @@ extern "C" { * * @{ */ -#define CLOCK_USE_PLL (1) +#define CLOCK_USE_PLL (1) +#define CLOCK_USE_XOSC32_DFLL (0) +/* + * 0: use XOSC32K (always 32.768kHz) to clock GCLK2 + * 1: use OSCULP32K factory calibrated (~32.768kHz) to clock GCLK2 + * + * OSCULP32K is factory calibrated to be around 32.768kHz but this values can + * be of by a couple off % points, so prefer XOSC32K as default configuration. + */ +#define GEN2_ULP32K (0) #if CLOCK_USE_PLL /* edit these values to adjust the PLL output frequency */ @@ -76,7 +85,6 @@ extern "C" { #define CLOCK_CORECLOCK (48000000U) #define CLOCK_XOSC32K (32768UL) #define CLOCK_8MHZ (1) -#define GEN2_ULP32K (1) #else /* edit this value to your needs */ #define CLOCK_DIV (1U)