From f1774fa049afc6f35192ff0f60ac5486cd9d3b08 Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 18 Apr 2019 15:36:59 +1000 Subject: [PATCH] stm32/system_stm32f0: Enable PWR clock on startup. To be consistent with how F4/F7/H7/L4 works in system_stm32.c. The power control peripheral is needed at least for the RTC. --- ports/stm32/system_stm32f0.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/stm32/system_stm32f0.c b/ports/stm32/system_stm32f0.c index 9d4b06e568..afabdb667f 100644 --- a/ports/stm32/system_stm32f0.c +++ b/ports/stm32/system_stm32f0.c @@ -129,6 +129,9 @@ void SystemInit(void) { } void SystemClock_Config(void) { + // Enable power control peripheral + __HAL_RCC_PWR_CLK_ENABLE(); + // Set flash latency to 1 because SYSCLK > 24MHz FLASH->ACR = (FLASH->ACR & ~0x7) | 0x1;