Skip to content

Commit 6f70b87

Browse files
authored
Merge pull request #1339 from fpistm/updateG4
Update STM32G4 HAL and CMSIS drivers
2 parents 5ad0fe8 + ebceb0b commit 6f70b87

File tree

110 files changed

+6082
-3538
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+6082
-3538
lines changed

libraries/SrcWrapper/src/HAL/stm32yyxx_hal_smbus_ex.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#ifdef STM32G4xx
2+
#include "stm32g4xx_hal_smbus_ex.c"
3+
#endif
14
#ifdef STM32L0xx
25
#include "stm32l0xx_hal_smbus_ex.c"
36
#endif

system/Drivers/CMSIS/Device/ST/STM32G4xx/Include/stm32g471xx.h

Lines changed: 223 additions & 0 deletions
Large diffs are not rendered by default.

system/Drivers/CMSIS/Device/ST/STM32G4xx/Include/stm32g474xx.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1120,7 +1120,6 @@ typedef struct
11201120
typedef struct {
11211121
HRTIM_Master_TypeDef sMasterRegs;
11221122
HRTIM_Timerx_TypeDef sTimerxRegs[6];
1123-
// uint32_t RESERVED0[32];
11241123
HRTIM_Common_TypeDef sCommonRegs;
11251124
}HRTIM_TypeDef;
11261125

system/Drivers/CMSIS/Device/ST/STM32G4xx/Include/stm32g484xx.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1152,7 +1152,6 @@ typedef struct
11521152
typedef struct {
11531153
HRTIM_Master_TypeDef sMasterRegs;
11541154
HRTIM_Timerx_TypeDef sTimerxRegs[6];
1155-
// uint32_t RESERVED0[32];
11561155
HRTIM_Common_TypeDef sCommonRegs;
11571156
}HRTIM_TypeDef;
11581157

system/Drivers/CMSIS/Device/ST/STM32G4xx/Include/stm32g4xx.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@
8585
#endif /* USE_HAL_DRIVER */
8686

8787
/**
88-
* @brief CMSIS Device version number V1.2.0
88+
* @brief CMSIS Device version number V1.2.1
8989
*/
9090
#define __STM32G4_CMSIS_VERSION_MAIN (0x01U) /*!< [31:24] main version */
9191
#define __STM32G4_CMSIS_VERSION_SUB1 (0x02U) /*!< [23:16] sub1 version */
92-
#define __STM32G4_CMSIS_VERSION_SUB2 (0x00U) /*!< [15:8] sub2 version */
92+
#define __STM32G4_CMSIS_VERSION_SUB2 (0x01U) /*!< [15:8] sub2 version */
9393
#define __STM32G4_CMSIS_VERSION_RC (0x00U) /*!< [7:0] release candidate */
9494
#define __STM32G4_CMSIS_VERSION ((__STM32G4_CMSIS_VERSION_MAIN << 24)\
9595
|(__STM32G4_CMSIS_VERSION_SUB1 << 16)\

system/Drivers/CMSIS/Device/ST/STM32G4xx/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Tag v1.0.0 | Tag v5.4.0_cm4 | Tag v1.0.0
3333
Tag v1.1.0 | Tag v5.4.0_cm4 | Tag v1.1.0
3434
Tag v1.1.1 | Tag v5.4.0_cm4 | Tag v1.2.0
3535
Tag v1.2.0 | Tag v5.6.0_cm4 | Tag v1.3.0
36+
Tag v1.2.1 | Tag v5.6.0_cm4 | Tag v1.4.0
3637

