|
65 | 65 |
|
66 | 66 | /************************* Miscellaneous Configuration ************************/
|
67 | 67 |
|
68 |
| -/*!< Uncomment the following line if you need to relocate your vector Table in |
69 |
| - Internal SRAM. */ |
70 |
| -/* #define VECT_TAB_SRAM */ |
| 68 | + |
71 | 69 | #ifndef VECT_TAB_OFFSET
|
72 |
| -#define VECT_TAB_OFFSET 0x00 /*!< Vector Table base offset field. |
73 |
| - This value must be a multiple of 0x200. */ |
| 70 | +#define VECT_TAB_OFFSET 0x00000000U /*!< Vector Table base offset field. |
| 71 | + This value must be a multiple of 0x200. */ |
| 72 | +#else |
| 73 | +#define USER_VECT_TAB_ADDRESS |
74 | 74 | #endif
|
| 75 | + |
| 76 | +/* Note: Following vector table addresses must be defined in line with linker |
| 77 | + configuration. */ |
| 78 | +/*!< Define USER_VECT_TAB_ADDRESS line if you need to relocate the vector table |
| 79 | + anywhere in Flash or Sram, else the vector table is kept at the automatic |
| 80 | + remap of boot address selected */ |
| 81 | +#if defined(USER_VECT_TAB_ADDRESS) |
| 82 | +/*!< Define VECT_TAB_SRAM if you need to relocate your vector Table |
| 83 | + in Sram else user remap will be done in Flash. */ |
| 84 | +#if defined(VECT_TAB_SRAM) |
| 85 | +#define VECT_TAB_BASE_ADDRESS RAMDTCM_BASE /*!< Vector Table base address field. |
| 86 | + This value must be a multiple of 0x200. */ |
| 87 | +#else |
| 88 | +#define VECT_TAB_BASE_ADDRESS FLASH_BASE /*!< Vector Table base address field. |
| 89 | + This value must be a multiple of 0x200. */ |
| 90 | +#endif /* VECT_TAB_SRAM */ |
| 91 | +#endif /* USER_VECT_TAB_ADDRESS */ |
75 | 92 | /******************************************************************************/
|
76 | 93 |
|
77 | 94 | /**
|
@@ -150,12 +167,11 @@ void SystemInit(void)
|
150 | 167 | /* Disable all interrupts */
|
151 | 168 | RCC->CIR = 0x00000000;
|
152 | 169 |
|
153 |
| - /* Configure the Vector Table location add offset address ------------------*/ |
154 |
| -#ifdef VECT_TAB_SRAM |
155 |
| - SCB->VTOR = RAMDTCM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */ |
156 |
| -#else |
157 |
| - SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */ |
158 |
| -#endif |
| 170 | + |
| 171 | + /* Configure the Vector Table location -------------------------------------*/ |
| 172 | +#if defined(USER_VECT_TAB_ADDRESS) |
| 173 | + SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */ |
| 174 | +#endif /* USER_VECT_TAB_ADDRESS */ |
159 | 175 | }
|
160 | 176 |
|
161 | 177 | /**
|
|
0 commit comments