Skip to content

Commit d3f16a8

Browse files
committed
STM32 HAL: update and use as submodules instead
Will make it easier to track upstream bugfixes. Submodules are configured with "--depth 1" to make retrieval fast. Partial fix for GH candle-usb#82 Version bumps : F0xx : 1.7.5 -> 1.7.6 F4xx : 1.7.13 -> 1.8.1 G0xx : 1.4.5 (no change)
1 parent 4a1e646 commit d3f16a8

File tree

103 files changed

+118
-136911
lines changed

Some content is hidden

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

103 files changed

+118
-136911
lines changed

.gitmodules

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[submodule "libs/STM32_HAL/stm32f0xx_hal_driver"]
2+
path = libs/STM32_HAL/stm32f0xx_hal_driver
3+
url = https://github.com/STMicroelectronics/stm32f0xx_hal_driver.git
4+
shallow = true
5+
[submodule "libs/STM32_HAL/stm32f4xx_hal_driver"]
6+
path = libs/STM32_HAL/stm32f4xx_hal_driver
7+
url = https://github.com/STMicroelectronics/stm32f4xx_hal_driver.git
8+
shallow = true
9+
[submodule "libs/STM32_HAL/stm32g0xx_hal_driver"]
10+
path = libs/STM32_HAL/stm32g0xx_hal_driver
11+
url = https://github.com/STMicroelectronics/stm32g0xx_hal_driver.git
12+
shallow = true

libs/STM32_HAL/CMakeLists.txt

Lines changed: 103 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,51 @@
11
project(STM32_HAL)
22

