|
95 | 95 | */
|
96 | 96 |
|
97 | 97 | /************************* Miscellaneous Configuration ************************/
|
98 |
| -/*!< Uncomment the following line if you need to relocate your vector Table in |
99 |
| - Internal SRAM. */ |
100 |
| -/* #define VECT_TAB_SRAM */ |
101 | 98 | #ifndef VECT_TAB_OFFSET
|
102 |
| -#define VECT_TAB_OFFSET 0x00UL /*!< Vector Table base offset field. |
103 |
| - This value must be a multiple of 0x200. */ |
| 99 | +#define VECT_TAB_OFFSET 0x00000000U /*!< Vector Table base offset field. |
| 100 | + This value must be a multiple of 0x200. */ |
| 101 | +#else |
| 102 | +#define USER_VECT_TAB_ADDRESS |
104 | 103 | #endif
|
| 104 | + |
| 105 | +/* Note: Following vector table addresses must be defined in line with linker |
| 106 | + configuration. */ |
| 107 | +/*!< Uncomment the following line if you need to relocate the vector table |
| 108 | + anywhere in Flash or Sram, else the vector table is kept at the automatic |
| 109 | + remap of boot address selected */ |
| 110 | + |
| 111 | +#if defined(USER_VECT_TAB_ADDRESS) |
| 112 | +/*!< Uncomment the following line if you need to relocate your vector Table |
| 113 | + in Sram else user remap will be done in Flash. */ |
| 114 | +/* #define VECT_TAB_SRAM */ |
| 115 | +#if defined(VECT_TAB_SRAM) |
| 116 | +#define VECT_TAB_BASE_ADDRESS SRAM_BASE /*!< Vector Table base address field. |
| 117 | + This value must be a multiple of 0x200. */ |
| 118 | +#else |
| 119 | +#define VECT_TAB_BASE_ADDRESS FLASH_BASE /*!< Vector Table base address field. |
| 120 | + This value must be a multiple of 0x200. */ |
| 121 | +#endif /* VECT_TAB_SRAM */ |
| 122 | +#endif /* USER_VECT_TAB_ADDRESS */ |
105 | 123 | /******************************************************************************/
|
106 | 124 | /**
|
107 | 125 | * @}
|
@@ -161,11 +179,9 @@ void SystemInit(void)
|
161 | 179 | #endif
|
162 | 180 |
|
163 | 181 | /* Configure the Vector Table location add offset address ------------------*/
|
164 |
| -#ifdef VECT_TAB_SRAM |
165 |
| - SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */ |
166 |
| -#else |
167 |
| - SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */ |
168 |
| -#endif |
| 182 | +#if defined(USER_VECT_TAB_ADDRESS) |
| 183 | + SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */ |
| 184 | +#endif /* USER_VECT_TAB_ADDRESS */ |
169 | 185 | }
|
170 | 186 |
|
171 | 187 | /**
|
|
0 commit comments