2015-04-16 08:33:35 +02:00
|
|
|
|
/*
|
|
|
|
|
* Copyright (C) 2015 Kaspar Schleiser <kaspar@schleiser.de>
|
|
|
|
|
* 2015 FreshTemp, LLC.
|
|
|
|
|
*
|
|
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser
|
|
|
|
|
* General Public License v2.1. See the file LICENSE in the top level
|
|
|
|
|
* directory for more details.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup cpu_saml21
|
|
|
|
|
* @{
|
|
|
|
|
*
|
|
|
|
|
* @file cpu.c
|
|
|
|
|
* @brief Implementation of the CPU initialization for Atmel SAML21 MCUs
|
|
|
|
|
*
|
|
|
|
|
* @author Kaspar Schleiser <kaspar@schleiser.de>
|
|
|
|
|
* @}
|
|
|
|
|
*/
|
|
|
|
|
|
2020-10-21 15:56:42 +02:00
|
|
|
|
#include <assert.h>
|
|
|
|
|
|
2015-04-16 08:33:35 +02:00
|
|
|
|
#include "cpu.h"
|
2023-01-02 18:08:35 +01:00
|
|
|
|
#include "kernel_init.h"
|
2017-01-20 11:18:38 +01:00
|
|
|
|
#include "periph/init.h"
|
2019-06-12 16:20:14 +02:00
|
|
|
|
#include "periph_conf.h"
|
2019-04-10 11:07:05 +02:00
|
|
|
|
#include "stdio_base.h"
|
2015-04-16 08:33:35 +02:00
|
|
|
|
|
2020-02-21 17:03:12 +01:00
|
|
|
|
/* As long as DFLL & DPLL are not used, we can default to
|
|
|
|
|
* always use the buck converter when available.
|
|
|
|
|
*
|
|
|
|
|
* An external inductor needs to be present on the board,
|
|
|
|
|
* so the feature can only be enabled by the board configuration.
|
|
|
|
|
*/
|
|
|
|
|
#ifndef USE_VREG_BUCK
|
|
|
|
|
#define USE_VREG_BUCK (0)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if (CLOCK_CORECLOCK == 48000000U) || defined (MODULE_PERIPH_USBDEV)
|
|
|
|
|
#define USE_DFLL (1)
|
2021-05-05 23:59:05 +02:00
|
|
|
|
#define GCLK_GENCTRL_SRC_MAIN GCLK_GENCTRL_SRC_DFLL48M
|
2020-02-21 17:03:12 +01:00
|
|
|
|
#else
|
|
|
|
|
#define USE_DFLL (0)
|
2021-05-05 23:59:05 +02:00
|
|
|
|
#define GCLK_GENCTRL_SRC_MAIN GCLK_GENCTRL_SRC_OSC16M
|
2020-02-21 17:03:12 +01:00
|
|
|
|
#endif
|
|
|
|
|
|
2015-05-17 22:19:19 +02:00
|
|
|
|
static void _gclk_setup(int gclk, uint32_t reg)
|
|
|
|
|
{
|
|
|
|
|
GCLK->GENCTRL[gclk].reg = reg;
|
2019-06-12 16:20:14 +02:00
|
|
|
|
while (GCLK->SYNCBUSY.reg & GCLK_SYNCBUSY_GENCTRL(gclk)) {}
|
2015-05-17 22:19:19 +02:00
|
|
|
|
}
|
|
|
|
|
|
2019-06-12 17:49:57 +02:00
|
|
|
|
static void _osc32k_setup(void)
|
|
|
|
|
{
|
|
|
|
|
#if INTERNAL_OSC32_SOURCE
|
|
|
|
|
uint32_t * pCalibrationArea;
|
|
|
|
|
uint32_t osc32kcal;
|
|
|
|
|
|
|
|
|
|
/* Read OSC32KCAL, calibration data for OSC32 !!! */
|
|
|
|
|
pCalibrationArea = (uint32_t*) NVMCTRL_OTP5;
|
|
|
|
|
osc32kcal = ( (*pCalibrationArea) & 0x1FC0 ) >> 6;
|
|
|
|
|
|
|
|
|
|
/* RTC use Low Power Internal Oscillator at 32kHz */
|
|
|
|
|
OSC32KCTRL->OSC32K.reg = OSC32KCTRL_OSC32K_RUNSTDBY
|
|
|
|
|
| OSC32KCTRL_OSC32K_EN32K
|
|
|
|
|
| OSC32KCTRL_OSC32K_CALIB(osc32kcal)
|
|
|
|
|
| OSC32KCTRL_OSC32K_ENABLE;
|
|
|
|
|
|
|
|
|
|
/* Wait OSC32K Ready */
|
2024-05-29 17:19:39 +02:00
|
|
|
|
while (!(OSC32KCTRL->STATUS.reg & OSC32KCTRL_STATUS_OSC32KRDY)) {}
|
2019-06-12 17:49:57 +02:00
|
|
|
|
#endif /* INTERNAL_OSC32_SOURCE */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void _xosc32k_setup(void)
|
|
|
|
|
{
|
|
|
|
|
#if EXTERNAL_OSC32_SOURCE
|
|
|
|
|
/* RTC uses External 32,768KHz Oscillator */
|
|
|
|
|
OSC32KCTRL->XOSC32K.reg = OSC32KCTRL_XOSC32K_XTALEN
|
|
|
|
|
| OSC32KCTRL_XOSC32K_RUNSTDBY
|
|
|
|
|
| OSC32KCTRL_XOSC32K_EN32K
|
|
|
|
|
| OSC32KCTRL_XOSC32K_ENABLE;
|
|
|
|
|
|
|
|
|
|
/* Wait XOSC32K Ready */
|
2024-05-29 17:19:39 +02:00
|
|
|
|
while (!(OSC32KCTRL->STATUS.reg & OSC32KCTRL_STATUS_XOSC32KRDY)) {}
|
2019-06-12 17:49:57 +02:00
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
2019-12-16 19:40:23 +01:00
|
|
|
|
void sam0_gclk_enable(uint8_t id)
|
|
|
|
|
{
|
2019-08-29 12:30:42 +02:00
|
|
|
|
switch(id) {
|
|
|
|
|
case SAM0_GCLK_48MHZ:
|
|
|
|
|
_gclk_setup(SAM0_GCLK_48MHZ, GCLK_GENCTRL_GENEN |
|
|
|
|
|
GCLK_GENCTRL_SRC_DFLL48M);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
2019-12-16 19:40:23 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32_t sam0_gclk_freq(uint8_t id)
|
|
|
|
|
{
|
|
|
|
|
switch (id) {
|
2019-12-16 19:41:16 +01:00
|
|
|
|
case SAM0_GCLK_MAIN:
|
2019-12-16 19:40:23 +01:00
|
|
|
|
return CLOCK_CORECLOCK;
|
2021-05-05 10:56:37 +02:00
|
|
|
|
case SAM0_GCLK_TIMER:
|
|
|
|
|
#if (CLOCK_CORECLOCK == 48000000U) || (CLOCK_CORECLOCK == 16000000U) || (CLOCK_CORECLOCK == 8000000U)
|
2020-03-25 22:18:51 +01:00
|
|
|
|
return 8000000;
|
2021-05-05 10:56:37 +02:00
|
|
|
|
#else
|
|
|
|
|
return 4000000;
|
|
|
|
|
#endif
|
2019-12-16 19:41:16 +01:00
|
|
|
|
case SAM0_GCLK_32KHZ:
|
2019-12-16 19:40:23 +01:00
|
|
|
|
return 32768;
|
2019-08-29 12:30:42 +02:00
|
|
|
|
case SAM0_GCLK_48MHZ:
|
|
|
|
|
return 48000000;
|
2019-12-16 19:40:23 +01:00
|
|
|
|
default:
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-25 22:18:51 +01:00
|
|
|
|
static void _dfll_setup(void)
|
|
|
|
|
{
|
2020-02-21 17:03:12 +01:00
|
|
|
|
if (!USE_DFLL) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-25 22:18:51 +01:00
|
|
|
|
GCLK->PCHCTRL[OSCCTRL_GCLK_ID_DFLL48].reg = GCLK_PCHCTRL_CHEN |
|
|
|
|
|
GCLK_PCHCTRL_GEN_GCLK2;
|
|
|
|
|
|
|
|
|
|
/* wait for sync */
|
|
|
|
|
while (!(GCLK->PCHCTRL[OSCCTRL_GCLK_ID_DFLL48].reg & GCLK_PCHCTRL_CHEN)) {}
|
|
|
|
|
|
|
|
|
|
OSCCTRL->DFLLCTRL.reg = OSCCTRL_DFLLCTRL_ENABLE;
|
|
|
|
|
/* Wait for write synchronization */
|
|
|
|
|
while (!(OSCCTRL->STATUS.reg & OSCCTRL_STATUS_DFLLRDY)) {}
|
|
|
|
|
OSCCTRL->DFLLVAL.reg = OSCCTRL_DFLLVAL_COARSE((*(uint32_t*)NVMCTRL_OTP5)
|
|
|
|
|
>> 26) | OSCCTRL_DFLLVAL_FINE(512);
|
|
|
|
|
|
|
|
|
|
/* Wait for write synchronization */
|
|
|
|
|
while (!(OSCCTRL->STATUS.reg & OSCCTRL_STATUS_DFLLRDY)) {}
|
|
|
|
|
/* Generate a 48 Mhz clock from the 32KHz */
|
|
|
|
|
OSCCTRL->DFLLMUL.reg = OSCCTRL_DFLLMUL_CSTEP(0x08) |
|
|
|
|
|
OSCCTRL_DFLLMUL_FSTEP(0x08) |
|
|
|
|
|
OSCCTRL_DFLLMUL_MUL((48000000U/32768));
|
|
|
|
|
|
|
|
|
|
/* Disable DFLL before setting its configuration */
|
|
|
|
|
OSCCTRL->DFLLCTRL.reg = 0;
|
|
|
|
|
while (!(OSCCTRL->STATUS.reg & OSCCTRL_STATUS_DFLLRDY)) {}
|
|
|
|
|
/* Write full configuration to DFLL control register */
|
|
|
|
|
OSCCTRL->DFLLCTRL.reg = OSCCTRL_DFLLCTRL_WAITLOCK |
|
|
|
|
|
OSCCTRL_DFLLCTRL_MODE |
|
|
|
|
|
OSCCTRL_DFLLCTRL_CCDIS |
|
|
|
|
|
OSCCTRL_DFLLCTRL_BPLCKC |
|
|
|
|
|
OSCCTRL_DFLLCTRL_ENABLE;
|
|
|
|
|
|
|
|
|
|
/* Ensure COARSE and FINE are locked */
|
2024-05-29 17:19:39 +02:00
|
|
|
|
while ((!(OSCCTRL->STATUS.reg & OSCCTRL_STATUS_DFLLLCKC)) &&
|
|
|
|
|
(!(OSCCTRL->STATUS.reg & OSCCTRL_STATUS_DFLLLCKF))) {}
|
|
|
|
|
while (!(OSCCTRL->STATUS.reg & OSCCTRL_STATUS_DFLLRDY)) {}
|
2020-03-25 22:18:51 +01:00
|
|
|
|
|
|
|
|
|
/* Enable NVMCTRL */
|
|
|
|
|
MCLK->APBBMASK.reg |= MCLK_APBBMASK_NVMCTRL;
|
|
|
|
|
/* Set Wait State to meet requirements */
|
|
|
|
|
NVMCTRL->CTRLB.reg |= NVMCTRL_CTRLB_RWS(3);
|
2020-02-21 17:03:12 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void _set_active_mode_vreg(void)
|
|
|
|
|
{
|
|
|
|
|
if (!USE_VREG_BUCK) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* not compatible with 48 MHz DFLL & 96 MHz FDPLL */
|
|
|
|
|
if (USE_DFLL) {
|
|
|
|
|
sam0_set_voltage_regulator(SAM0_VREG_LDO);
|
|
|
|
|
} else {
|
|
|
|
|
sam0_set_voltage_regulator(SAM0_VREG_BUCK);
|
|
|
|
|
}
|
2020-03-25 22:18:51 +01:00
|
|
|
|
}
|
2020-02-24 17:56:11 +01:00
|
|
|
|
|
|
|
|
|
void cpu_pm_cb_enter(int deep)
|
|
|
|
|
{
|
2020-02-21 17:03:12 +01:00
|
|
|
|
if (!deep) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If you are using saml21 rev. B, switch Main Clock to OSCULP32 during standby
|
|
|
|
|
to work around errata 1.2.1.
|
|
|
|
|
See discussion in #13441 */
|
2024-05-29 17:19:39 +02:00
|
|
|
|
assert(((DSU->DID.reg & DSU_DID_REVISION_Msk) > 1) ||
|
|
|
|
|
((PM->STDBYCFG.reg & 0x80) == 0));
|
2020-02-21 17:03:12 +01:00
|
|
|
|
|
|
|
|
|
/* errata 51.1.5 – When VDDCORE is supplied by the BUCK converter in performance
|
|
|
|
|
level 0, the chip cannot wake-up from standby mode because the
|
|
|
|
|
VCORERDY status is stuck at 0. */
|
2024-05-29 17:19:39 +02:00
|
|
|
|
if (USE_VREG_BUCK && !(PM->PLCFG.reg & PM_PLCFG_PLSEL_Msk)) {
|
2020-02-21 17:03:12 +01:00
|
|
|
|
sam0_set_voltage_regulator(SAM0_VREG_LDO);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* TODO: If we source Main Clock from OSCULP32 during standby and are not in
|
|
|
|
|
performance level 0, we should always be able to use the BUCK converter
|
|
|
|
|
during standby */
|
2020-02-24 17:56:11 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void cpu_pm_cb_leave(int deep)
|
|
|
|
|
{
|
2020-02-21 17:03:12 +01:00
|
|
|
|
if (!deep) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_set_active_mode_vreg();
|
2020-02-24 17:56:11 +01:00
|
|
|
|
}
|
|
|
|
|
|
2015-04-16 08:33:35 +02:00
|
|
|
|
/**
|
|
|
|
|
* @brief Initialize the CPU, set IRQ priorities, clocks
|
|
|
|
|
*/
|
|
|
|
|
void cpu_init(void)
|
|
|
|
|
{
|
2024-05-29 17:19:39 +02:00
|
|
|
|
uint32_t reg = 0;
|
2015-04-16 08:33:35 +02:00
|
|
|
|
/* disable the watchdog timer */
|
2024-05-29 17:19:39 +02:00
|
|
|
|
WDT->CTRLA.reg = 0;
|
2015-04-16 08:33:35 +02:00
|
|
|
|
|
2020-03-25 22:18:51 +01:00
|
|
|
|
/* Disable the RTC module to prevent synchronization issues during CPU init
|
|
|
|
|
if the RTC was running from a previous boot (e.g wakeup from backup) */
|
2024-05-29 17:19:39 +02:00
|
|
|
|
if (RTC->MODE2.CTRLA.reg & RTC_MODE2_CTRLA_ENABLE) {
|
2020-03-25 22:18:51 +01:00
|
|
|
|
while (RTC->MODE2.SYNCBUSY.reg) {}
|
2024-05-29 17:19:39 +02:00
|
|
|
|
RTC->MODE2.CTRLA.reg &= ~RTC_MODE2_CTRLA_ENABLE;
|
2020-03-25 22:18:51 +01:00
|
|
|
|
while (RTC->MODE2.SYNCBUSY.reg) {}
|
|
|
|
|
}
|
|
|
|
|
|
2015-05-27 23:07:10 +02:00
|
|
|
|
/* initialize the Cortex-M core */
|
|
|
|
|
cortexm_init();
|
2015-04-16 08:33:35 +02:00
|
|
|
|
|
2020-02-21 17:03:12 +01:00
|
|
|
|
/* select the right voltage regulator config for active mode */
|
|
|
|
|
_set_active_mode_vreg();
|
|
|
|
|
|
2015-05-17 22:19:19 +02:00
|
|
|
|
/* turn on only needed APB peripherals */
|
|
|
|
|
MCLK->APBAMASK.reg =
|
|
|
|
|
MCLK_APBAMASK_PM
|
|
|
|
|
|MCLK_APBAMASK_MCLK
|
|
|
|
|
|MCLK_APBAMASK_RSTC
|
|
|
|
|
|MCLK_APBAMASK_OSCCTRL
|
|
|
|
|
|MCLK_APBAMASK_OSC32KCTRL
|
|
|
|
|
|MCLK_APBAMASK_SUPC
|
|
|
|
|
|MCLK_APBAMASK_GCLK
|
|
|
|
|
|MCLK_APBAMASK_WDT
|
|
|
|
|
|MCLK_APBAMASK_RTC
|
|
|
|
|
|MCLK_APBAMASK_EIC
|
|
|
|
|
|MCLK_APBAMASK_PORT
|
|
|
|
|
//|MCLK_APBAMASK_TAL
|
|
|
|
|
;
|
2015-04-16 08:33:35 +02:00
|
|
|
|
|
|
|
|
|
/* Software reset the GCLK module to ensure it is re-initialized correctly */
|
|
|
|
|
GCLK->CTRLA.reg = GCLK_CTRLA_SWRST;
|
2016-01-26 20:01:06 +01:00
|
|
|
|
while (GCLK->CTRLA.reg & GCLK_CTRLA_SWRST) {}
|
|
|
|
|
while (GCLK->SYNCBUSY.reg & GCLK_SYNCBUSY_SWRST) {}
|
2015-04-16 08:33:35 +02:00
|
|
|
|
|
2021-05-03 18:56:51 +02:00
|
|
|
|
#if (CLOCK_CORECLOCK > 12000000U)
|
2019-06-12 16:20:14 +02:00
|
|
|
|
PM->PLCFG.reg = PM_PLCFG_PLSEL_PL2;
|
2024-05-29 17:19:39 +02:00
|
|
|
|
while (!(PM->INTFLAG.reg & PM_INTFLAG_PLRDY)) {}
|
2021-05-03 18:56:51 +02:00
|
|
|
|
#endif
|
2019-06-12 16:20:14 +02:00
|
|
|
|
|
2021-05-03 18:56:51 +02:00
|
|
|
|
/* set OSC16M according to CLOCK_CORECLOCK */
|
|
|
|
|
#if (CLOCK_CORECLOCK == 48000000U) || (CLOCK_CORECLOCK == 16000000U)
|
2024-05-29 17:19:39 +02:00
|
|
|
|
reg = OSCCTRL_OSC16MCTRL_FSEL_16;
|
2021-05-03 18:56:51 +02:00
|
|
|
|
#elif (CLOCK_CORECLOCK == 12000000U)
|
2024-05-29 17:19:39 +02:00
|
|
|
|
reg = OSCCTRL_OSC16MCTRL_FSEL_12;
|
2021-05-03 18:56:51 +02:00
|
|
|
|
#elif (CLOCK_CORECLOCK == 8000000U)
|
2024-05-29 17:19:39 +02:00
|
|
|
|
reg = OSCCTRL_OSC16MCTRL_FSEL_8;
|
2021-05-03 18:56:51 +02:00
|
|
|
|
#elif (CLOCK_CORECLOCK == 4000000U)
|
2024-05-29 17:19:39 +02:00
|
|
|
|
reg = OSCCTRL_OSC16MCTRL_FSEL_4;
|
2021-05-03 18:56:51 +02:00
|
|
|
|
#else
|
|
|
|
|
#error "Please select a valid CPU frequency"
|
|
|
|
|
#endif
|
2021-05-05 16:34:01 +02:00
|
|
|
|
|
2024-05-29 17:19:39 +02:00
|
|
|
|
reg |= OSCCTRL_OSC16MCTRL_ONDEMAND;
|
|
|
|
|
reg |= OSCCTRL_OSC16MCTRL_ENABLE;
|
|
|
|
|
OSCCTRL->OSC16MCTRL.reg = reg;
|
2015-05-17 22:19:19 +02:00
|
|
|
|
|
2019-06-12 17:49:57 +02:00
|
|
|
|
_osc32k_setup();
|
|
|
|
|
_xosc32k_setup();
|
|
|
|
|
|
2019-12-16 19:40:23 +01:00
|
|
|
|
#if EXTERNAL_OSC32_SOURCE
|
2019-12-16 19:41:16 +01:00
|
|
|
|
_gclk_setup(SAM0_GCLK_32KHZ, GCLK_GENCTRL_GENEN | GCLK_GENCTRL_SRC_XOSC32K);
|
2019-12-16 19:40:23 +01:00
|
|
|
|
#else
|
2019-12-16 19:41:16 +01:00
|
|
|
|
_gclk_setup(SAM0_GCLK_32KHZ, GCLK_GENCTRL_GENEN | GCLK_GENCTRL_SRC_OSCULP32K);
|
2019-12-16 19:40:23 +01:00
|
|
|
|
#endif
|
2017-01-12 17:48:11 +01:00
|
|
|
|
|
2020-03-25 22:18:51 +01:00
|
|
|
|
_dfll_setup();
|
|
|
|
|
|
|
|
|
|
/* Setup GCLK generators */
|
2021-05-05 16:34:01 +02:00
|
|
|
|
_gclk_setup(SAM0_GCLK_MAIN, GCLK_GENCTRL_GENEN | GCLK_GENCTRL_SRC_MAIN);
|
2020-03-25 22:18:51 +01:00
|
|
|
|
|
|
|
|
|
/* Ensure APB Backup domain clock is within the 6MHZ limit, BUPDIV value
|
|
|
|
|
must be a power of 2 and between 1(2^0) and 128(2^7) */
|
|
|
|
|
for (unsigned i = 0; i < 8; i++) {
|
|
|
|
|
if (CLOCK_CORECLOCK / (1 << i) <= 6000000) {
|
|
|
|
|
MCLK->BUPDIV.reg = (1 << i);
|
2024-05-29 17:19:39 +02:00
|
|
|
|
while (!(MCLK->INTFLAG.reg & MCLK_INTFLAG_CKRDY)) {}
|
2020-03-25 22:18:51 +01:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/* clock used by timers */
|
2021-05-05 16:34:01 +02:00
|
|
|
|
_gclk_setup(SAM0_GCLK_TIMER, GCLK_GENCTRL_GENEN | GCLK_GENCTRL_SRC_MAIN
|
2021-05-05 10:56:37 +02:00
|
|
|
|
| GCLK_GENCTRL_DIV(CLOCK_CORECLOCK/sam0_gclk_freq(SAM0_GCLK_TIMER)));
|
2020-03-25 22:18:51 +01:00
|
|
|
|
|
2017-12-08 05:22:09 +01:00
|
|
|
|
#ifdef MODULE_PERIPH_PM
|
2017-01-12 17:48:11 +01:00
|
|
|
|
PM->CTRLA.reg = PM_CTRLA_MASK & (~PM_CTRLA_IORET);
|
|
|
|
|
|
|
|
|
|
/* disable brownout detection
|
|
|
|
|
* (Caused unexplicable reboots from sleep on saml21. /KS)
|
|
|
|
|
*/
|
2024-05-29 17:19:39 +02:00
|
|
|
|
SUPC->BOD33.reg &= ~SUPC_BOD33_ENABLE;
|
2017-01-12 17:48:11 +01:00
|
|
|
|
#endif
|
2017-01-20 11:18:38 +01:00
|
|
|
|
|
2020-06-11 20:24:01 +02:00
|
|
|
|
#ifdef MODULE_PERIPH_DMA
|
|
|
|
|
/* initialize DMA streams */
|
|
|
|
|
dma_init();
|
|
|
|
|
#endif
|
2019-04-10 11:07:05 +02:00
|
|
|
|
/* initialize stdio prior to periph_init() to allow use of DEBUG() there */
|
2023-01-02 18:08:35 +01:00
|
|
|
|
early_init();
|
2019-04-10 11:07:05 +02:00
|
|
|
|
|
2017-01-20 11:18:38 +01:00
|
|
|
|
/* trigger static peripheral initialization */
|
|
|
|
|
periph_init();
|
2015-04-16 08:33:35 +02:00
|
|
|
|
}
|