From 3da2028a769f03ea3ea4fa1b3d69d0bf19af3b1e Mon Sep 17 00:00:00 2001 From: Karl Palsson Date: Fri, 17 Sep 2021 13:18:13 +0000 Subject: platforms: stm32f3: make functional Sufficient for blinking leds. Not much else tested yet. Signed-off-by: Karl Palsson --- rcc/rcc.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'rcc/rcc.cpp') diff --git a/rcc/rcc.cpp b/rcc/rcc.cpp index 5a7e29e..25ed29c 100644 --- a/rcc/rcc.cpp +++ b/rcc/rcc.cpp @@ -7,13 +7,13 @@ void rcc_init() { flash_init(); #if defined(STM32F1) || defined(STM32F3) - - // Enable HSE. + // Enable (assumed 8MHz!) HSE RCC->CR |= 0x10000; while(!(RCC->CR & 0x20000)); - - // Configure and enable PLL. - RCC->CFGR = 0x1d0000; + + // Configure and enable PLL from HSE. + auto pll_mul = 9; + RCC->CFGR = ((pll_mul-2)<<18) | (0x2 << 15); RCC->CR |= 0x1000000; while(!(RCC->CR & 0x2000000)); -- cgit v1.2.3