Skip to content

Commit

Permalink
STM32 HAL: update and use as submodules instead
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
fenugrec committed Jan 18, 2023
1 parent 4a1e646 commit 7c41fe1
Show file tree
Hide file tree
Showing 103 changed files with 115 additions and 136,911 deletions.
9 changes: 9 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[submodule "libs/STM32_HAL/stm32f0xx_hal_driver"]
path = libs/STM32_HAL/stm32f0xx_hal_driver
url = https://github.com/STMicroelectronics/stm32f0xx_hal_driver.git
[submodule "libs/STM32_HAL/stm32f4xx_hal_driver"]
path = libs/STM32_HAL/stm32f4xx_hal_driver
url = https://github.com/STMicroelectronics/stm32f4xx_hal_driver.git
[submodule "libs/STM32_HAL/stm32g0xx_hal_driver"]
path = libs/STM32_HAL/stm32g0xx_hal_driver
url = https://github.com/STMicroelectronics/stm32g0xx_hal_driver.git
202 changes: 103 additions & 99 deletions libs/STM32_HAL/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,47 +1,51 @@
project(STM32_HAL)

set(STM32F0_HALDIR stm32f0xx_hal_driver)
set(STM32F4_HALDIR stm32f4xx_hal_driver)
set(STM32G0_HALDIR stm32g0xx_hal_driver)