3+
set(STM32F0_HALDIR stm32f0xx_hal_driver)
4+
set(STM32F4_HALDIR stm32f4xx_hal_driver)
5+
set(STM32G0_HALDIR stm32g0xx_hal_driver)
6+
37
set(STM32F0_SOURCES
48
config/stm32f0xx_hal_conf.h
59

6-
include/stm32f0xx/stm32f0xx_hal_def.h
7-
include/stm32f0xx/stm32f0xx_hal.h
8-
src/stm32f0xx/stm32f0xx_hal.c
10+
${STM32F0_HALDIR}/Inc/stm32f0xx_hal_def.h
11+
${STM32F0_HALDIR}/Inc/stm32f0xx_hal.h
12+
${STM32F0_HALDIR}/Src/stm32f0xx_hal.c
913

10-
include/stm32f0xx/stm32f0xx_hal_can.h
11-
src/stm32f0xx/stm32f0xx_hal_can.c
14+
${STM32F0_HALDIR}/Inc/stm32f0xx_hal_can.h
15+
${STM32F0_HALDIR}/Src/stm32f0xx_hal_can.c
1216

13-
include/stm32f0xx/stm32f0xx_hal_cortex.h
14-
src/stm32f0xx/stm32f0xx_hal_cortex.c
17+
${STM32F0_HALDIR}/Inc/stm32f0xx_hal_cortex.h
18+
${STM32F0_HALDIR}/Src/stm32f0xx_hal_cortex.c
1519

16-
include/stm32f0xx/stm32f0xx_hal_flash_ex.h
17-
src/stm32f0xx/stm32f0xx_hal_flash_ex.c
18-
include/stm32f0xx/stm32f0xx_hal_flash.h
19-
src/stm32f0xx/stm32f0xx_hal_flash.c
20+
${STM32F0_HALDIR}/Inc/stm32f0xx_hal_flash_ex.h
21+
${STM32F0_HALDIR}/Src/stm32f0xx_hal_flash_ex.c
22+
${STM32F0_HALDIR}/Inc/stm32f0xx_hal_flash.h
23+
${STM32F0_HALDIR}/Src/stm32f0xx_hal_flash.c
2024

21-
include/stm32f0xx/stm32f0xx_hal_gpio_ex.h
22-
include/stm32f0xx/stm32f0xx_hal_gpio.h
23-
src/stm32f0xx/stm32f0xx_hal_gpio.c
25+
${STM32F0_HALDIR}/Inc/stm32f0xx_hal_gpio_ex.h
26+
${STM32F0_HALDIR}/Inc/stm32f0xx_hal_gpio.h
27+
${STM32F0_HALDIR}/Src/stm32f0xx_hal_gpio.c
2428

25-
include/stm32f0xx/stm32f0xx_hal_pcd_ex.h
26-
src/stm32f0xx/stm32f0xx_hal_pcd_ex.c
27-
include/stm32f0xx/stm32f0xx_hal_pcd.h
28-
src/stm32f0xx/stm32f0xx_hal_pcd.c
29+
${STM32F0_HALDIR}/Inc/stm32f0xx_hal_pcd_ex.h
30+
${STM32F0_HALDIR}/Src/stm32f0xx_hal_pcd_ex.c
31+
${STM32F0_HALDIR}/Inc/stm32f0xx_hal_pcd.h
32+
${STM32F0_HALDIR}/Src/stm32f0xx_hal_pcd.c
2933

30-
include/stm32f0xx/stm32f0xx_hal_rcc.h
31-
src/stm32f0xx/stm32f0xx_hal_rcc.c
32-
include/stm32f0xx/stm32f0xx_hal_rcc_ex.h
33-
src/stm32f0xx/stm32f0xx_hal_rcc_ex.c
34+
${STM32F0_HALDIR}/Inc/stm32f0xx_hal_rcc.h
35+
${STM32F0_HALDIR}/Src/stm32f0xx_hal_rcc.c
36+
${STM32F0_HALDIR}/Inc/stm32f0xx_hal_rcc_ex.h
37+
${STM32F0_HALDIR}/Src/stm32f0xx_hal_rcc_ex.c
3438

35-
include/stm32f0xx/stm32f0xx_hal_tim_ex.h
36-
src/stm32f0xx/stm32f0xx_hal_tim_ex.c
37-
include/stm32f0xx/stm32f0xx_hal_tim.h
38-
src/stm32f0xx/stm32f0xx_hal_tim.c
39+
${STM32F0_HALDIR}/Inc/stm32f0xx_hal_tim_ex.h
40+
${STM32F0_HALDIR}/Src/stm32f0xx_hal_tim_ex.c
41+
${STM32F0_HALDIR}/Inc/stm32f0xx_hal_tim.h
42+
${STM32F0_HALDIR}/Src/stm32f0xx_hal_tim.c
3943

40-
include/stm32f0xx/stm32f0xx_ll_usb.h
41-
src/stm32f0xx/stm32f0xx_ll_usb.c
44+
${STM32F0_HALDIR}/Inc/stm32f0xx_ll_usb.h
45+
${STM32F0_HALDIR}/Src/stm32f0xx_ll_usb.c
4246

4347
src/cmsis/system_stm32f0xx.c
44-
include/stm32f0xx/Legacy/stm32_hal_legacy.h
48+
${STM32F0_HALDIR}/Inc/Legacy/stm32_hal_legacy.h
4549

4650
include/cmsis/cmsis_compiler.h
4751
include/cmsis/cmsis_device.h
@@ -58,50 +62,50 @@ set(STM32F0_SOURCES
5862
set(STM32F4_SOURCES
5963
config/stm32f4xx_hal_conf.h
6064

61-
include/stm32f4xx/stm32f4xx_hal_def.h
62-
include/stm32f4xx/stm32f4xx_hal.h
63-
src/stm32f4xx/stm32f4xx_hal.c
65+
${STM32F4_HALDIR}/Inc/stm32f4xx_hal_def.h
66+
${STM32F4_HALDIR}/Inc/stm32f4xx_hal.h
67+
${STM32F4_HALDIR}/Src/stm32f4xx_hal.c
6468

65-
include/stm32f4xx/stm32f4xx_hal_can.h
66-
src/stm32f4xx/stm32f4xx_hal_can.c
69+
${STM32F4_HALDIR}/Inc/stm32f4xx_hal_can.h
70+
${STM32F4_HALDIR}/Src/stm32f4xx_hal_can.c
6771

68-
include/stm32f4xx/stm32f4xx_hal_cortex.h
69-
src/stm32f4xx/stm32f4xx_hal_cortex.c
72+
${STM32F4_HALDIR}/Inc/stm32f4xx_hal_cortex.h
73+
${STM32F4_HALDIR}/Src/stm32f4xx_hal_cortex.c
7074

71-
include/stm32f4xx/stm32f4xx_hal_flash_ex.h
72-
src/stm32f4xx/stm32f4xx_hal_flash_ex.c
73-
include/stm32f4xx/stm32f4xx_hal_flash.h
74-
src/stm32f4xx/stm32f4xx_hal_flash.c
75+
${STM32F4_HALDIR}/Inc/stm32f4xx_hal_flash_ex.h
76+
${STM32F4_HALDIR}/Src/stm32f4xx_hal_flash_ex.c
77+
${STM32F4_HALDIR}/Inc/stm32f4xx_hal_flash.h
78+
${STM32F4_HALDIR}/Src/stm32f4xx_hal_flash.c
7579

76-
include/stm32f4xx/stm32f4xx_hal_gpio_ex.h
77-
include/stm32f4xx/stm32f4xx_hal_gpio.h
78-
src/stm32f4xx/stm32f4xx_hal_gpio.c
80+
${STM32F4_HALDIR}/Inc/stm32f4xx_hal_gpio_ex.h
81+
${STM32F4_HALDIR}/Inc/stm32f4xx_hal_gpio.h
82+
${STM32F4_HALDIR}/Src/stm32f4xx_hal_gpio.c
7983

80-
include/stm32f4xx/stm32f4xx_hal_pcd_ex.h
81-
src/stm32f4xx/stm32f4xx_hal_pcd_ex.c
82-
include/stm32f4xx/stm32f4xx_hal_pcd.h
83-
src/stm32f4xx/stm32f4xx_hal_pcd.c
84+
${STM32F4_HALDIR}/Inc/stm32f4xx_hal_pcd_ex.h
85+
${STM32F4_HALDIR}/Src/stm32f4xx_hal_pcd_ex.c
86+
${STM32F4_HALDIR}/Inc/stm32f4xx_hal_pcd.h
87+
${STM32F4_HALDIR}/Src/stm32f4xx_hal_pcd.c
8488

85-
include/stm32f4xx/stm32f4xx_hal_rcc.h
86-
src/stm32f4xx/stm32f4xx_hal_rcc.c
87-
include/stm32f4xx/stm32f4xx_hal_rcc_ex.h
88-
src/stm32f4xx/stm32f4xx_hal_rcc_ex.c
89+
${STM32F4_HALDIR}/Inc/stm32f4xx_hal_rcc.h
90+
${STM32F4_HALDIR}/Src/stm32f4xx_hal_rcc.c
91+
${STM32F4_HALDIR}/Inc/stm32f4xx_hal_rcc_ex.h
92+
${STM32F4_HALDIR}/Src/stm32f4xx_hal_rcc_ex.c
8993

90-
include/stm32f4xx/stm32f4xx_hal_pwr.h
91-
src/stm32f4xx/stm32f4xx_hal_pwr.c
92-
include/stm32f4xx/stm32f4xx_hal_pwr_ex.h
93-
src/stm32f4xx/stm32f4xx_hal_pwr_ex.c
94+
${STM32F4_HALDIR}/Inc/stm32f4xx_hal_pwr.h
95+
${STM32F4_HALDIR}/Src/stm32f4xx_hal_pwr.c
96+
${STM32F4_HALDIR}/Inc/stm32f4xx_hal_pwr_ex.h
97+
${STM32F4_HALDIR}/Src/stm32f4xx_hal_pwr_ex.c
9498

95-
include/stm32f4xx/stm32f4xx_hal_tim_ex.h
96-
src/stm32f4xx/stm32f4xx_hal_tim_ex.c
97-
include/stm32f4xx/stm32f4xx_hal_tim.h
98-
src/stm32f4xx/stm32f4xx_hal_tim.c
99+
${STM32F4_HALDIR}/Inc/stm32f4xx_hal_tim_ex.h
100+
${STM32F4_HALDIR}/Src/stm32f4xx_hal_tim_ex.c
101+
${STM32F4_HALDIR}/Inc/stm32f4xx_hal_tim.h
102+
${STM32F4_HALDIR}/Src/stm32f4xx_hal_tim.c
99103

100-
include/stm32f4xx/stm32f4xx_ll_usb.h
101-
src/stm32f4xx/stm32f4xx_ll_usb.c
104+
${STM32F4_HALDIR}/Inc/stm32f4xx_ll_usb.h
105+
${STM32F4_HALDIR}/Src/stm32f4xx_ll_usb.c
102106

103107
src/cmsis/system_stm32f4xx.c
104-
include/stm32f4xx/Legacy/stm32_hal_legacy.h
108+
${STM32F4_HALDIR}/Inc/Legacy/stm32_hal_legacy.h
105109

106110
include/cmsis/cmsis_compiler.h
107111
include/cmsis/cmsis_device.h
@@ -116,50 +120,50 @@ set(STM32F4_SOURCES
116120
set(STM32G0_SOURCES
117121
config/stm32g0xx_hal_conf.h
118122

119-
include/stm32g0xx/stm32g0xx_hal_def.h
120-
include/stm32g0xx/stm32g0xx_hal.h
121-
src/stm32g0xx/stm32g0xx_hal.c
123+
${STM32G0_HALDIR}/Inc/stm32g0xx_hal_def.h
124+
${STM32G0_HALDIR}/Inc/stm32g0xx_hal.h
125+
${STM32G0_HALDIR}/Src/stm32g0xx_hal.c
122126

123-
include/stm32g0xx/stm32g0xx_hal_fdcan.h
124-
src/stm32g0xx/stm32g0xx_hal_fdcan.c
127+
${STM32G0_HALDIR}/Inc/stm32g0xx_hal_fdcan.h
128+
${STM32G0_HALDIR}/Src/stm32g0xx_hal_fdcan.c
125129

126-
include/stm32g0xx/stm32g0xx_hal_cortex.h
127-
src/stm32g0xx/stm32g0xx_hal_cortex.c
130+
${STM32G0_HALDIR}/Inc/stm32g0xx_hal_cortex.h
131+
${STM32G0_HALDIR}/Src/stm32g0xx_hal_cortex.c
128132

129-
include/stm32g0xx/stm32g0xx_hal_flash_ex.h
130-
src/stm32g0xx/stm32g0xx_hal_flash_ex.c
131-
include/stm32g0xx/stm32g0xx_hal_flash.h
132-
src/stm32g0xx/stm32g0xx_hal_flash.c
133+
${STM32G0_HALDIR}/Inc/stm32g0xx_hal_flash_ex.h
134+
${STM32G0_HALDIR}/Src/stm32g0xx_hal_flash_ex.c
135+
${STM32G0_HALDIR}/Inc/stm32g0xx_hal_flash.h
136+
${STM32G0_HALDIR}/Src/stm32g0xx_hal_flash.c
133137

134-
include/stm32g0xx/stm32g0xx_hal_gpio_ex.h
135-
include/stm32g0xx/stm32g0xx_hal_gpio.h
136-
src/stm32g0xx/stm32g0xx_hal_gpio.c
138+
${STM32G0_HALDIR}/Inc/stm32g0xx_hal_gpio_ex.h
139+
${STM32G0_HALDIR}/Inc/stm32g0xx_hal_gpio.h
140+
${STM32G0_HALDIR}/Src/stm32g0xx_hal_gpio.c
137141

138-
include/stm32g0xx/stm32g0xx_hal_pcd_ex.h
139-
src/stm32g0xx/stm32g0xx_hal_pcd_ex.c
140-
include/stm32g0xx/stm32g0xx_hal_pcd.h
141-
src/stm32g0xx/stm32g0xx_hal_pcd.c
142+
${STM32G0_HALDIR}/Inc/stm32g0xx_hal_pcd_ex.h
143+
${STM32G0_HALDIR}/Src/stm32g0xx_hal_pcd_ex.c
144+
${STM32G0_HALDIR}/Inc/stm32g0xx_hal_pcd.h
145+
${STM32G0_HALDIR}/Src/stm32g0xx_hal_pcd.c
142146

143-
include/stm32g0xx/stm32g0xx_hal_rcc.h
144-
src/stm32g0xx/stm32g0xx_hal_rcc.c
145-
include/stm32g0xx/stm32g0xx_hal_rcc_ex.h
146-
src/stm32g0xx/stm32g0xx_hal_rcc_ex.c
147+
${STM32G0_HALDIR}/Inc/stm32g0xx_hal_rcc.h
148+
${STM32G0_HALDIR}/Src/stm32g0xx_hal_rcc.c
149+
${STM32G0_HALDIR}/Inc/stm32g0xx_hal_rcc_ex.h
150+
${STM32G0_HALDIR}/Src/stm32g0xx_hal_rcc_ex.c
147151

148-
include/stm32g0xx/stm32g0xx_hal_pwr.h
149-
src/stm32g0xx/stm32g0xx_hal_pwr.c
150-
include/stm32g0xx/stm32g0xx_hal_pwr_ex.h
151-
src/stm32g0xx/stm32g0xx_hal_pwr_ex.c
152+
${STM32G0_HALDIR}/Inc/stm32g0xx_hal_pwr.h
153+
${STM32G0_HALDIR}/Src/stm32g0xx_hal_pwr.c
154+
${STM32G0_HALDIR}/Inc/stm32g0xx_hal_pwr_ex.h
155+
${STM32G0_HALDIR}/Src/stm32g0xx_hal_pwr_ex.c
152156

153-
include/stm32g0xx/stm32g0xx_hal_tim_ex.h
154-
src/stm32g0xx/stm32g0xx_hal_tim_ex.c
155-
include/stm32g0xx/stm32g0xx_hal_tim.h
156-
src/stm32g0xx/stm32g0xx_hal_tim.c
157+
${STM32G0_HALDIR}/Inc/stm32g0xx_hal_tim_ex.h
158+
${STM32G0_HALDIR}/Src/stm32g0xx_hal_tim_ex.c
159+
${STM32G0_HALDIR}/Inc/stm32g0xx_hal_tim.h
160+
${STM32G0_HALDIR}/Src/stm32g0xx_hal_tim.c
157161

158-
include/stm32g0xx/stm32g0xx_ll_usb.h
159-
src/stm32g0xx/stm32g0xx_ll_usb.c
162+
${STM32G0_HALDIR}/Inc/stm32g0xx_ll_usb.h
163+
${STM32G0_HALDIR}/Src/stm32g0xx_ll_usb.c
160164

161165
src/cmsis/system_stm32g0xx.c
162-
include/stm32g0xx/Legacy/stm32_hal_legacy.h
166+
${STM32G0_HALDIR}/Inc/Legacy/stm32_hal_legacy.h
163167

164168
include/cmsis/cmsis_compiler.h
165169
include/cmsis/cmsis_device.h
@@ -179,21 +183,21 @@ set(INCLUDE_DIRS
179183
)
180184

181185
add_library(STM32_HAL_STM32F042x6 STATIC ${STM32F0_SOURCES})
182-
target_include_directories(STM32_HAL_STM32F042x6 PUBLIC ${INCLUDE_DIRS} include/stm32f0xx)
186+
target_include_directories(STM32_HAL_STM32F042x6 PUBLIC ${INCLUDE_DIRS} ${STM32F0_HALDIR}/Inc)
183187
target_compile_options(STM32_HAL_STM32F042x6 PRIVATE ${CPUFLAGS_F0} -Wno-unused-parameter)
184188
target_compile_definitions(STM32_HAL_STM32F042x6 PUBLIC STM32F042x6 HAL_TARGET_PREFIX=stm32f0xx)
185189

186190
add_library(STM32_HAL_STM32F072xB STATIC ${STM32F0_SOURCES})
187-
target_include_directories(STM32_HAL_STM32F072xB PUBLIC ${INCLUDE_DIRS} include/stm32f0xx)
191+
target_include_directories(STM32_HAL_STM32F072xB PUBLIC ${INCLUDE_DIRS} ${STM32F0_HALDIR}/Inc)
188192
target_compile_options(STM32_HAL_STM32F072xB PRIVATE ${CPUFLAGS_F0} -Wno-unused-parameter)
189193
target_compile_definitions(STM32_HAL_STM32F072xB PUBLIC STM32F072xB HAL_TARGET_PREFIX=stm32f0xx)
190194

191195
add_library(STM32_HAL_STM32F407xE STATIC ${STM32F4_SOURCES})
192-
target_include_directories(STM32_HAL_STM32F407xE PUBLIC ${INCLUDE_DIRS} include/stm32f4xx)
196+
target_include_directories(STM32_HAL_STM32F407xE PUBLIC ${INCLUDE_DIRS} ${STM32F4_HALDIR}/Inc)
193197
target_compile_options(STM32_HAL_STM32F407xE PRIVATE ${CPUFLAGS_F4} -Wno-unused-parameter)
194198
target_compile_definitions(STM32_HAL_STM32F407xE PUBLIC STM32F407xx HAL_TARGET_PREFIX=stm32f4xx)
195199

196200
add_library(STM32_HAL_STM32G0B1xK STATIC ${STM32G0_SOURCES})
197-
target_include_directories(STM32_HAL_STM32G0B1xK PUBLIC ${INCLUDE_DIRS} include/stm32g0xx)
201+
target_include_directories(STM32_HAL_STM32G0B1xK PUBLIC ${INCLUDE_DIRS} ${STM32G0_HALDIR}/Inc)
198202
target_compile_options(STM32_HAL_STM32G0B1xK PRIVATE ${CPUFLAGS_G0} -Wno-unused-parameter)
199203
target_compile_definitions(STM32_HAL_STM32G0B1xK PUBLIC STM32G0B1xx HAL_TARGET_PREFIX=stm32g0xx)

0 commit comments

Comments
 (0)