diff --git a/src/platforms/native/platform.c b/src/platforms/native/platform.c index d768661..338cd85 100644 --- a/src/platforms/native/platform.c +++ b/src/platforms/native/platform.c @@ -161,7 +161,8 @@ void platform_init(void) GPIO_CNF_INPUT_PULL_UPDOWN, GPIO0); } /* Relocate interrupt vector table here */ - SCB_VTOR = 0x2000; + extern int vector_table; + SCB_VTOR = (uint32_t)&vector_table; platform_timing_init(); cdcacm_init(); diff --git a/src/platforms/stlink/platform.c b/src/platforms/stlink/platform.c index 33f231c..dcc1493 100644 --- a/src/platforms/stlink/platform.c +++ b/src/platforms/stlink/platform.c @@ -101,7 +101,9 @@ void platform_init(void) gpio_set_mode(LED_PORT, GPIO_MODE_OUTPUT_2_MHZ, GPIO_CNF_OUTPUT_PUSHPULL, led_idle_run); - SCB_VTOR = 0x2000; /* Relocate interrupt vector table here */ + /* Relocate interrupt vector table here */ + extern int vector_table; + SCB_VTOR = (uint32_t)&vector_table; platform_timing_init(); cdcacm_init(); diff --git a/src/platforms/swlink/platform.c b/src/platforms/swlink/platform.c index 921e7e8..aace5a1 100644 --- a/src/platforms/swlink/platform.c +++ b/src/platforms/swlink/platform.c @@ -77,7 +77,9 @@ void platform_init(void) data |= AFIO_MAPR_TIM2_REMAP_PARTIAL_REMAP1; AFIO_MAPR = data; - SCB_VTOR = 0x2000; // Relocate interrupt vector table here + /* Relocate interrupt vector table here */ + extern int vector_table; + SCB_VTOR = (uint32_t)&vector_table; platform_timing_init(); cdcacm_init();