|
64 | 64 | */
|
65 | 65 | /************************* Miscellaneous Configuration ************************/
|
66 | 66 |
|
67 |
| -/*!< Uncomment the following line if you need to relocate your vector Table in |
68 |
| - Internal SRAM. */ |
69 |
| -/* #define VECT_TAB_SRAM */ |
70 | 67 | #ifndef VECT_TAB_OFFSET
|
71 | 68 | #define VECT_TAB_OFFSET 0x00U /*!< Vector Table base offset field.
|
72 | 69 | This value must be a multiple of 0x100. */
|
| 70 | +#else |
| 71 | +define USER_VECT_TAB_ADDRESS |
73 | 72 | #endif
|
| 73 | + |
| 74 | +/* Note: Following vector table addresses must be defined in line with linker |
| 75 | + configuration. */ |
| 76 | +/*!< Uncomment the following line if you need to relocate the vector table |
| 77 | + anywhere in Flash or Sram, else the vector table is kept at the automatic |
| 78 | + remap of boot address selected */ |
| 79 | +/* #define USER_VECT_TAB_ADDRESS */ |
| 80 | + |
| 81 | +#if defined(USER_VECT_TAB_ADDRESS) |
| 82 | +/*!< Uncomment the following line if you need to relocate your vector Table |
| 83 | + in Sram else user remap will be done in Flash. */ |
| 84 | +/* #define VECT_TAB_SRAM */ |
| 85 | +#if defined(VECT_TAB_SRAM) |
| 86 | +#define VECT_TAB_BASE_ADDRESS SRAM_BASE /*!< Vector Table base address field. |
| 87 | + This value must be a multiple of 0x200. */ |
| 88 | +#else |
| 89 | +#define VECT_TAB_BASE_ADDRESS FLASH_BASE /*!< Vector Table base address field. |
| 90 | + This value must be a multiple of 0x200. */ |
| 91 | +#endif /* VECT_TAB_SRAM */ |
| 92 | +#endif /* USER_VECT_TAB_ADDRESS */ |
| 93 | + |
74 | 94 | /******************************************************************************/
|
75 | 95 | /**
|
76 | 96 | * @}
|
@@ -145,15 +165,13 @@ void SystemInit (void)
|
145 | 165 | RCC->CIER = 0x00000000U;
|
146 | 166 |
|
147 | 167 | /* Configure the Vector Table location add offset address ------------------*/
|
148 |
| -#ifdef VECT_TAB_SRAM |
149 |
| - SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */ |
150 |
| -#else |
151 |
| - SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */ |
152 |
| -#endif |
| 168 | +#if defined (USER_VECT_TAB_ADDRESS) |
| 169 | + SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */ |
| 170 | +#endif /* USER_VECT_TAB_ADDRESS */ |
153 | 171 | }
|
154 | 172 |
|
155 | 173 | /**
|
156 |
| - * @brief Update SystemCoreClock according to Clock Register Values |
| 174 | + * @brief Update SystemCoreClock variable according to Clock Register Values. |
157 | 175 | * The SystemCoreClock variable contains the core clock (HCLK), it can
|
158 | 176 | * be used by the user application to setup the SysTick timer or configure
|
159 | 177 | * other parameters.
|
|
0 commit comments