]> mj.ucw.cz Git - home-hw.git/blobdiff - test-blink/test.c
Programming using serial boot loader
[home-hw.git] / test-blink / test.c
index 50ca8babe3ce09eba9a2f51911594e6228898ecb..e56426c3a324d1c6edafa1e1a40c289b198cbdc2 100644 (file)
@@ -2,6 +2,7 @@
 
 #include <libopencm3/cm3/cortex.h>
 #include <libopencm3/cm3/nvic.h>
+#include <libopencm3/cm3/scb.h>
 #include <libopencm3/cm3/systick.h>
 #include <libopencm3/stm32/rcc.h>
 #include <libopencm3/stm32/gpio.h>
@@ -48,6 +49,8 @@ int main(void)
        clock_setup();
        gpio_setup();
        tick_setup();
+       // This is needed when programming via serial boot loader, harmless otherwise.
+       SCB_VTOR = 0x08000000;
        cm_enable_interrupts();
 
        for (;;) {