diff options
author | Eric Callahan <arksine.code@gmail.com> | 2021-11-06 15:18:46 -0400 |
---|---|---|
committer | KevinOConnor <kevin@koconnor.net> | 2021-11-08 20:10:51 -0500 |
commit | bf9d497ab0ee437429e7abbe11cc059ca63c9823 (patch) | |
tree | 390c4f67f1d5ac3eb183b28773fc82dce4d02eed /src/stm32 | |
parent | 76bfc3237a196b21355abf1833b5c486f0b70f8a (diff) | |
download | kutter-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/stm32')
-rw-r--r-- | src/stm32/stm32f4.c | 6 |
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(); |