22
22
******************************************************************************
23
23
* @attention
24
24
*
25
- * <h2><center>© Copyright (c) 2017 STMicroelectronics.
26
- * All rights reserved.</center></h2>
25
+ * Copyright (c) 2017 STMicroelectronics.
26
+ * All rights reserved.
27
27
*
28
- * This software component is licensed by ST under BSD 3-Clause license,
29
- * the "License"; You may not use this file except in compliance with the
30
- * License. You may obtain a copy of the License at:
31
- * opensource.org/licenses/BSD-3-Clause
28
+ * This software is licensed under terms that can be found in the LICENSE file
29
+ * in the root directory of this software component.
30
+ * If no LICENSE file comes with this software, it is provided AS-IS.
32
31
*
33
32
******************************************************************************
34
33
*/
74
73
#ifndef VECT_TAB_OFFSET
75
74
#define VECT_TAB_OFFSET 0x00000000UL /*!< Vector Table base offset field.
76
75
This value must be a multiple of 0x200. */
76
+ #else
77
+
78
+ #define USER_VECT_TAB_ADDRESS
79
+
77
80
#endif
81
+
82
+ /* Note: Following vector table addresses must be defined in line with linker
83
+ configuration. */
84
+ /*!< Define USER_VECT_TAB_ADDRESS if you need to relocate the vector table
85
+
86
+ anywhere in Flash or Sram, else the vector table is kept at the automatic
87
+
88
+ remap of boot address selected */
89
+ #if defined(USER_VECT_TAB_ADDRESS )
90
+ #if defined(DUAL_CORE ) && defined(CORE_CM4 )
91
+ /*!< Define VECT_TAB_SRAM if you need to relocate your vector Table
92
+
93
+ in Sram else user remap will be done in Flash. */
94
+ #if defined(VECT_TAB_SRAM )
95
+ #define VECT_TAB_BASE_ADDRESS D2_AXISRAM_BASE /*!< Vector Table base address field.
96
+ This value must be a multiple of 0x200. */
97
+ #else
98
+ #define VECT_TAB_BASE_ADDRESS FLASH_BANK2_BASE /*!< Vector Table base address field.
99
+ This value must be a multiple of 0x200. */
100
+ #endif /* VECT_TAB_SRAM */
101
+ #else
102
+ /*!< Define VECT_TAB_SRAM if you need to relocate your vector Table
103
+
104
+ in Sram else user remap will be done in Flash. */
105
+ #if defined(VECT_TAB_SRAM )
106
+ #define VECT_TAB_BASE_ADDRESS D1_AXISRAM_BASE /*!< Vector Table base address field.
107
+ This value must be a multiple of 0x200. */
108
+ #else
109
+ #define VECT_TAB_BASE_ADDRESS FLASH_BANK1_BASE /*!< Vector Table base address field.
110
+ This value must be a multiple of 0x200. */
111
+ #endif /* VECT_TAB_SRAM */
112
+ #endif /* DUAL_CORE && CORE_CM4 */
113
+ #endif /* USER_VECT_TAB_ADDRESS */
114
+
78
115
/******************************************************************************/
79
116
80
117
/**
@@ -235,11 +272,9 @@ void SystemInit (void)
235
272
236
273
#if defined(DUAL_CORE ) && defined(CORE_CM4 )
237
274
/* Configure the Vector Table location add offset address for cortex-M4 ------------------*/
238
- #ifdef VECT_TAB_SRAM
239
- SCB -> VTOR = D2_AXISRAM_BASE | VECT_TAB_OFFSET ; /* Vector Table Relocation in Internal SRAM */
240
- #else
241
- SCB -> VTOR = FLASH_BANK2_BASE | VECT_TAB_OFFSET ; /* Vector Table Relocation in Internal FLASH */
242
- #endif /* VECT_TAB_SRAM */
275
+ #if defined(USER_VECT_TAB_ADDRESS )
276
+ SCB -> VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET ; /* Vector Table Relocation in Internal D2 AXI-RAM or in Internal FLASH */
277
+ #endif /* USER_VECT_TAB_ADDRESS */
243
278
244
279
#else
245
280
@@ -251,11 +286,9 @@ void SystemInit (void)
251
286
FMC_Bank1_R -> BTCR [0 ] = 0x000030D2 ;
252
287
253
288
/* Configure the Vector Table location add offset address for cortex-M7 ------------------*/
254
- #ifdef VECT_TAB_SRAM
255
- SCB -> VTOR = D1_AXISRAM_BASE | VECT_TAB_OFFSET ; /* Vector Table Relocation in Internal AXI-RAM */
256
- #else
257
- SCB -> VTOR = FLASH_BANK1_BASE | VECT_TAB_OFFSET ; /* Vector Table Relocation in Internal FLASH */
258
- #endif
289
+ #if defined(USER_VECT_TAB_ADDRESS )
290
+ SCB -> VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET ; /* Vector Table Relocation in Internal D1 AXI-RAM or in Internal FLASH */
291
+ #endif /* USER_VECT_TAB_ADDRESS */
259
292
260
293
#endif /*DUAL_CORE && CORE_CM4*/
261
294
@@ -407,4 +440,3 @@ void SystemCoreClockUpdate (void)
407
440
/**
408
441
* @}
409
442
*/
410
- /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
0 commit comments