|
93 | 93 | */
|
94 | 94 |
|
95 | 95 | /************************* Miscellaneous Configuration ************************/
|
96 |
| -#ifndef VECT_TAB_OFFSET |
97 |
| -#define VECT_TAB_OFFSET 0x00000000U /*!< Vector Table base offset field. |
98 |
| - This value must be a multiple of 0x200. */ |
99 |
| -#else |
100 |
| -#define USER_VECT_TAB_ADDRESS |
101 |
| -#endif |
102 |
| - |
103 | 96 | /* Note: Following vector table addresses must be defined in line with linker
|
104 | 97 | configuration. */
|
105 |
| -/*!< Uncomment the following line if you need to relocate the vector table |
106 |
| - anywhere in Flash or Sram, else the vector table is kept at the automatic |
107 |
| - remap of boot address selected */ |
108 |
| -/* #define USER_VECT_TAB_ADDRESS */ |
109 | 98 |
|
110 |
| -#if defined(USER_VECT_TAB_ADDRESS) |
| 99 | +/*!< Uncomment the following line and change the address |
| 100 | + if you need to relocate your vector Table at a custom base address (+ VECT_TAB_OFFSET) */ |
| 101 | +/* #define VECT_TAB_BASE_ADDRESS 0x08000000 */ |
| 102 | + |
111 | 103 | /*!< Uncomment the following line if you need to relocate your vector Table
|
112 |
| - in Sram else user remap will be done in Flash. */ |
| 104 | + in Sram else user remap will be done by default in Flash. */ |
113 | 105 | /* #define VECT_TAB_SRAM */
|
| 106 | + |
| 107 | +#ifndef VECT_TAB_OFFSET |
| 108 | +#define VECT_TAB_OFFSET 0x00000000U /*!< Vector Table base offset field. |
| 109 | + This value must be a multiple of 0x100. */ |
| 110 | +#endif |
| 111 | + |
| 112 | +#ifndef VECT_TAB_BASE_ADDRESS |
114 | 113 | #if defined(VECT_TAB_SRAM)
|
115 | 114 | #define VECT_TAB_BASE_ADDRESS SRAM_BASE /*!< Vector Table base address field.
|
116 |
| - This value must be a multiple of 0x200. */ |
| 115 | + This value must be a multiple of 0x100. */ |
117 | 116 | #else
|
118 | 117 | #define VECT_TAB_BASE_ADDRESS FLASH_BASE /*!< Vector Table base address field.
|
119 |
| - This value must be a multiple of 0x200. */ |
| 118 | + This value must be a multiple of 0x100. */ |
120 | 119 | #endif /* VECT_TAB_SRAM */
|
121 |
| -#endif /* USER_VECT_TAB_ADDRESS */ |
| 120 | +#endif /* VECT_TAB_BASE_ADDRESS */ |
| 121 | + |
| 122 | + |
122 | 123 | /******************************************************************************/
|
123 | 124 | /**
|
124 | 125 | * @}
|
@@ -197,9 +198,7 @@ void SystemInit(void)
|
197 | 198 | #endif
|
198 | 199 |
|
199 | 200 | /* Configure the Vector Table location -------------------------------------*/
|
200 |
| -#if defined(USER_VECT_TAB_ADDRESS) |
201 |
| - SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET; /* Vector Table Relocation */ |
202 |
| -#endif /* USER_VECT_TAB_ADDRESS */ |
| 201 | + SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET; |
203 | 202 | }
|
204 | 203 |
|
205 | 204 | /**
|
|
0 commit comments