|
53 | 53 | ******************************************************************************
|
54 | 54 | * @attention
|
55 | 55 | *
|
56 |
| - * <h2><center>© Copyright (c) 2018 STMicroelectronics. |
57 |
| - * All rights reserved.</center></h2> |
| 56 | + * Copyright (c) 2018-2021 STMicroelectronics. |
| 57 | + * All rights reserved. |
58 | 58 | *
|
59 |
| - * This software component is licensed by ST under Apache License, Version 2.0, |
60 |
| - * the "License"; You may not use this file except in compliance with the |
61 |
| - * License. You may obtain a copy of the License at: |
62 |
| - * opensource.org/licenses/Apache-2.0 |
| 59 | + * This software is licensed under terms that can be found in the LICENSE file |
| 60 | + * in the root directory of this software component. |
| 61 | + * If no LICENSE file comes with this software, it is provided AS-IS. |
63 | 62 | *
|
64 | 63 | ******************************************************************************
|
65 | 64 | */
|
66 |
| - |
67 | 65 | /** @addtogroup CMSIS
|
68 | 66 | * @{
|
69 | 67 | */
|
|
95 | 93 | */
|
96 | 94 |
|
97 | 95 | /************************* 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 | 96 | #ifndef VECT_TAB_OFFSET
|
102 |
| -#define VECT_TAB_OFFSET 0x0U /*!< Vector Table base offset field. |
103 |
| - This value must be a multiple of 0x100. */ |
| 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 |
104 | 101 | #endif
|
| 102 | + |
| 103 | +/* Note: Following vector table addresses must be defined in line with linker |
| 104 | + 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 | + |
| 110 | +#if defined(USER_VECT_TAB_ADDRESS) |
| 111 | +/*!< Uncomment the following line if you need to relocate your vector Table |
| 112 | + in Sram else user remap will be done in Flash. */ |
| 113 | +/* #define VECT_TAB_SRAM */ |
| 114 | +#if defined(VECT_TAB_SRAM) |
| 115 | +#define VECT_TAB_BASE_ADDRESS SRAM_BASE /*!< Vector Table base address field. |
| 116 | + This value must be a multiple of 0x200. */ |
| 117 | +#else |
| 118 | +#define VECT_TAB_BASE_ADDRESS FLASH_BASE /*!< Vector Table base address field. |
| 119 | + This value must be a multiple of 0x200. */ |
| 120 | +#endif /* VECT_TAB_SRAM */ |
| 121 | +#endif /* USER_VECT_TAB_ADDRESS */ |
105 | 122 | /******************************************************************************/
|
106 | 123 | /**
|
107 | 124 | * @}
|
|
154 | 171 | */
|
155 | 172 | void SystemInit(void)
|
156 | 173 | {
|
157 |
| - /* Configure the Vector Table location add offset address ------------------*/ |
158 |
| -#ifdef VECT_TAB_SRAM |
159 |
| - SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */ |
160 |
| -#else |
161 |
| - SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */ |
162 |
| -#endif |
| 174 | + /* Configure the Vector Table location -------------------------------------*/ |
| 175 | +#if defined(USER_VECT_TAB_ADDRESS) |
| 176 | + SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET; /* Vector Table Relocation */ |
| 177 | +#endif /* USER_VECT_TAB_ADDRESS */ |
163 | 178 | }
|
164 | 179 |
|
165 | 180 | /**
|
|
0 commit comments