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:
parent
07b7d3e805
commit
cc2dc243e5
@ -19,6 +19,8 @@
|
||||
|
||||
#include <libopencm3/cm3/scb.h>
|
||||
|
||||
extern vector_table_t vector_table;
|
||||
|
||||
static inline void pre_main(void)
|
||||
{
|
||||
/*
|
||||
@ -28,4 +30,7 @@ static inline void pre_main(void)
|
||||
asm ( \
|
||||
"ldr sp,=_stack;" \
|
||||
);
|
||||
|
||||
/* Set Vector Table Offset to our memory based vector table */
|
||||
SCB_VTOR = (uint32_t)&vector_table;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user