aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Callahan <arksine.code@gmail.com>2021-11-06 15:18:46 -0400
committerKevinOConnor <kevin@koconnor.net>2021-11-08 20:10:51 -0500
commitbf9d497ab0ee437429e7abbe11cc059ca63c9823 (patch)
tree390c4f67f1d5ac3eb183b28773fc82dce4d02eed /src
parent76bfc3237a196b21355abf1833b5c486f0b70f8a (diff)
downloadkutter-bf9d497ab0ee437429e7abbe11cc059ca63c9823.tar.gz
kutter-bf9d497ab0ee437429e7abbe11cc059ca63c9823.tar.xz
kutter-bf9d497ab0ee437429e7abbe11cc059ca63c9823.zip
stm32f4: reset peripheral clocks on init
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/stm32/stm32f4.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/stm32/stm32f4.c b/src/stm32/stm32f4.c
index 6cbfd22a..b185d983 100644
--- a/src/stm32/stm32f4.c
+++ b/src/stm32/stm32f4.c
@@ -260,6 +260,12 @@ armcm_main(void)
SystemInit();
SCB->VTOR = (uint32_t)VectorTable;
+ // Reset peripheral clocks (for some bootloaders that don't)
+ RCC->AHB1ENR = 0x38000;
+ RCC->AHB2ENR = 0;
+ RCC->APB1ENR = 0;
+ RCC->APB2ENR = 0;
+
clock_setup();
sched_main();