34#include <libopencm3/stm32/gpio.h>
35#include <libopencm3/stm32/rcc.h>
36#include <libopencm3/stm32/timer.h>
37#include <libopencm3/stm32/flash.h>
38#include <libopencm3/cm3/scb.h>
39#include <libopencm3/stm32/rtc.h>
40#include <libopencm3/stm32/pwr.h>
57 .ahb_frequency = 48000000,
58 .apb1_frequency = 12000000,
59 .apb2_frequency = 24000000,
71 .ahb_frequency = 84000000,
72 .apb1_frequency = 42000000,
73 .apb2_frequency = 84000000,
85 .ahb_frequency = 120000000,
86 .apb1_frequency = 30000000,
87 .apb2_frequency = 60000000,
98 .ahb_frequency = 168000000,
99 .apb1_frequency = 42000000,
100 .apb2_frequency = 84000000,
171#ifdef SYSTEM_MEMORY_BASE
215#ifdef SYSTEM_MEMORY_BASE
220 PRINT_CONFIG_MSG(
"We are running luftboot, the interrupt vector is being relocated.")
227#if EXT_CLK == 8000000
231#elif defined(STM32F4)
232#if AHB_CLK == 84000000
240#elif EXT_CLK == 12000000
244#elif defined(STM32F4)
248#elif EXT_CLK == 16000000
253#elif EXT_CLK == 24000000
257#elif defined(STM32F1)
260#elif EXT_CLK == 25000000
266#error EXT_CLK is either set to an unsupported frequency or not defined at all. Please check!
277#define RCC_CFGR_PPRE2_SHIFT 11
278#define RCC_CFGR_PPRE2 (7 << RCC_CFGR_PPRE2_SHIFT)
280#define RCC_CFGR_PPRE1_SHIFT 8
281#define RCC_CFGR_PPRE1 (7 << RCC_CFGR_PPRE1_SHIFT)
292#elif defined(STM32F4)
295 return RCC_CFGR & ((1 << 10) | (1 << 11) | (1 << 12));
300 return RCC_CFGR & ((1 << 13) | (1 << 14) | (1 << 15));
void mcu_arch_init(void)
Initialize the specific archittecture functions.
#define SYSTEM_MEMORY_BASE
System memory base - for DFU bootloader.
PRINT_CONFIG_MSG("USE_INS_NAV_INIT defaulting to TRUE")
Arch independent mcu ( Micro Controller Unit ) utilities.
uint32_t timer_get_frequency(uint32_t timer_peripheral)
Get Timer clock frequency (before prescaling) Only valid if using the internal clock for the timer.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.