From 5617c1eefa6d8a142d7a138b15fd6d4032486ab6 Mon Sep 17 00:00:00 2001 From: bsongis Date: Fri, 20 Feb 2015 18:09:29 +0100 Subject: [PATCH] Vectors table was not correctly relocated on STM32F4 --- .../ST/STM32F4xx/Source/Templates/system_stm32f4xx.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/radio/src/targets/taranis/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c b/radio/src/targets/taranis/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c index 8fbc27d8a..9fe1903e6 100755 --- a/radio/src/targets/taranis/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c +++ b/radio/src/targets/taranis/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c @@ -259,7 +259,7 @@ * @{ */ -#include "stm32f4xx.h" +#include "../../Include/stm32f4xx.h" /** * @} @@ -293,9 +293,9 @@ through STLINK MCO pin of STM32F103 microcontroller. The frequency cannot be changed and is fixed at 8 MHz. Hardware configuration needed for Nucleo Board: - – SB54, SB55 OFF - – R35 removed - – SB16, SB50 ON */ + � SB54, SB55 OFF + � R35 removed + � SB16, SB50 ON */ /* #define USE_HSE_BYPASS */ #if defined (USE_HSE_BYPASS) @@ -451,7 +451,9 @@ void SystemInit(void) #ifdef VECT_TAB_SRAM SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */ #else - SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */ + // SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */ + extern uint32_t g_pfnVectors ; + SCB->VTOR = (uint32_t) &g_pfnVectors ; /* Vector Table Relocation in Internal FLASH */ #endif }