Skip to content

Commit a1fc9cd

Browse files
authored
Merge pull request #13915 from 0xc0170/cmake-stm32
CMake: add all TARGET_STM targets
2 parents 59c03e1 + 46673da commit a1fc9cd

File tree

154 files changed

+3860
-147
lines changed

Some content is hidden

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

154 files changed

+3860
-147
lines changed

targets/TARGET_STM/CMakeLists.txt

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,34 @@
11
# Copyright (c) 2020 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
if("STM32F3" IN_LIST MBED_TARGET_LABELS)
4+
if("STM32F0" IN_LIST MBED_TARGET_LABELS)
5+
add_subdirectory(TARGET_STM32F0)
6+
elseif("STM32F1" IN_LIST MBED_TARGET_LABELS)
7+
add_subdirectory(TARGET_STM32F1)
8+
elseif("STM32F2" IN_LIST MBED_TARGET_LABELS)
9+
add_subdirectory(TARGET_STM32F2)
10+
elseif("STM32F3" IN_LIST MBED_TARGET_LABELS)
511
add_subdirectory(TARGET_STM32F3)
612
elseif("STM32F4" IN_LIST MBED_TARGET_LABELS)
713
add_subdirectory(TARGET_STM32F4)
14+
elseif("STM32F7" IN_LIST MBED_TARGET_LABELS)
15+
add_subdirectory(TARGET_STM32F7)
16+
elseif("STM32G0" IN_LIST MBED_TARGET_LABELS)
17+
add_subdirectory(TARGET_STM32G0)
18+
elseif("STM32G4" IN_LIST MBED_TARGET_LABELS)
19+
add_subdirectory(TARGET_STM32G4)
20+
elseif("STM32H7" IN_LIST MBED_TARGET_LABELS)
21+
add_subdirectory(TARGET_STM32H7)
22+
elseif("STM32L0" IN_LIST MBED_TARGET_LABELS)
23+
add_subdirectory(TARGET_STM32L0)
24+
elseif("STM32L1" IN_LIST MBED_TARGET_LABELS)
25+
add_subdirectory(TARGET_STM32L1)
826
elseif("STM32L4" IN_LIST MBED_TARGET_LABELS)
927
add_subdirectory(TARGET_STM32L4)
28+
elseif("STM32L5" IN_LIST MBED_TARGET_LABELS)
29+
add_subdirectory(TARGET_STM32L5)
30+
elseif("STM32WB" IN_LIST MBED_TARGET_LABELS)
31+
add_subdirectory(TARGET_STM32WB)
1032
endif()
1133