set(STM32F0_SOURCES
config/stm32f0xx_hal_conf.h

include/stm32f0xx/stm32f0xx_hal_def.h
include/stm32f0xx/stm32f0xx_hal.h
src/stm32f0xx/stm32f0xx_hal.c
${STM32F0_HALDIR}/Inc/stm32f0xx_hal_def.h
${STM32F0_HALDIR}/Inc/stm32f0xx_hal.h
${STM32F0_HALDIR}/Src/stm32f0xx_hal.c

include/stm32f0xx/stm32f0xx_hal_can.h
src/stm32f0xx/stm32f0xx_hal_can.c
${STM32F0_HALDIR}/Inc/stm32f0xx_hal_can.h
${STM32F0_HALDIR}/Src/stm32f0xx_hal_can.c

include/stm32f0xx/stm32f0xx_hal_cortex.h
src/stm32f0xx/stm32f0xx_hal_cortex.c
${STM32F0_HALDIR}/Inc/stm32f0xx_hal_cortex.h
${STM32F0_HALDIR}/Src/stm32f0xx_hal_cortex.c

include/stm32f0xx/stm32f0xx_hal_flash_ex.h
src/stm32f0xx/stm32f0xx_hal_flash_ex.c
include/stm32f0xx/stm32f0xx_hal_flash.h
src/stm32f0xx/stm32f0xx_hal_flash.c
${STM32F0_HALDIR}/Inc/stm32f0xx_hal_flash_ex.h
${STM32F0_HALDIR}/Src/stm32f0xx_hal_flash_ex.c
${STM32F0_HALDIR}/Inc/stm32f0xx_hal_flash.h
${STM32F0_HALDIR}/Src/stm32f0xx_hal_flash.c

include/stm32f0xx/stm32f0xx_hal_gpio_ex.h
include/stm32f0xx/stm32f0xx_hal_gpio.h
src/stm32f0xx/stm32f0xx_hal_gpio.c
${STM32F0_HALDIR}/Inc/stm32f0xx_hal_gpio_ex.h
${STM32F0_HALDIR}/Inc/stm32f0xx_hal_gpio.h
${STM32F0_HALDIR}/Src/stm32f0xx_hal_gpio.c

include/stm32f0xx/stm32f0xx_hal_pcd_ex.h
src/stm32f0xx/stm32f0xx_hal_pcd_ex.c
include/stm32f0xx/stm32f0xx_hal_pcd.h
src/stm32f0xx/stm32f0xx_hal_pcd.c
${STM32F0_HALDIR}/Inc/stm32f0xx_hal_pcd_ex.h
${STM32F0_HALDIR}/Src/stm32f0xx_hal_pcd_ex.c
${STM32F0_HALDIR}/Inc/stm32f0xx_hal_pcd.h
${STM32F0_HALDIR}/Src/stm32f0xx_hal_pcd.c

include/stm32f0xx/stm32f0xx_hal_rcc.h
src/stm32f0xx/stm32f0xx_hal_rcc.c
include/stm32f0xx/stm32f0xx_hal_rcc_ex.h
src/stm32f0xx/stm32f0xx_hal_rcc_ex.c
${STM32F0_HALDIR}/Inc/stm32f0xx_hal_rcc.h
${STM32F0_HALDIR}/Src/stm32f0xx_hal_rcc.c
${STM32F0_HALDIR}/Inc/stm32f0xx_hal_rcc_ex.h
${STM32F0_HALDIR}/Src/stm32f0xx_hal_rcc_ex.c

include/stm32f0xx/stm32f0xx_hal_tim_ex.h
src/stm32f0xx/stm32f0xx_hal_tim_ex.c
include/stm32f0xx/stm32f0xx_hal_tim.h
src/stm32f0xx/stm32f0xx_hal_tim.c
${STM32F0_HALDIR}/Inc/stm32f0xx_hal_tim_ex.h
${STM32F0_HALDIR}/Src/stm32f0xx_hal_tim_ex.c
${STM32F0_HALDIR}/Inc/stm32f0xx_hal_tim.h
${STM32F0_HALDIR}/Src/stm32f0xx_hal_tim.c

include/stm32f0xx/stm32f0xx_ll_usb.h
src/stm32f0xx/stm32f0xx_ll_usb.c
${STM32F0_HALDIR}/Inc/stm32f0xx_ll_usb.h
${STM32F0_HALDIR}/Src/stm32f0xx_ll_usb.c

src/cmsis/system_stm32f0xx.c
include/stm32f0xx/Legacy/stm32_hal_legacy.h
${STM32F0_HALDIR}/Inc/Legacy/stm32_hal_legacy.h

include/cmsis/cmsis_compiler.h
include/cmsis/cmsis_device.h
Expand All @@ -58,50 +62,50 @@ set(STM32F0_SOURCES
set(STM32F4_SOURCES
config/stm32f4xx_hal_conf.h

include/stm32f4xx/stm32f4xx_hal_def.h
include/stm32f4xx/stm32f4xx_hal.h
src/stm32f4xx/stm32f4xx_hal.c
${STM32F4_HALDIR}/Inc/stm32f4xx_hal_def.h
${STM32F4_HALDIR}/Inc/stm32f4xx_hal.h
${STM32F4_HALDIR}/Src/stm32f4xx_hal.c

include/stm32f4xx/stm32f4xx_hal_can.h
src/stm32f4xx/stm32f4xx_hal_can.c
${STM32F4_HALDIR}/Inc/stm32f4xx_hal_can.h
${STM32F4_HALDIR}/Src/stm32f4xx_hal_can.c

include/stm32f4xx/stm32f4xx_hal_cortex.h
src/stm32f4xx/stm32f4xx_hal_cortex.c
${STM32F4_HALDIR}/Inc/stm32f4xx_hal_cortex.h
${STM32F4_HALDIR}/Src/stm32f4xx_hal_cortex.c

include/stm32f4xx/stm32f4xx_hal_flash_ex.h
src/stm32f4xx/stm32f4xx_hal_flash_ex.c
include/stm32f4xx/stm32f4xx_hal_flash.h
src/stm32f4xx/stm32f4xx_hal_flash.c
${STM32F4_HALDIR}/Inc/stm32f4xx_hal_flash_ex.h
${STM32F4_HALDIR}/Src/stm32f4xx_hal_flash_ex.c
${STM32F4_HALDIR}/Inc/stm32f4xx_hal_flash.h
${STM32F4_HALDIR}/Src/stm32f4xx_hal_flash.c

include/stm32f4xx/stm32f4xx_hal_gpio_ex.h
include/stm32f4xx/stm32f4xx_hal_gpio.h
src/stm32f4xx/stm32f4xx_hal_gpio.c
${STM32F4_HALDIR}/Inc/stm32f4xx_hal_gpio_ex.h
${STM32F4_HALDIR}/Inc/stm32f4xx_hal_gpio.h
${STM32F4_HALDIR}/Src/stm32f4xx_hal_gpio.c

include/stm32f4xx/stm32f4xx_hal_pcd_ex.h
src/stm32f4xx/stm32f4xx_hal_pcd_ex.c
include/stm32f4xx/stm32f4xx_hal_pcd.h
src/stm32f4xx/stm32f4xx_hal_pcd.c
${STM32F4_HALDIR}/Inc/stm32f4xx_hal_pcd_ex.h
${STM32F4_HALDIR}/Src/stm32f4xx_hal_pcd_ex.c
${STM32F4_HALDIR}/Inc/stm32f4xx_hal_pcd.h
${STM32F4_HALDIR}/Src/stm32f4xx_hal_pcd.c

include/stm32f4xx/stm32f4xx_hal_rcc.h
src/stm32f4xx/stm32f4xx_hal_rcc.c
include/stm32f4xx/stm32f4xx_hal_rcc_ex.h
src/stm32f4xx/stm32f4xx_hal_rcc_ex.c
${STM32F4_HALDIR}/Inc/stm32f4xx_hal_rcc.h
${STM32F4_HALDIR}/Src/stm32f4xx_hal_rcc.c
${STM32F4_HALDIR}/Inc/stm32f4xx_hal_rcc_ex.h
${STM32F4_HALDIR}/Src/stm32f4xx_hal_rcc_ex.c

include/stm32f4xx/stm32f4xx_hal_pwr.h
src/stm32f4xx/stm32f4xx_hal_pwr.c
include/stm32f4xx/stm32f4xx_hal_pwr_ex.h
src/stm32f4xx/stm32f4xx_hal_pwr_ex.c
${STM32F4_HALDIR}/Inc/stm32f4xx_hal_pwr.h
${STM32F4_HALDIR}/Src/stm32f4xx_hal_pwr.c
${STM32F4_HALDIR}/Inc/stm32f4xx_hal_pwr_ex.h
${STM32F4_HALDIR}/Src/stm32f4xx_hal_pwr_ex.c

include/stm32f4xx/stm32f4xx_hal_tim_ex.h
src/stm32f4xx/stm32f4xx_hal_tim_ex.c
include/stm32f4xx/stm32f4xx_hal_tim.h
src/stm32f4xx/stm32f4xx_hal_tim.c
${STM32F4_HALDIR}/Inc/stm32f4xx_hal_tim_ex.h
${STM32F4_HALDIR}/Src/stm32f4xx_hal_tim_ex.c
${STM32F4_HALDIR}/Inc/stm32f4xx_hal_tim.h
${STM32F4_HALDIR}/Src/stm32f4xx_hal_tim.c

include/stm32f4xx/stm32f4xx_ll_usb.h
src/stm32f4xx/stm32f4xx_ll_usb.c
${STM32F4_HALDIR}/Inc/stm32f4xx_ll_usb.h
${STM32F4_HALDIR}/Src/stm32f4xx_ll_usb.c

src/cmsis/system_stm32f4xx.c
include/stm32f4xx/Legacy/stm32_hal_legacy.h
${STM32F4_HALDIR}/Inc/Legacy/stm32_hal_legacy.h

include/cmsis/cmsis_compiler.h
include/cmsis/cmsis_device.h
Expand All @@ -116,50 +120,50 @@ set(STM32F4_SOURCES
set(STM32G0_SOURCES
config/stm32g0xx_hal_conf.h

include/stm32g0xx/stm32g0xx_hal_def.h
include/stm32g0xx/stm32g0xx_hal.h
src/stm32g0xx/stm32g0xx_hal.c
${STM32G0_HALDIR}/Inc/stm32g0xx_hal_def.h
${STM32G0_HALDIR}/Inc/stm32g0xx_hal.h
${STM32G0_HALDIR}/Src/stm32g0xx_hal.c

include/stm32g0xx/stm32g0xx_hal_fdcan.h
src/stm32g0xx/stm32g0xx_hal_fdcan.c
${STM32G0_HALDIR}/Inc/stm32g0xx_hal_fdcan.h
${STM32G0_HALDIR}/Src/stm32g0xx_hal_fdcan.c

include/stm32g0xx/stm32g0xx_hal_cortex.h
src/stm32g0xx/stm32g0xx_hal_cortex.c
${STM32G0_HALDIR}/Inc/stm32g0xx_hal_cortex.h
${STM32G0_HALDIR}/Src/stm32g0xx_hal_cortex.c

include/stm32g0xx/stm32g0xx_hal_flash_ex.h
src/stm32g0xx/stm32g0xx_hal_flash_ex.c
include/stm32g0xx/stm32g0xx_hal_flash.h
src/stm32g0xx/stm32g0xx_hal_flash.c
${STM32G0_HALDIR}/Inc/stm32g0xx_hal_flash_ex.h
${STM32G0_HALDIR}/Src/stm32g0xx_hal_flash_ex.c
${STM32G0_HALDIR}/Inc/stm32g0xx_hal_flash.h
${STM32G0_HALDIR}/Src/stm32g0xx_hal_flash.c

include/stm32g0xx/stm32g0xx_hal_gpio_ex.h
include/stm32g0xx/stm32g0xx_hal_gpio.h
src/stm32g0xx/stm32g0xx_hal_gpio.c
${STM32G0_HALDIR}/Inc/stm32g0xx_hal_gpio_ex.h
${STM32G0_HALDIR}/Inc/stm32g0xx_hal_gpio.h
${STM32G0_HALDIR}/Src/stm32g0xx_hal_gpio.c

include/stm32g0xx/stm32g0xx_hal_pcd_ex.h
src/stm32g0xx/stm32g0xx_hal_pcd_ex.c
include/stm32g0xx/stm32g0xx_hal_pcd.h
src/stm32g0xx/stm32g0xx_hal_pcd.c
${STM32G0_HALDIR}/Inc/stm32g0xx_hal_pcd_ex.h
${STM32G0_HALDIR}/Src/stm32g0xx_hal_pcd_ex.c
${STM32G0_HALDIR}/Inc/stm32g0xx_hal_pcd.h
${STM32G0_HALDIR}/Src/stm32g0xx_hal_pcd.c

include/stm32g0xx/stm32g0xx_hal_rcc.h
src/stm32g0xx/stm32g0xx_hal_rcc.c
include/stm32g0xx/stm32g0xx_hal_rcc_ex.h
src/stm32g0xx/stm32g0xx_hal_rcc_ex.c
${STM32G0_HALDIR}/Inc/stm32g0xx_hal_rcc.h
${STM32G0_HALDIR}/Src/stm32g0xx_hal_rcc.c
${STM32G0_HALDIR}/Inc/stm32g0xx_hal_rcc_ex.h
${STM32G0_HALDIR}/Src/stm32g0xx_hal_rcc_ex.c

include/stm32g0xx/stm32g0xx_hal_pwr.h
src/stm32g0xx/stm32g0xx_hal_pwr.c
include/stm32g0xx/stm32g0xx_hal_pwr_ex.h
src/stm32g0xx/stm32g0xx_hal_pwr_ex.c
${STM32G0_HALDIR}/Inc/stm32g0xx_hal_pwr.h
${STM32G0_HALDIR}/Src/stm32g0xx_hal_pwr.c
${STM32G0_HALDIR}/Inc/stm32g0xx_hal_pwr_ex.h
${STM32G0_HALDIR}/Src/stm32g0xx_hal_pwr_ex.c

include/stm32g0xx/stm32g0xx_hal_tim_ex.h
src/stm32g0xx/stm32g0xx_hal_tim_ex.c
include/stm32g0xx/stm32g0xx_hal_tim.h
src/stm32g0xx/stm32g0xx_hal_tim.c
${STM32G0_HALDIR}/Inc/stm32g0xx_hal_tim_ex.h
${STM32G0_HALDIR}/Src/stm32g0xx_hal_tim_ex.c
${STM32G0_HALDIR}/Inc/stm32g0xx_hal_tim.h
${STM32G0_HALDIR}/Src/stm32g0xx_hal_tim.c

include/stm32g0xx/stm32g0xx_ll_usb.h
src/stm32g0xx/stm32g0xx_ll_usb.c
${STM32G0_HALDIR}/Inc/stm32g0xx_ll_usb.h
${STM32G0_HALDIR}/Src/stm32g0xx_ll_usb.c

src/cmsis/system_stm32g0xx.c
include/stm32g0xx/Legacy/stm32_hal_legacy.h
${STM32G0_HALDIR}/Inc/Legacy/stm32_hal_legacy.h

include/cmsis/cmsis_compiler.h
include/cmsis/cmsis_device.h
Expand All @@ -179,21 +183,21 @@ set(INCLUDE_DIRS
)

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

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

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

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

0 comments on commit 7c41fe1

Please sign in to comment.