From cc2dc243e57c8ce6bac9858cb83a76665980c27c Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Tue, 1 Jul 2014 00:13:26 +0200 Subject: [PATCH] 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). --- lib/vf6xx/vector_chipset.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/vf6xx/vector_chipset.c b/lib/vf6xx/vector_chipset.c index c5e395c1..3a4f4070 100644 --- a/lib/vf6xx/vector_chipset.c +++ b/lib/vf6xx/vector_chipset.c @@ -19,6 +19,8 @@ #include +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; }