Browse Source

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).
pull/356/head
Stefan Agner 11 years ago
committed by Frantisek Burian
parent
commit
cc2dc243e5
  1. 5
      lib/vf6xx/vector_chipset.c

5
lib/vf6xx/vector_chipset.c

@ -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…
Cancel
Save