File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed
targets/TARGET_STM/TARGET_STM32F4/TARGET_MTB_MTS_DRAGONFLY Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change 40
40
/*!< Uncomment the following line if you need to relocate your vector Table in
41
41
Internal SRAM. */
42
42
/* #define VECT_TAB_SRAM */
43
- #ifndef VECT_TAB_OFFSET
44
43
#define VECT_TAB_OFFSET 0x00 /*!< Vector Table base offset field.
45
44
This value must be a multiple of 0x200. */
46
- #endif
47
45
48
46
49
47
/* Select the clock sources (other than HSI) to start with (0=OFF, 1=ON) */
@@ -92,11 +90,23 @@ void SystemInit(void)
92
90
SystemInit_ExtMemCtl ();
93
91
#endif /* DATA_IN_ExtSRAM || DATA_IN_ExtSDRAM */
94
92
95
- /* Configure the Vector Table location add offset address ------------------*/
93
+ #if defined(__ICCARM__ )
94
+ #pragma section=".intvec"
95
+ #define FLASH_VTOR_BASE ((uint32_t)__section_begin(".intvec"))
96
+ #elif defined(__CC_ARM ) || (defined(__ARMCC_VERSION ) && (__ARMCC_VERSION >= 6010050 ))
97
+ extern uint32_t Load$$LR$$LR_IROM1$$Base [];
98
+ #define FLASH_VTOR_BASE ((uint32_t)Load$$LR$$LR_IROM1$$Base)
99
+ #elif defined(__GNUC__ )
100
+ extern uint32_t g_pfnVectors [];
101
+ #define FLASH_VTOR_BASE ((uint32_t)g_pfnVectors)
102
+ #else
103
+ #error "Flash vector address not set for this toolchain"
104
+ #endif
105
+
96
106
#ifdef VECT_TAB_SRAM
97
- SCB -> VTOR = SRAM_BASE | VECT_TAB_OFFSET ; /* Vector Table Relocation in Internal SRAM */
107
+ SCB -> VTOR = SRAM_BASE | VECT_TAB_OFFSET ; /* Vector Table Relocation in Internal SRAM. */
98
108
#else
99
- SCB -> VTOR = FLASH_BASE | VECT_TAB_OFFSET ; /* Vector Table Relocation in Internal FLASH */
109
+ SCB -> VTOR = FLASH_VTOR_BASE | VECT_TAB_OFFSET ; /* Vector Table Relocation in Internal FLASH. */
100
110
#endif
101
111
102
112
}
You can’t perform that action at this time.
0 commit comments