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

CMake: add all TARGET_STM targets #13915

Merged
merged 19 commits into from
Nov 24, 2020
Merged
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
24 changes: 23 additions & 1 deletion targets/TARGET_STM/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,34 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

if("STM32F3" IN_LIST MBED_TARGET_LABELS)
if("STM32F0" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_STM32F0)
elseif("STM32F1" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_STM32F1)
elseif("STM32F2" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_STM32F2)
elseif("STM32F3" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_STM32F3)
elseif("STM32F4" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_STM32F4)
elseif("STM32F7" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_STM32F7)
elseif("STM32G0" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_STM32G0)
elseif("STM32G4" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_STM32G4)
elseif("STM32H7" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_STM32H7)
elseif("STM32L0" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_STM32L0)
elseif("STM32L1" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_STM32L1)
elseif("STM32L4" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_STM32L4)
elseif("STM32L5" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_STM32L5)
elseif("STM32WB" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_STM32WB)
endif()

target_include_directories(mbed-core
Expand Down
85 changes: 85 additions & 0 deletions targets/TARGET_STM/TARGET_STM32F0/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

if("STM32F091xC" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_STM32F091xC)
elseif("NUCLEO_F070RB" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_NUCLEO_F070RB)
elseif("NUCLEO_F072RB" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_NUCLEO_F072RB)
endif()

target_sources(mbed-core
INTERFACE
analogin_device.c
analogout_device.c
flash_api.c
gpio_irq_device.c
pwmout_device.c
serial_device.c
spi_api.c

device/stm32f0xx_hal.c
device/stm32f0xx_hal_adc.c
device/stm32f0xx_hal_adc_ex.c
device/stm32f0xx_hal_can.c
device/stm32f0xx_hal_cec.c
device/stm32f0xx_hal_comp.c
device/stm32f0xx_hal_cortex.c
device/stm32f0xx_hal_crc.c
device/stm32f0xx_hal_crc_ex.c
device/stm32f0xx_hal_dac.c
device/stm32f0xx_hal_dac_ex.c
device/stm32f0xx_hal_dma.c
device/stm32f0xx_hal_flash.c
device/stm32f0xx_hal_flash_ex.c
device/stm32f0xx_hal_gpio.c
device/stm32f0xx_hal_i2c.c
device/stm32f0xx_hal_i2c_ex.c
device/stm32f0xx_hal_i2s.c
device/stm32f0xx_hal_irda.c
device/stm32f0xx_hal_iwdg.c
device/stm32f0xx_hal_pcd.c
device/stm32f0xx_hal_pcd_ex.c
device/stm32f0xx_hal_pwr.c
device/stm32f0xx_hal_pwr_ex.c
device/stm32f0xx_hal_rcc.c
device/stm32f0xx_hal_rcc_ex.c
device/stm32f0xx_hal_rtc.c
device/stm32f0xx_hal_rtc_ex.c
device/stm32f0xx_hal_smartcard.c
device/stm32f0xx_hal_smartcard_ex.c
device/stm32f0xx_hal_smbus.c
device/stm32f0xx_hal_spi.c
device/stm32f0xx_hal_spi_ex.c
device/stm32f0xx_hal_tim.c
device/stm32f0xx_hal_tim_ex.c
device/stm32f0xx_hal_tsc.c
device/stm32f0xx_hal_uart.c
device/stm32f0xx_hal_uart_ex.c
device/stm32f0xx_hal_usart.c
device/stm32f0xx_hal_wwdg.c
device/stm32f0xx_ll_adc.c
device/stm32f0xx_ll_comp.c
device/stm32f0xx_ll_crc.c
device/stm32f0xx_ll_crs.c
device/stm32f0xx_ll_dac.c
device/stm32f0xx_ll_dma.c
device/stm32f0xx_ll_exti.c
device/stm32f0xx_ll_gpio.c
device/stm32f0xx_ll_i2c.c
device/stm32f0xx_ll_pwr.c
device/stm32f0xx_ll_rcc.c
device/stm32f0xx_ll_rtc.c
device/stm32f0xx_ll_spi.c
device/stm32f0xx_ll_tim.c
device/stm32f0xx_ll_usart.c
device/stm32f0xx_ll_utils.c
device/system_stm32f0xx.c
)

target_include_directories(mbed-core
INTERFACE
.
device
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_stm32f070xb.S)
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/STM32F070XB.ld)
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
set(STARTUP_FILE device/TOOLCHAIN_ARM/startup_stm32f070xb.S)
set(LINKER_FILE device/TOOLCHAIN_ARM/stm32f070xb.sct)
endif()

set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})

target_sources(mbed-core
INTERFACE
PeripheralPins.c
device/system_clock.c
device/cmsis_nvic.c
${STARTUP_FILE}
)

target_include_directories(mbed-core
INTERFACE
.
device
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_stm32f072xb.S)
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/STM32F072XB.ld)
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
set(STARTUP_FILE device/TOOLCHAIN_ARM/startup_stm32f072xb.S)
set(LINKER_FILE device/TOOLCHAIN_ARM/stm32f072xb.sct)
endif()

