aboutsummaryrefslogtreecommitdiffstats
path: root/src/stm32/stm32f1.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2019-09-18 10:49:23 -0400
committerKevin O'Connor <kevin@koconnor.net>2019-09-18 11:59:43 -0400
commit80e17b1e53801b13ec47a1fd8038641aa4be2e1d (patch)
tree81c68f4a14de7a4f455bb2c0a4b65503bac6d4b6 /src/stm32/stm32f1.c
parent8cb3d09484e6b304abbd905ffa1073683ffc2fcf (diff)
downloadkutter-80e17b1e53801b13ec47a1fd8038641aa4be2e1d.tar.gz
kutter-80e17b1e53801b13ec47a1fd8038641aa4be2e1d.tar.xz
kutter-80e17b1e53801b13ec47a1fd8038641aa4be2e1d.zip
stm32: Move VTOR fixup from main() to chip specific code
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/stm32/stm32f1.c')
-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 e1ef56aa..8723c6d1 100644
--- a/src/stm32/stm32f1.c
+++ b/src/stm32/stm32f1.c
@@ -5,6 +5,7 @@
// This file may be distributed under the terms of the GNU GPLv3 license.
#include "autoconf.h" // CONFIG_CLOCK_REF_8M
+#include "board/armcm_boot.h" // VectorTable
#include "board/irq.h" // irq_disable
#include "board/usb_cdc.h" // usb_request_bootloader
#include "internal.h" // enable_pclock
@@ -125,6 +126,10 @@ usb_request_bootloader(void)
void
clock_setup(void)
{
+ // The SystemInit() code alters VTOR - restore it
+ SCB->VTOR = (uint32_t)VectorTable;
+
+ // Configure and enable PLL
uint32_t cfgr;
if (CONFIG_CLOCK_REF_8M) {
// Configure 72Mhz PLL from external 8Mhz crystal (HSE)