1234
target_include_directories(mbed-core
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if("STM32F091xC" IN_LIST MBED_TARGET_LABELS)
5+
add_subdirectory(TARGET_STM32F091xC)
6+
elseif("NUCLEO_F070RB" IN_LIST MBED_TARGET_LABELS)
7+
add_subdirectory(TARGET_NUCLEO_F070RB)
8+
elseif("NUCLEO_F072RB" IN_LIST MBED_TARGET_LABELS)
9+
add_subdirectory(TARGET_NUCLEO_F072RB)
10+
endif()
11+
12+
target_sources(mbed-core
13+
INTERFACE
14+
analogin_device.c
15+
analogout_device.c
16+
flash_api.c
17+
gpio_irq_device.c
18+
pwmout_device.c
19+
serial_device.c
20+
spi_api.c
21+
22+
device/stm32f0xx_hal.c
23+
device/stm32f0xx_hal_adc.c
24+
device/stm32f0xx_hal_adc_ex.c
25+
device/stm32f0xx_hal_can.c
26+
device/stm32f0xx_hal_cec.c
27+
device/stm32f0xx_hal_comp.c
28+
device/stm32f0xx_hal_cortex.c
29+
device/stm32f0xx_hal_crc.c
30+
device/stm32f0xx_hal_crc_ex.c
31+
device/stm32f0xx_hal_dac.c
32+
device/stm32f0xx_hal_dac_ex.c
33+
device/stm32f0xx_hal_dma.c
34+
device/stm32f0xx_hal_flash.c
35+
device/stm32f0xx_hal_flash_ex.c
36+
device/stm32f0xx_hal_gpio.c
37+
device/stm32f0xx_hal_i2c.c
38+
device/stm32f0xx_hal_i2c_ex.c
39+
device/stm32f0xx_hal_i2s.c
40+
device/stm32f0xx_hal_irda.c
41+
device/stm32f0xx_hal_iwdg.c
42+
device/stm32f0xx_hal_pcd.c
43+
device/stm32f0xx_hal_pcd_ex.c
44+
device/stm32f0xx_hal_pwr.c
45+
device/stm32f0xx_hal_pwr_ex.c
46+
device/stm32f0xx_hal_rcc.c
47+
device/stm32f0xx_hal_rcc_ex.c
48+
device/stm32f0xx_hal_rtc.c
49+
device/stm32f0xx_hal_rtc_ex.c
50+
device/stm32f0xx_hal_smartcard.c
51+
device/stm32f0xx_hal_smartcard_ex.c
52+
device/stm32f0xx_hal_smbus.c
53+
device/stm32f0xx_hal_spi.c
54+
device/stm32f0xx_hal_spi_ex.c
55+
device/stm32f0xx_hal_tim.c
56+
device/stm32f0xx_hal_tim_ex.c
57+
device/stm32f0xx_hal_tsc.c
58+
device/stm32f0xx_hal_uart.c
59+
device/stm32f0xx_hal_uart_ex.c
60+
device/stm32f0xx_hal_usart.c
61+
device/stm32f0xx_hal_wwdg.c
62+
device/stm32f0xx_ll_adc.c
63+
device/stm32f0xx_ll_comp.c
64+
device/stm32f0xx_ll_crc.c
65+
device/stm32f0xx_ll_crs.c
66+
device/stm32f0xx_ll_dac.c
67+
device/stm32f0xx_ll_dma.c
68+
device/stm32f0xx_ll_exti.c
69+
device/stm32f0xx_ll_gpio.c
70+
device/stm32f0xx_ll_i2c.c
71+
device/stm32f0xx_ll_pwr.c
72+
device/stm32f0xx_ll_rcc.c
73+
device/stm32f0xx_ll_rtc.c
74+
device/stm32f0xx_ll_spi.c
75+
device/stm32f0xx_ll_tim.c
76+
device/stm32f0xx_ll_usart.c
77+
device/stm32f0xx_ll_utils.c
78+
device/system_stm32f0xx.c
79+
)
80+
81+
target_include_directories(mbed-core
82+
INTERFACE
83+
.
84+
device
85+
)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
5+
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_stm32f070xb.S)
6+
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/STM32F070XB.ld)
7+
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
8+
set(STARTUP_FILE device/TOOLCHAIN_ARM/startup_stm32f070xb.S)
9+
set(LINKER_FILE device/TOOLCHAIN_ARM/stm32f070xb.sct)
10+
endif()
11+
12+
set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
13+
14+
target_sources(mbed-core
15+
INTERFACE
16+
PeripheralPins.c
17+
device/system_clock.c
18+
device/cmsis_nvic.c
19+
${STARTUP_FILE}
20+
)
21+
22+
target_include_directories(mbed-core
23+
INTERFACE
24+
.
25+
device
26+
)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
5+
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_stm32f072xb.S)
6+
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/STM32F072XB.ld)
7+
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
8+
set(STARTUP_FILE device/TOOLCHAIN_ARM/startup_stm32f072xb.S)
9+
set(LINKER_FILE device/TOOLCHAIN_ARM/stm32f072xb.sct)
10+
endif()
11+
12+
set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
13+
14+
target_sources(mbed-core
15+
INTERFACE
16+
PeripheralPins.c
17+
device/system_clock.c
18+
device/cmsis_nvic.c
19+
${STARTUP_FILE}
20+
)
21+
22+
target_include_directories(mbed-core
23+
INTERFACE
24+
.
25+
device
26+
)
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if("NUCLEO_F091RC" IN_LIST MBED_TARGET_LABELS)
5+
add_subdirectory(TARGET_NUCLEO_F091RC)
6+
endif()
7+
8+
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
9+
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_stm32f091xc.S)
10+
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/STM32F091XC.ld)
11+
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
12+
set(STARTUP_FILE device/TOOLCHAIN_ARM/startup_stm32f091xc.S)
13+
set(LINKER_FILE device/TOOLCHAIN_ARM/stm32f091rc.sct)
14+
endif()
15+
16+
set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
17+
18+
target_sources(mbed-core
19+
INTERFACE
20+
device/cmsis_nvic.c
21+
device/system_clock.c
22+
${STARTUP_FILE}
23+
)
24+
25+
target_include_directories(mbed-core
26+
INTERFACE
27+
.
28+
device
29+
)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
target_sources(mbed-core
5+
INTERFACE
6+
PeripheralPins.c
7+
)
8+
9+
target_include_directories(mbed-core
10+
INTERFACE
11+
.
12+
)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if("STM32F103x8" IN_LIST MBED_TARGET_LABELS)
5+
add_subdirectory(TARGET_STM32F103x8)
6+
elseif("STM32F103xB" IN_LIST MBED_TARGET_LABELS)
7+
add_subdirectory(TARGET_STM32F103xB)
8+
endif()
9+
10+
target_sources(mbed-core
11+
INTERFACE
12+
analogin_device.c
13+
flash_api.c
14+
gpio_irq_device.c
15+
pwmout_device.c
16+
serial_device.c
17+
spi_api.c
18+
)
19+
20+
add_subdirectory(STM32Cube_FW)
21+
22+
target_include_directories(mbed-core
23+
INTERFACE
24+
.
25+
)
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
target_sources(mbed-core
5+
INTERFACE
6+
STM32F1xx_HAL_Driver/Legacy/stm32f1xx_hal_can_legacy.c
7+
STM32F1xx_HAL_Driver/stm32f1xx_hal.c
8+
STM32F1xx_HAL_Driver/stm32f1xx_hal_adc.c
9+
STM32F1xx_HAL_Driver/stm32f1xx_hal_adc_ex.c
10+
STM32F1xx_HAL_Driver/stm32f1xx_hal_can.c
11+
STM32F1xx_HAL_Driver/stm32f1xx_hal_cec.c
12+
STM32F1xx_HAL_Driver/stm32f1xx_hal_cortex.c
13+
STM32F1xx_HAL_Driver/stm32f1xx_hal_crc.c
14+
STM32F1xx_HAL_Driver/stm32f1xx_hal_dac.c
15+
STM32F1xx_HAL_Driver/stm32f1xx_hal_dac_ex.c
16+
STM32F1xx_HAL_Driver/stm32f1xx_hal_dma.c
17+
STM32F1xx_HAL_Driver/stm32f1xx_hal_eth.c
18+
STM32F1xx_HAL_Driver/stm32f1xx_hal_exti.c
19+
STM32F1xx_HAL_Driver/stm32f1xx_hal_flash.c
20+
STM32F1xx_HAL_Driver/stm32f1xx_hal_flash_ex.c
21+
STM32F1xx_HAL_Driver/stm32f1xx_hal_gpio.c
22+
STM32F1xx_HAL_Driver/stm32f1xx_hal_gpio_ex.c
23+
STM32F1xx_HAL_Driver/stm32f1xx_hal_hcd.c
24+
STM32F1xx_HAL_Driver/stm32f1xx_hal_i2c.c
25+
STM32F1xx_HAL_Driver/stm32f1xx_hal_i2s.c
26+
STM32F1xx_HAL_Driver/stm32f1xx_hal_irda.c
27+
STM32F1xx_HAL_Driver/stm32f1xx_hal_iwdg.c
28+
STM32F1xx_HAL_Driver/stm32f1xx_hal_mmc.c
29+
STM32F1xx_HAL_Driver/stm32f1xx_hal_nand.c
30+
STM32F1xx_HAL_Driver/stm32f1xx_hal_nor.c
31+
STM32F1xx_HAL_Driver/stm32f1xx_hal_pccard.c
32+
STM32F1xx_HAL_Driver/stm32f1xx_hal_pcd.c
33+
STM32F1xx_HAL_Driver/stm32f1xx_hal_pcd_ex.c
34+
STM32F1xx_HAL_Driver/stm32f1xx_hal_pwr.c
35+
STM32F1xx_HAL_Driver/stm32f1xx_hal_rcc.c
36+
STM32F1xx_HAL_Driver/stm32f1xx_hal_rcc_ex.c
37+
STM32F1xx_HAL_Driver/stm32f1xx_hal_rtc.c
38+
STM32F1xx_HAL_Driver/stm32f1xx_hal_rtc_ex.c
39+
STM32F1xx_HAL_Driver/stm32f1xx_hal_sd.c
40+
STM32F1xx_HAL_Driver/stm32f1xx_hal_smartcard.c
41+
STM32F1xx_HAL_Driver/stm32f1xx_hal_spi.c
42+
STM32F1xx_HAL_Driver/stm32f1xx_hal_sram.c
43+
STM32F1xx_HAL_Driver/stm32f1xx_hal_tim.c
44+
STM32F1xx_HAL_Driver/stm32f1xx_hal_tim_ex.c
45+
STM32F1xx_HAL_Driver/stm32f1xx_hal_uart.c
46+
STM32F1xx_HAL_Driver/stm32f1xx_hal_usart.c
47+
STM32F1xx_HAL_Driver/stm32f1xx_hal_wwdg.c
48+
STM32F1xx_HAL_Driver/stm32f1xx_ll_adc.c
49+
STM32F1xx_HAL_Driver/stm32f1xx_ll_crc.c
50+
STM32F1xx_HAL_Driver/stm32f1xx_ll_dac.c
51+
STM32F1xx_HAL_Driver/stm32f1xx_ll_dma.c
52+
STM32F1xx_HAL_Driver/stm32f1xx_ll_exti.c
53+
STM32F1xx_HAL_Driver/stm32f1xx_ll_fsmc.c
54+
STM32F1xx_HAL_Driver/stm32f1xx_ll_gpio.c
55+
STM32F1xx_HAL_Driver/stm32f1xx_ll_i2c.c
56+
STM32F1xx_HAL_Driver/stm32f1xx_ll_pwr.c
57+
STM32F1xx_HAL_Driver/stm32f1xx_ll_rcc.c
58+
STM32F1xx_HAL_Driver/stm32f1xx_ll_rtc.c
59+
STM32F1xx_HAL_Driver/stm32f1xx_ll_sdmmc.c
60+
STM32F1xx_HAL_Driver/stm32f1xx_ll_spi.c
61+
STM32F1xx_HAL_Driver/stm32f1xx_ll_tim.c
62+
STM32F1xx_HAL_Driver/stm32f1xx_ll_usart.c
63+
STM32F1xx_HAL_Driver/stm32f1xx_ll_usb.c
64+
STM32F1xx_HAL_Driver/stm32f1xx_ll_utils.c
65+
system_stm32f1xx.c
66+
)
67+
68+
target_include_directories(mbed-core
69+
INTERFACE
70+
.
71+
CMSIS
72+
STM32F1xx_HAL_Driver
73+
STM32F1xx_HAL_Driver/Legacy
74+
)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
5+
set(STARTUP_FILE TOOLCHAIN_GCC_ARM/startup_stm32f103xb.S)
6+
set(LINKER_FILE TOOLCHAIN_GCC_ARM/stm32f103x8.ld)
7+
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
8+
set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32f103xb.S)
9+
set(LINKER_FILE TOOLCHAIN_ARM/stm32f103x8.sct)
10+
endif()
11+
12+
set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
13+
14+
target_sources(mbed-core
15+
INTERFACE
16+
system_clock.c
17+
${STARTUP_FILE}
18+
)
19+
20+
target_include_directories(mbed-core
21+
INTERFACE
22+
.
23+
)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
5+
set(STARTUP_FILE TOOLCHAIN_GCC_ARM/startup_stm32f103xb.S)
6+
set(LINKER_FILE TOOLCHAIN_GCC_ARM/stm32f103xb.ld)
7+
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
8+
set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32f103xb.S)
9+
set(LINKER_FILE TOOLCHAIN_ARM/stm32f103xb.sct)
10+
endif()
11+
12+
set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
13+
14+
target_sources(mbed-core
15+
INTERFACE
16+
system_clock.c
17+
${STARTUP_FILE}
18+
)
19+
20+
target_include_directories(mbed-core
21+
INTERFACE
22+
.
23+
)

0 commit comments

Comments
 (0)