Skip to content

Commit 6582c0a

Browse files
committed
CMake: add STM32F3 targets
1 parent 9933b7d commit 6582c0a

File tree

11 files changed

+213
-115
lines changed

11 files changed

+213
-115
lines changed

targets/TARGET_STM/TARGET_STM32F3/CMakeLists.txt

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

4-
if("STM32F303x8" IN_LIST MBED_TARGET_LABELS)
5-
add_subdirectory(TARGET_STM32F303x8)
4+
if("STM32F302x8" IN_LIST MBED_TARGET_LABELS)
5+
add_subdirectory(TARGET_STM32F302x8)
6+
elseif("TARGET_STM32F303x8" IN_LIST MBED_TARGET_LABELS)
7+
add_subdirectory(TARGET_TARGET_STM32F303x8)
8+
elseif("STM32F303xC" IN_LIST MBED_TARGET_LABELS)
9+
add_subdirectory(TARGET_STM32F303xC)
10+
elseif("STM32F303xE" IN_LIST MBED_TARGET_LABELS)
11+
add_subdirectory(TARGET_STM32F303xE)
12+
elseif("STM32F334x8" IN_LIST MBED_TARGET_LABELS)
13+
add_subdirectory(TARGET_STM32F334x8)
614
endif()
715

8-
add_subdirectory(device)
16+
add_subdirectory(STM32Cube_FW)
917

1018
target_include_directories(mbed-core
1119
INTERFACE
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
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+
STM32F3xx_HAL_Driver/Legacy/stm32f3xx_hal_can_legacy.c
7+
STM32F3xx_HAL_Driver/stm32f3xx_hal.c
8+
STM32F3xx_HAL_Driver/stm32f3xx_hal_adc.c
9+
STM32F3xx_HAL_Driver/stm32f3xx_hal_adc_ex.c
10+
STM32F3xx_HAL_Driver/stm32f3xx_hal_can.c
11+
STM32F3xx_HAL_Driver/stm32f3xx_hal_cec.c
12+
STM32F3xx_HAL_Driver/stm32f3xx_hal_comp.c
13+
STM32F3xx_HAL_Driver/stm32f3xx_hal_cortex.c
14+
STM32F3xx_HAL_Driver/stm32f3xx_hal_crc.c
15+
STM32F3xx_HAL_Driver/stm32f3xx_hal_crc_ex.c
16+
STM32F3xx_HAL_Driver/stm32f3xx_hal_dac.c
17+
STM32F3xx_HAL_Driver/stm32f3xx_hal_dac_ex.c
18+
STM32F3xx_HAL_Driver/stm32f3xx_hal_dma.c
19+
STM32F3xx_HAL_Driver/stm32f3xx_hal_exti.c
20+
STM32F3xx_HAL_Driver/stm32f3xx_hal_flash.c
21+
STM32F3xx_HAL_Driver/stm32f3xx_hal_flash_ex.c
22+
STM32F3xx_HAL_Driver/stm32f3xx_hal_gpio.c
23+
STM32F3xx_HAL_Driver/stm32f3xx_hal_hrtim.c
24+
STM32F3xx_HAL_Driver/stm32f3xx_hal_i2c.c
25+
STM32F3xx_HAL_Driver/stm32f3xx_hal_i2c_ex.c
26+
STM32F3xx_HAL_Driver/stm32f3xx_hal_i2s.c
27+
STM32F3xx_HAL_Driver/stm32f3xx_hal_i2s_ex.c
28+
STM32F3xx_HAL_Driver/stm32f3xx_hal_irda.c
29+
STM32F3xx_HAL_Driver/stm32f3xx_hal_iwdg.c
30+
STM32F3xx_HAL_Driver/stm32f3xx_hal_nand.c
31+
STM32F3xx_HAL_Driver/stm32f3xx_hal_nor.c
32+
STM32F3xx_HAL_Driver/stm32f3xx_hal_opamp.c
33+
STM32F3xx_HAL_Driver/stm32f3xx_hal_opamp_ex.c
34+
STM32F3xx_HAL_Driver/stm32f3xx_hal_pccard.c
35+
STM32F3xx_HAL_Driver/stm32f3xx_hal_pcd.c
36+
STM32F3xx_HAL_Driver/stm32f3xx_hal_pcd_ex.c
37+
STM32F3xx_HAL_Driver/stm32f3xx_hal_pwr.c
38+
STM32F3xx_HAL_Driver/stm32f3xx_hal_pwr_ex.c
39+
STM32F3xx_HAL_Driver/stm32f3xx_hal_rcc.c
40+
STM32F3xx_HAL_Driver/stm32f3xx_hal_rcc_ex.c
41+
STM32F3xx_HAL_Driver/stm32f3xx_hal_rtc.c
42+
STM32F3xx_HAL_Driver/stm32f3xx_hal_rtc_ex.c
43+
STM32F3xx_HAL_Driver/stm32f3xx_hal_sdadc.c
44+
STM32F3xx_HAL_Driver/stm32f3xx_hal_smartcard.c
45+
STM32F3xx_HAL_Driver/stm32f3xx_hal_smartcard_ex.c
46+
STM32F3xx_HAL_Driver/stm32f3xx_hal_smbus.c
47+
STM32F3xx_HAL_Driver/stm32f3xx_hal_spi.c
48+
STM32F3xx_HAL_Driver/stm32f3xx_hal_spi_ex.c
49+
STM32F3xx_HAL_Driver/stm32f3xx_hal_sram.c
50+
STM32F3xx_HAL_Driver/stm32f3xx_hal_tim.c
51+
STM32F3xx_HAL_Driver/stm32f3xx_hal_tim_ex.c
52+
STM32F3xx_HAL_Driver/stm32f3xx_hal_tsc.c
53+
STM32F3xx_HAL_Driver/stm32f3xx_hal_uart.c
54+
STM32F3xx_HAL_Driver/stm32f3xx_hal_uart_ex.c
55+
STM32F3xx_HAL_Driver/stm32f3xx_hal_usart.c
56+
STM32F3xx_HAL_Driver/stm32f3xx_hal_usart_ex.c
57+
STM32F3xx_HAL_Driver/stm32f3xx_hal_wwdg.c
58+
STM32F3xx_HAL_Driver/stm32f3xx_ll_adc.c
59+
STM32F3xx_HAL_Driver/stm32f3xx_ll_comp.c
60+
STM32F3xx_HAL_Driver/stm32f3xx_ll_crc.c
61+
STM32F3xx_HAL_Driver/stm32f3xx_ll_dac.c
62+
STM32F3xx_HAL_Driver/stm32f3xx_ll_dma.c
63+
STM32F3xx_HAL_Driver/stm32f3xx_ll_exti.c
64+
STM32F3xx_HAL_Driver/stm32f3xx_ll_fmc.c
65+
STM32F3xx_HAL_Driver/stm32f3xx_ll_gpio.c
66+
STM32F3xx_HAL_Driver/stm32f3xx_ll_hrtim.c
67+
STM32F3xx_HAL_Driver/stm32f3xx_ll_i2c.c
68+
STM32F3xx_HAL_Driver/stm32f3xx_ll_opamp.c
69+
STM32F3xx_HAL_Driver/stm32f3xx_ll_pwr.c
70+
STM32F3xx_HAL_Driver/stm32f3xx_ll_rcc.c
71+
STM32F3xx_HAL_Driver/stm32f3xx_ll_rtc.c
72+
STM32F3xx_HAL_Driver/stm32f3xx_ll_spi.c
73+
STM32F3xx_HAL_Driver/stm32f3xx_ll_tim.c
74+
STM32F3xx_HAL_Driver/stm32f3xx_ll_usart.c
75+
STM32F3xx_HAL_Driver/stm32f3xx_ll_usb.c
76+
STM32F3xx_HAL_Driver/stm32f3xx_ll_utils.c
77+
system_stm32f3xx.c
78+
)
79+
80+
target_include_directories(mbed-core
81+
INTERFACE
82+
.
83+
CMSIS
84+
STM32F3xx_HAL_Driver
85+
STM32F3xx_HAL_Driver/Legacy
86+
)

targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303x8/CMakeLists.txt

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,21 @@ if("NUCLEO_F303K8" IN_LIST MBED_TARGET_LABELS)
55
add_subdirectory(TARGET_NUCLEO_F303K8)
66
endif()
77

8-
add_subdirectory(device)
8+
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
9+
set(STARTUP_FILE TOOLCHAIN_GCC_ARM/startup_stm32f303x8.S)
10+
set(LINKER_FILE TOOLCHAIN_GCC_ARM/STM32F303X8.ld)
11+
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
12+
set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32f303x8.S)
13+
set(LINKER_FILE TOOLCHAIN_ARM/stm32f303x8.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+
system_clock.c
21+
${STARTUP_FILE}
22+
)
923

1024
target_include_directories(mbed-core
1125
INTERFACE

targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303x8/TARGET_NUCLEO_F303K8/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@ target_include_directories(mbed-core
99
target_sources(mbed-core
1010
INTERFACE
1111
PeripheralPins.c
12-
system_clock.c
1312
)

targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303x8/device/CMakeLists.txt

Lines changed: 0 additions & 32 deletions
This file was deleted.
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("NUCLEO_F303K8" IN_LIST MBED_TARGET_LABELS)
5+
add_subdirectory(TARGET_NUCLEO_F303K8)
6+
endif()
7+
8+
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
9+
set(STARTUP_FILE TOOLCHAIN_GCC_ARM/startup_stm32f303xc.S)
10+
set(LINKER_FILE TOOLCHAIN_GCC_ARM/STM32F303XC.ld)
11+
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
12+
set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32f303xc.S)
13+
set(LINKER_FILE TOOLCHAIN_ARM/stm32f303xc.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+
${STARTUP_FILE}
21+
)
22+
23+
target_include_directories(mbed-core
24+
INTERFACE
25+
.
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_F303RE" IN_LIST MBED_TARGET_LABELS)
5+
add_subdirectory(TARGET_NUCLEO_F303RE)
6+
elseif("NUCLEO_F303ZE" IN_LIST MBED_TARGET_LABELS)
7+
add_subdirectory(TARGET_NUCLEO_F303ZE)
8+
endif()
9+
10+
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
11+
set(STARTUP_FILE TOOLCHAIN_GCC_ARM/startup_stm32f303xe.S)
12+
set(LINKER_FILE TOOLCHAIN_GCC_ARM/STM32F303XE.ld)
13+
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
14+
set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32f303xe.S)
15+
set(LINKER_FILE TOOLCHAIN_ARM/stm32f303xe.sct)
16+
endif()
17+
18+
set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
19+
20+
target_sources(mbed-core
21+
INTERFACE
22+
system_clock.c
23+
${STARTUP_FILE}
24+
)
25+
26+
target_include_directories(mbed-core
27+
INTERFACE
28+
.
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: 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: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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_stm32f334x8.S)
6+
set(LINKER_FILE TOOLCHAIN_GCC_ARM/STM32F334X8.ld)
7+
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
8+
set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32f334x8.S)
9+
set(LINKER_FILE TOOLCHAIN_ARM/stm32f334x8.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+
${STARTUP_FILE}
17+
)
18+
19+
target_include_directories(mbed-core
20+
INTERFACE
21+
.
22+
)

0 commit comments

Comments
 (0)