diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2020-03-21 12:31:59 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2020-03-24 10:00:45 -0400 |
commit | 886530e777b80081e9837764375df059ebc58ebd (patch) | |
tree | 60b1f60671e5324450655eb8af9d5cefb260de5a /src/stm32/stm32f1.c | |
parent | 295fb7fc85781f4aee1852fc54bbf4471acedb00 (diff) | |
download | kutter-886530e777b80081e9837764375df059ebc58ebd.tar.gz kutter-886530e777b80081e9837764375df059ebc58ebd.tar.xz kutter-886530e777b80081e9837764375df059ebc58ebd.zip |
stm32: Explicitly reset peripheral clocks on stm32f1
It appears some bootloaders do not properly reset some peripherals.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/stm32/stm32f1.c')
-rw-r--r-- | src/stm32/stm32f1.c | 5 |
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(); |