vf6xx: set vector table to memory

Set Vector Table Offset to memory location of our vector table.
Since we put the whole programm including the vector table into
memory, we need to make use of the Cortex-M4 system control block
Vector Table Offset Register (VTOR).
This commit is contained in:
Stefan Agner 2014-07-01 00:13:26 +02:00 committed by Frantisek Burian
parent 07b7d3e805
commit cc2dc243e5

View File

@ -19,6 +19,8 @@
#include <libopencm3/cm3/scb.h> #include <libopencm3/cm3/scb.h>
extern vector_table_t vector_table;
static inline void pre_main(void) static inline void pre_main(void)
{ {
/* /*
@ -28,4 +30,7 @@ static inline void pre_main(void)
asm ( \ asm ( \
"ldr sp,=_stack;" \ "ldr sp,=_stack;" \
); );
/* Set Vector Table Offset to our memory based vector table */
SCB_VTOR = (uint32_t)&vector_table;
} }