aboutsummaryrefslogtreecommitdiffstats
path: root/src/stm32
diff options
context:
space:
mode:
Diffstat (limited to 'src/stm32')
-rw-r--r--src/stm32/stm32f1.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/stm32/stm32f1.c b/src/stm32/stm32f1.c
index bb07d340..e5c18a83 100644
--- a/src/stm32/stm32f1.c
+++ b/src/stm32/stm32f1.c
@@ -165,6 +165,11 @@ armcm_main(void)
SystemInit();
SCB->VTOR = (uint32_t)VectorTable;
+ // Reset peripheral clocks (for some bootloaders that don't)
+ RCC->AHBENR = 0x14;
+ RCC->APB1ENR = 0;
+ RCC->APB2ENR = 0;
+
// Setup clocks
clock_setup();