Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STM32 HAL: update and use as submodules instead #157

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[submodule "libs/STM32_HAL/stm32f0xx_hal_driver"]
path = libs/STM32_HAL/stm32f0xx_hal_driver
url = https://github.com/STMicroelectronics/stm32f0xx_hal_driver.git
shallow = true
[submodule "libs/STM32_HAL/stm32f4xx_hal_driver"]
path = libs/STM32_HAL/stm32f4xx_hal_driver
url = https://github.com/STMicroelectronics/stm32f4xx_hal_driver.git
shallow = true
[submodule "libs/STM32_HAL/stm32g0xx_hal_driver"]
path = libs/STM32_HAL/stm32g0xx_hal_driver
url = https://github.com/STMicroelectronics/stm32g0xx_hal_driver.git
shallow = true
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