3738
The full **STM32CubeG4** MCU package is available [here](https://github.com/STMicroelectronics/STM32CubeG4).
3839

system/Drivers/CMSIS/Device/ST/STM32G4xx/Release_Notes.html

Lines changed: 74 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,11 @@ <h1 id="purpose">Purpose</h1>
5151
<div class="col-sm-12 col-lg-8">
5252
<h1 id="update-history">Update History</h1>
5353
<div class="collapse">
54-
<input type="checkbox" id="collapse-section4" checked aria-hidden="true"> <label for="collapse-section4" aria-hidden="true">V1.2.0 / 26-June-2020</label>
54+
<input type="checkbox" id="collapse-section1_2_1" aria-hidden="true"> <label for="collapse-section1_2_1" aria-hidden="true">V1.2.1 / 11-January-2021</label>
5555
<div>
5656
<h2 id="main-changes">Main Changes</h2>
5757
<h3 id="maintenance-release">Maintenance release</h3>
5858
<ul>
59-
<li>Add support for STM32G491xx and STM32G4A1 devices</li>
6059
<li>General updates to fix known defects and enhancements implementation</li>
6160
</ul>
6261
<h2 id="contents">Contents</h2>
@@ -70,35 +69,76 @@ <h2 id="contents">Contents</h2>
7069
</thead>
7170
<tbody>
7271
<tr class="odd">
73-
<td>- Add startup files for STM32G491xx/4A1xx devices</td>
72+
<td>- General updates to fix known defects and enhancements implementation.</td>
7473
</tr>
7574
<tr class="even">
76-
<td>- Rename <strong>“TIM7_DAC_IRQHandler”</strong> to <strong>“TIM7_IRQHandler”</strong> in MDK-ARM startup file for STM32G431xx/441xx/bk1cb devices</td>
75+
<td>- Protect Vector table modification following SRAM or FLASH preprocessor directive by a generic preprocessor directive: USER_VECT_TAB_ADDRESS.</td>
7776
</tr>
77+
</tbody>
78+
</table>
79+
<p>: Fixed bugs list<br />
80+
</p>
81+
<h2 id="known-limitations">Known Limitations</h2>
82+
<h2 id="development-toolchains-and-compilers">Development Toolchains and Compilers</h2>
83+
<ul>
84+
<li>IAR Embedded Workbench for ARM (EWARM) toolchain <strong>V8.50.4</strong> + ST-Link</li>
85+
<li>RealView Microcontroller Development Kit (MDK-ARM) toolchain <strong>V5.31</strong> + ST-Link</li>
86+
<li>CubeIDE toolchain <strong>V1.6.0</strong></li>
87+
</ul>
88+
<h2 id="supported-devices-and-boards">Supported Devices and boards</h2>
89+
<ul>
90+
<li>STM32G431xx, STM32G441xx devices</li>
91+
<li>STM32G471xx devices</li>
92+
<li>STM32G473xx, STM32G483xx devices</li>
93+
<li>STM32G474xx, STM32G484xx devices</li>
94+
<li>STM32G491xx, STM32G4A1xx devices</li>
95+
</ul>
96+
<p>Note: in the section above, main changes are highlighted in <strong>bold</strong> since previous release.</p>
97+
</div>
98+
</div>
99+
<div class="collapse">
100+
<input type="checkbox" id="collapse-section1_2_0" aria-hidden="true"> <label for="collapse-section1_2_0" aria-hidden="true">V1.2.0 / 26-June-2020</label>
101+
<div>
102+
<h2 id="main-changes-1">Main Changes</h2>
103+
<h3 id="maintenance-release-1">Maintenance release</h3>
104+
<ul>
105+
<li>Add support for STM32G491xx and STM32G4A1 devices</li>
106+
<li>General updates to fix known defects and enhancements implementation</li>
107+
</ul>
108+
<h2 id="contents-1">Contents</h2>
109+
<table>
110+
<caption>Additional features<br />
111+
</caption>
112+
<thead>
113+
<tr class="header">
114+
<th>Headline</th>
115+
</tr>
116+
</thead>
117+
<tbody>
78118
<tr class="odd">
79-
<td>- Remove HRTIM_BMTRGR useless constant definitions</td>
119+
<td>- Add startup files for STM32G491xx/4A1xx devices</td>
80120
</tr>
81121
<tr class="even">
82-
<td>- Remove ADC_CFGR2_LFTRIG useless constant definitions</td>
122+
<td>- Rename <strong>“TIM7_DAC_IRQHandler”</strong> to <strong>“TIM7_IRQHandler”</strong> in MDK-ARM startup file for STM32G431xx/441xx/bk1cb devices</td>
83123
</tr>
84124
<tr class="odd">
85-
<td>- Update HSE default value in system_stm32g4xx.c: 24MHz instead of 8MHz</td>
125+
<td>- Remove HRTIM_BMTRGR useless constant definitions</td>
86126
</tr>
87127
<tr class="even">
88-
<td>- Add License.md and Readme.md files required for GitHub publication</td>
128+
<td>- Remove ADC_CFGR2_LFTRIG useless constant definitions</td>
89129
</tr>
90130
</tbody>
91131
</table>
92132
<p>: Fixed bugs list<br />
93133
</p>
94-
<h2 id="known-limitations">Known Limitations</h2>
95-
<h2 id="development-toolchains-and-compilers">Development Toolchains and Compilers</h2>
134+
<h2 id="known-limitations-1">Known Limitations</h2>
135+
<h2 id="development-toolchains-and-compilers-1">Development Toolchains and Compilers</h2>
96136
<ul>
97137
<li>IAR Embedded Workbench for ARM (EWARM) toolchain <strong>V8.40.1</strong></li>
98-
<li>RealView Microcontroller Development Kit (MDK-ARM) toolchain V5.29</li>
99-
<li>STM32CubeIDE toolchain V1.4.0</li>
138+
<li>RealView Microcontroller Development Kit (MDK-ARM) toolchain V5.27.1</li>
139+
<li>STM32CubeIDE toolchain V1.3.0</li>
100140
</ul>
101-
<h2 id="supported-devices-and-boards">Supported Devices and boards</h2>
141+
<h2 id="supported-devices-and-boards-1">Supported Devices and boards</h2>
102142
<ul>
103143
<li>STM32G431xx, STM32G441xx devices</li>
104144
<li>STM32G471xx devices</li>
@@ -110,12 +150,12 @@ <h2 id="supported-devices-and-boards">Supported Devices and boards</h2>
110150
</div>
111151
</div>
112152
<div class="collapse">
113-
<input type="checkbox" id="collapse-section3" checked aria-hidden="true"> <label for="collapse-section3" aria-hidden="true">V1.1.1 / 14-February-2020</label>
153+
<input type="checkbox" id="collapse-section1_1_1" aria-hidden="true"> <label for="collapse-section1_1_1" aria-hidden="true">V1.1.1 / 14-February-2020</label>
114154
<div>
115-
<h2 id="main-changes-1">Main Changes</h2>
116-
<h3 id="maintenance-release-1">Maintenance release</h3>
155+
<h2 id="main-changes-2">Main Changes</h2>
156+
<h3 id="maintenance-release-2">Maintenance release</h3>
117157
<p>General updates to fix known defects and enhancements implementation</p>
118-
<h2 id="contents-1">Contents</h2>
158+
<h2 id="contents-2">Contents</h2>
119159
<table>
120160
<caption>Additional features<br />
121161
</caption>
@@ -140,21 +180,21 @@ <h2 id="contents-1">Contents</h2>
140180
</thead>
141181
<tbody>
142182
<tr class="odd">
143-
<td>Update STM32G473/483 startup files to support FDCAN2/3 instances</td>
183+
<td>Update STM32G473/483 startup files to support FDCAN2/3 intances</td>
144184
</tr>
145185
<tr class="even">
146186
<td>Remove IS_TIM_SYNCHRO_INSTANCE macro from device header files</td>
147187
</tr>
148188
</tbody>
149189
</table>
150-
<h2 id="known-limitations-1">Known Limitations</h2>
151-
<h2 id="development-toolchains-and-compilers-1">Development Toolchains and Compilers</h2>
190+
<h2 id="known-limitations-2">Known Limitations</h2>
191+
<h2 id="development-toolchains-and-compilers-2">Development Toolchains and Compilers</h2>
152192
<ul>
153193
<li>IAR Embedded Workbench for ARM (EWARM) toolchain V8.32.3</li>
154194
<li>RealView Microcontroller Development Kit (MDK-ARM) toolchain V5.27.1</li>
155195
<li>STM32CubeIDE toolchain V1.3.0</li>
156196
</ul>
157-
<h2 id="supported-devices-and-boards-1">Supported Devices and boards</h2>
197+
<h2 id="supported-devices-and-boards-2">Supported Devices and boards</h2>
158198
<ul>
159199
<li>STM32G431xx, STM32G441xx devices</li>
160200
<li>STM32G471xx devices</li>
@@ -165,12 +205,12 @@ <h2 id="supported-devices-and-boards-1">Supported Devices and boards</h2>
165205
</div>
166206
</div>
167207
<div class="collapse">
168-
<input type="checkbox" id="collapse-section2" checked aria-hidden="true"> <label for="collapse-section2" aria-hidden="true">V1.1.0 / 28-June-2019</label>
208+
<input type="checkbox" id="collapse-section1_1_0" aria-hidden="true"> <label for="collapse-section1_1_0" aria-hidden="true">V1.1.0 / 28-June-2019</label>
169209
<div>
170-
<h2 id="main-changes-2">Main Changes</h2>
171-
<h3 id="maintenance-release-2">Maintenance release</h3>
210+
<h2 id="main-changes-3">Main Changes</h2>
211+
<h3 id="maintenance-release-3">Maintenance release</h3>
172212
<p>Maintenance release of CMSIS Devices drivers supporting STM32G431xx, STM32G441xx, STM32G471xx, STM32G473xx, <strong>STM32G483xx</strong>, STM32G474xx and STM32G484xx devices</p>
173-
<h2 id="contents-2">Contents</h2>
213+
<h2 id="contents-3">Contents</h2>
174214
<table>
175215
<caption>Additional features<br />
176216
</caption>
@@ -211,14 +251,14 @@ <h2 id="contents-2">Contents</h2>
211251
</tr>
212252
</tbody>
213253
</table>
214-
<h2 id="known-limitations-2">Known Limitations</h2>
215-
<h2 id="development-toolchains-and-compilers-2">Development Toolchains and Compilers</h2>
254+
<h2 id="known-limitations-3">Known Limitations</h2>
255+
<h2 id="development-toolchains-and-compilers-3">Development Toolchains and Compilers</h2>
216256
<ul>
217257
<li>IAR Embedded Workbench for ARM (EWARM) toolchain V8.20.2</li>
218258
<li>RealView Microcontroller Development Kit (MDK-ARM) toolchain V5.25</li>
219259
<li>System Workbench STM32 (SW4STM32) toolchain V2.7.2</li>
220260
</ul>
221-
<h2 id="supported-devices-and-boards-2">Supported Devices and boards</h2>
261+
<h2 id="supported-devices-and-boards-3">Supported Devices and boards</h2>
222262
<ul>
223263
<li>STM32G431xx, STM32G441xx devices</li>
224264
<li>STM32G471xx devices</li>
@@ -229,14 +269,14 @@ <h2 id="supported-devices-and-boards-2">Supported Devices and boards</h2>
229269
</div>
230270
</div>
231271
<div class="collapse">
232-
<input type="checkbox" id="collapse-section1" aria-hidden="true"> <label for="collapse-section4" aria-hidden="true">V1.0.0 / 12-April-2019</label>
272+
<input type="checkbox" id="collapse-section1_0_0" aria-hidden="true"> <label for="collapse-section1_0_0" aria-hidden="true">V1.0.0 / 12-April-2019</label>
233273
<div>
234-
<h2 id="main-changes-3">Main Changes</h2>
274+
<h2 id="main-changes-4">Main Changes</h2>
235275
<h3 id="first-release">First release</h3>
236276
<p>First official release for STM32G4xx devices</p>
237-
<h2 id="contents-3">Contents</h2>
277+
<h2 id="contents-4">Contents</h2>
238278
<p>CMSIS devices files for STM32G431xx, STM32G441xx, STM32G471xx, STM32G473xx, STM32G474xx and STM32G484xx.</p>
239-
<h2 id="known-limitations-3">Known Limitations</h2>
279+
<h2 id="known-limitations-4">Known Limitations</h2>
240280
<table>
241281
<thead>
242282
<tr class="header">
@@ -249,13 +289,13 @@ <h2 id="known-limitations-3">Known Limitations</h2>
249289
</tr>
250290
</tbody>
251291
</table>
252-
<h2 id="development-toolchains-and-compilers-3">Development Toolchains and Compilers</h2>
292+
<h2 id="development-toolchains-and-compilers-4">Development Toolchains and Compilers</h2>
253293
<ul>
254294
<li>IAR Embedded Workbench for ARM (EWARM) toolchain V8.20.2</li>
255295
<li>RealView Microcontroller Development Kit (MDK-ARM) toolchain V5.25</li>
256296
<li>System Workbench STM32 (SW4STM32) toolchain V2.7.2</li>
257297
</ul>
258-
<h2 id="supported-devices-and-boards-3">Supported Devices and boards</h2>
298+
<h2 id="supported-devices-and-boards-4">Supported Devices and boards</h2>
259299
<ul>
260300
<li>STM32G431xx, STM32G441xx devices</li>
261301
<li>STM32G471xx devices</li>

system/Drivers/CMSIS/Device/ST/STM32G4xx/Source/Templates/gcc/startup_stm32g431xx.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ LoopFillZerobss:
9494
cmp r2, r4
9595
bcc FillZerobss
9696

97-
/* Call the clock system initialization function.*/
97+
/* Call the clock system intitialization function.*/
9898
bl SystemInit
9999
/* Call static constructors */
100100
bl __libc_init_array

system/Drivers/CMSIS/Device/ST/STM32G4xx/Source/Templates/gcc/startup_stm32g441xx.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ LoopFillZerobss:
9494
cmp r2, r4
9595
bcc FillZerobss
9696

97-
/* Call the clock system initialization function.*/
97+
/* Call the clock system intitialization function.*/
9898
bl SystemInit
9999
/* Call static constructors */
100100
bl __libc_init_array

system/Drivers/CMSIS/Device/ST/STM32G4xx/Source/Templates/gcc/startup_stm32g471xx.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ LoopFillZerobss:
9494
cmp r2, r4
9595
bcc FillZerobss
9696

97-
/* Call the clock system initialization function.*/
97+
/* Call the clock system intitialization function.*/
9898
bl SystemInit
9999
/* Call static constructors */
100100
bl __libc_init_array

system/Drivers/CMSIS/Device/ST/STM32G4xx/Source/Templates/gcc/startup_stm32g473xx.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ LoopFillZerobss:
9494
cmp r2, r4
9595
bcc FillZerobss
9696

97-
/* Call the clock system initialization function.*/
97+
/* Call the clock system intitialization function.*/
9898
bl SystemInit
9999
/* Call static constructors */
100100
bl __libc_init_array

system/Drivers/CMSIS/Device/ST/STM32G4xx/Source/Templates/gcc/startup_stm32g474xx.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ LoopFillZerobss:
9494
cmp r2, r4
9595
bcc FillZerobss
9696

97-
/* Call the clock system initialization function.*/
97+
/* Call the clock system intitialization function.*/
9898
bl SystemInit
9999
/* Call static constructors */
100100
bl __libc_init_array

system/Drivers/CMSIS/Device/ST/STM32G4xx/Source/Templates/gcc/startup_stm32g483xx.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ LoopFillZerobss:
9494
cmp r2, r4
9595
bcc FillZerobss
9696

97-
/* Call the clock system initialization function.*/
97+
/* Call the clock system intitialization function.*/
9898
bl SystemInit
9999
/* Call static constructors */
100100
bl __libc_init_array

system/Drivers/CMSIS/Device/ST/STM32G4xx/Source/Templates/gcc/startup_stm32g484xx.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ LoopFillZerobss:
9393
cmp r2, r4
9494
bcc FillZerobss
9595

96-
/* Call the clock system initialization function.*/
96+
/* Call the clock system intitialization function.*/
9797
bl SystemInit
9898
/* Call static constructors */
9999
bl __libc_init_array

system/Drivers/CMSIS/Device/ST/STM32G4xx/Source/Templates/gcc/startup_stm32g491xx.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ LoopFillZerobss:
9494
cmp r2, r4
9595
bcc FillZerobss
9696

97-
/* Call the clock system initialization function.*/
97+
/* Call the clock system intitialization function.*/
9898
bl SystemInit
9999
/* Call static constructors */
100100
bl __libc_init_array

system/Drivers/CMSIS/Device/ST/STM32G4xx/Source/Templates/gcc/startup_stm32g4a1xx.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ LoopFillZerobss:
9494
cmp r2, r4
9595
bcc FillZerobss
9696

97-
/* Call the clock system initialization function.*/
97+
/* Call the clock system intitialization function.*/
9898
bl SystemInit
9999
/* Call static constructors */
100100
bl __libc_init_array

system/Drivers/CMSIS/Device/ST/STM32G4xx/Source/Templates/gcc/startup_stm32gbk1cb.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ LoopFillZerobss:
9090
cmp r2, r3
9191
bcc FillZerobss
9292

93-
/* Call the clock system initialization function.*/
93+
/* Call the clock system intitialization function.*/
9494
bl SystemInit
9595
/* Call static constructors */
9696
bl __libc_init_array

system/Drivers/CMSIS/Device/ST/STM32G4xx/Source/Templates/system_stm32g4xx.c

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,29 @@
103103
*/
104104

105105
/************************* Miscellaneous Configuration ************************/
106-
/*!< Uncomment the following line if you need to relocate your vector Table in
107-
Internal SRAM. */
106+
/* Note: Following vector table addresses must be defined in line with linker
107+
configuration. */
108+
/*!< Uncomment the following line if you need to relocate the vector table
109+
anywhere in Flash or Sram, else the vector table is kept at the automatic
110+
remap of boot address selected */
111+
/* #define USER_VECT_TAB_ADDRESS */
112+
113+
#if defined(USER_VECT_TAB_ADDRESS)
114+
/*!< Uncomment the following line if you need to relocate your vector Table
115+
in Sram else user remap will be done in Flash. */
108116
/* #define VECT_TAB_SRAM */
109-
#define VECT_TAB_OFFSET 0x00UL /*!< Vector Table base offset field.
110-
This value must be a multiple of 0x200. */
117+
#if defined(VECT_TAB_SRAM)
118+
#define VECT_TAB_BASE_ADDRESS SRAM_BASE /*!< Vector Table base address field.
119+
This value must be a multiple of 0x200. */
120+
#define VECT_TAB_OFFSET 0x00000000U /*!< Vector Table base offset field.
121+
This value must be a multiple of 0x200. */
122+
#else
123+
#define VECT_TAB_BASE_ADDRESS FLASH_BASE /*!< Vector Table base address field.
124+
This value must be a multiple of 0x200. */
125+
#define VECT_TAB_OFFSET 0x00000000U /*!< Vector Table base offset field.
126+
This value must be a multiple of 0x200. */
127+
#endif /* VECT_TAB_SRAM */
128+
#endif /* USER_VECT_TAB_ADDRESS */
111129
/******************************************************************************/
112130
/**
113131
* @}
@@ -167,11 +185,9 @@ void SystemInit(void)
167185
#endif
168186

169187
/* Configure the Vector Table location add offset address ------------------*/
170-
#ifdef VECT_TAB_SRAM
171-
SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */
172-
#else
173-
SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */
174-
#endif
188+
#if defined(USER_VECT_TAB_ADDRESS)
189+
SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */
190+
#endif /* USER_VECT_TAB_ADDRESS */
175191
}
176192

177193
/**

0 commit comments

Comments
 (0)