Skip to content

Commit ae99313

Browse files
committed
CMake: Add support for NUCLEO_F303K8
Added the board so it can be used for testing the bare-metal profile on a Mbed 2 board
1 parent d6a4e35 commit ae99313

File tree

8 files changed

+165
-4
lines changed

8 files changed

+165
-4
lines changed

targets/TARGET_STM/CMakeLists.txt

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

4-
if("STM32F4" IN_LIST MBED_TARGET_LABELS)
4+
if("STM32F3" IN_LIST MBED_TARGET_LABELS)
5+
add_subdirectory(TARGET_STM32F3)
6+
elseif("STM32F4" IN_LIST MBED_TARGET_LABELS)
57
add_subdirectory(TARGET_STM32F4)
68
elseif("STM32L4" IN_LIST MBED_TARGET_LABELS)
7-
add_subdirectory(TARGET_STM32L4)
9+
add_subdirectory(TARGET_STM32L4)
810
endif()
911

1012
target_include_directories(mbed-core
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if("STM32F303x8" IN_LIST MBED_TARGET_LABELS)
5+
add_subdirectory(TARGET_STM32F303x8)
6+
endif()
7+
8+
add_subdirectory(device)
9+
10+
target_include_directories(mbed-core
11+
INTERFACE
12+
.
13+
)
14+
15+
target_sources(mbed-core
16+
INTERFACE
17+
analogin_device.c
18+
analogout_device.c
19+
flash_api.c
20+
gpio_irq_device.c
21+
pwmout_device.c
22+
serial_device.c
23+
spi_api.c
24+
)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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+
add_subdirectory(device)
9+
10+
target_include_directories(mbed-core
11+
INTERFACE
12+
.
13+
)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
target_include_directories(mbed-core
5+
INTERFACE
6+
.
7+
)
8+
9+
target_sources(mbed-core
10+
INTERFACE
11+
PeripheralPins.c
12+
system_clock.c
13+
)
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
function(_mbed_get_assembly_stm32f303x8)
5+
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
6+
set(STARTUP_FILE TOOLCHAIN_GCC_ARM/startup_stm32f303x8.S)
7+
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
8+
set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32f303x8.S)
9+
elseif(${MBED_TOOLCHAIN} STREQUAL "IAR")
10+
set(STARTUP_FILE TOOLCHAIN_IAR/startup_stm32f303x8.S)
11+
endif()
12+
target_sources(mbed-core INTERFACE ${STARTUP_FILE})
13+
endfunction()
14+
15+
function(_mbed_set_linker_file)
16+
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
17+
set(LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/TOOLCHAIN_GCC_ARM/STM32F303X8.ld)
18+
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
19+
set(LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/TOOLCHAIN_ARM/stm32f303x8.sct)
20+
elseif(${MBED_TOOLCHAIN} STREQUAL "IAR")
21+
set(LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/TOOLCHAIN_IAR/stm32f303x8.icf)
22+
endif()
23+
set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${LINKER_FILE})
24+
endfunction()
25+
26+
_mbed_get_assembly_stm32f303x8()
27+
_mbed_set_linker_file()
28+
29+
target_include_directories(mbed-core
30+
INTERFACE
31+
.
32+
)
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
target_include_directories(mbed-core
5+
INTERFACE
6+
.
7+
)
8+
9+
target_sources(mbed-core
10+
INTERFACE
11+
stm32f3xx_hal.c
12+
stm32f3xx_hal_adc.c
13+
stm32f3xx_hal_adc_ex.c
14+
stm32f3xx_hal_can.c
15+
stm32f3xx_hal_cec.c
16+
stm32f3xx_hal_comp.c
17+
stm32f3xx_hal_cortex.c
18+
stm32f3xx_hal_crc.c
19+
stm32f3xx_hal_crc_ex.c
20+
stm32f3xx_hal_dac.c
21+
stm32f3xx_hal_dac_ex.c
22+
stm32f3xx_hal_dma.c
23+
stm32f3xx_hal_flash.c
24+
stm32f3xx_hal_flash_ex.c
25+
stm32f3xx_hal_gpio.c
26+
stm32f3xx_hal_hrtim.c
27+
stm32f3xx_hal_i2c.c
28+
stm32f3xx_hal_i2c_ex.c
29+
stm32f3xx_hal_i2s_ex.c
30+
stm32f3xx_hal_irda.c
31+
stm32f3xx_hal_iwdg.c
32+
stm32f3xx_hal_nand.c
33+
stm32f3xx_hal_nor.c
34+
stm32f3xx_hal_opamp.c
35+
stm32f3xx_hal_opamp_ex.c
36+
stm32f3xx_hal_pccard.c
37+
stm32f3xx_hal_pcd.c
38+
stm32f3xx_hal_pcd_ex.c
39+
stm32f3xx_hal_pwr.c
40+
stm32f3xx_hal_pwr_ex.c
41+
stm32f3xx_hal_rcc.c
42+
stm32f3xx_hal_rcc_ex.c
43+
stm32f3xx_hal_rtc.c
44+
stm32f3xx_hal_rtc_ex.c
45+
stm32f3xx_hal_sdadc.c
46+
stm32f3xx_hal_smartcard.c
47+
stm32f3xx_hal_smartcard_ex.c
48+
stm32f3xx_hal_smbus.c
49+
stm32f3xx_hal_spi.c
50+
stm32f3xx_hal_spi_ex.c
51+
stm32f3xx_hal_sram.c
52+
stm32f3xx_hal_tim.c
53+
stm32f3xx_hal_tim_ex.c
54+
stm32f3xx_hal_tsc.c
55+
stm32f3xx_hal_uart.c
56+
stm32f3xx_hal_uart_ex.c
57+
stm32f3xx_hal_usart.c
58+
stm32f3xx_hal_wwdg.c
59+
stm32f3xx_ll_adc.c
60+
stm32f3xx_ll_comp.c
61+
stm32f3xx_ll_crc.c
62+
stm32f3xx_ll_dac.c
63+
stm32f3xx_ll_dma.c
64+
stm32f3xx_ll_exti.c
65+
stm32f3xx_ll_fmc.c
66+
stm32f3xx_ll_gpio.c
67+
stm32f3xx_ll_hrtim.c
68+
stm32f3xx_ll_i2c.c
69+
stm32f3xx_ll_opamp.c
70+
stm32f3xx_ll_pwr.c
71+
stm32f3xx_ll_rcc.c
72+
stm32f3xx_ll_rtc.c
73+
stm32f3xx_ll_spi.c
74+
stm32f3xx_ll_tim.c
75+
stm32f3xx_ll_usart.c
76+
stm32f3xx_ll_utils.c
77+
system_stm32f3xx.c
78+
)

targets/TARGET_STM/TARGET_STM32F4/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ target_sources(mbed-core
1616
pwmout_device.c
1717
serial_device.c
1818
spi_api.c
19-
20-
2119
)
2220

2321
add_subdirectory(STM32Cube_FW)

tools/cmake/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ The following targets are supported:
2323
- K64F
2424
- K66F
2525
- NRF52840_DK
26+
- NUCLEO_F303K8
2627
- NUCLEO_F401RE
2728
- WIO_3G
2829

0 commit comments

Comments
 (0)