set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})

target_sources(mbed-core
INTERFACE
PeripheralPins.c
device/system_clock.c
device/cmsis_nvic.c
${STARTUP_FILE}
)

target_include_directories(mbed-core
INTERFACE
.
device
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

if("NUCLEO_F091RC" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_NUCLEO_F091RC)
endif()

if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_stm32f091xc.S)
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/STM32F091XC.ld)
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
set(STARTUP_FILE device/TOOLCHAIN_ARM/startup_stm32f091xc.S)
set(LINKER_FILE device/TOOLCHAIN_ARM/stm32f091rc.sct)
endif()

set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})

target_sources(mbed-core
INTERFACE
device/cmsis_nvic.c
device/system_clock.c
${STARTUP_FILE}
)

target_include_directories(mbed-core
INTERFACE
.
device
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

target_sources(mbed-core
INTERFACE
PeripheralPins.c
)

target_include_directories(mbed-core
INTERFACE
.
)
25 changes: 25 additions & 0 deletions targets/TARGET_STM/TARGET_STM32F1/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

if("STM32F103x8" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_STM32F103x8)
elseif("STM32F103xB" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_STM32F103xB)
endif()

target_sources(mbed-core
INTERFACE
analogin_device.c
flash_api.c
gpio_irq_device.c
pwmout_device.c
serial_device.c
spi_api.c
)

add_subdirectory(STM32Cube_FW)

target_include_directories(mbed-core
INTERFACE
.
)
74 changes: 74 additions & 0 deletions targets/TARGET_STM/TARGET_STM32F1/STM32Cube_FW/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

target_sources(mbed-core
INTERFACE
STM32F1xx_HAL_Driver/Legacy/stm32f1xx_hal_can_legacy.c
STM32F1xx_HAL_Driver/stm32f1xx_hal.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_adc.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_adc_ex.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_can.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_cec.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_cortex.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_crc.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_dac.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_dac_ex.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_dma.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_eth.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_exti.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_flash.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_flash_ex.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_gpio.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_gpio_ex.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_hcd.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_i2c.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_i2s.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_irda.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_iwdg.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_mmc.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_nand.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_nor.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_pccard.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_pcd.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_pcd_ex.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_pwr.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_rcc.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_rcc_ex.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_rtc.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_rtc_ex.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_sd.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_smartcard.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_spi.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_sram.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_tim.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_tim_ex.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_uart.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_usart.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_wwdg.c
STM32F1xx_HAL_Driver/stm32f1xx_ll_adc.c
STM32F1xx_HAL_Driver/stm32f1xx_ll_crc.c
STM32F1xx_HAL_Driver/stm32f1xx_ll_dac.c
STM32F1xx_HAL_Driver/stm32f1xx_ll_dma.c
STM32F1xx_HAL_Driver/stm32f1xx_ll_exti.c
STM32F1xx_HAL_Driver/stm32f1xx_ll_fsmc.c
STM32F1xx_HAL_Driver/stm32f1xx_ll_gpio.c
STM32F1xx_HAL_Driver/stm32f1xx_ll_i2c.c
STM32F1xx_HAL_Driver/stm32f1xx_ll_pwr.c
STM32F1xx_HAL_Driver/stm32f1xx_ll_rcc.c
STM32F1xx_HAL_Driver/stm32f1xx_ll_rtc.c
STM32F1xx_HAL_Driver/stm32f1xx_ll_sdmmc.c
STM32F1xx_HAL_Driver/stm32f1xx_ll_spi.c
STM32F1xx_HAL_Driver/stm32f1xx_ll_tim.c
STM32F1xx_HAL_Driver/stm32f1xx_ll_usart.c
STM32F1xx_HAL_Driver/stm32f1xx_ll_usb.c
STM32F1xx_HAL_Driver/stm32f1xx_ll_utils.c
system_stm32f1xx.c
)

target_include_directories(mbed-core
INTERFACE
.
CMSIS
STM32F1xx_HAL_Driver
STM32F1xx_HAL_Driver/Legacy
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
set(STARTUP_FILE TOOLCHAIN_GCC_ARM/startup_stm32f103xb.S)
set(LINKER_FILE TOOLCHAIN_GCC_ARM/stm32f103x8.ld)
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32f103xb.S)
set(LINKER_FILE TOOLCHAIN_ARM/stm32f103x8.sct)
endif()

set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})

target_sources(mbed-core
INTERFACE
system_clock.c
${STARTUP_FILE}
)

target_include_directories(mbed-core
INTERFACE
.
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
set(STARTUP_FILE TOOLCHAIN_GCC_ARM/startup_stm32f103xb.S)
set(LINKER_FILE TOOLCHAIN_GCC_ARM/stm32f103xb.ld)
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32f103xb.S)
set(LINKER_FILE TOOLCHAIN_ARM/stm32f103xb.sct)
endif()

set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})

target_sources(mbed-core
INTERFACE
system_clock.c
${STARTUP_FILE}
)

target_include_directories(mbed-core
INTERFACE
.
)
Loading