CMake: add STM32F3 targets

pull/13915/head
Martin Kojtal 2020-11-17 12:37:26 +00:00
parent 9933b7d808
commit 6582c0af2c
11 changed files with 213 additions and 115 deletions

View File

@ -1,11 +1,19 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
if("STM32F303x8" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_STM32F303x8)
if("STM32F302x8" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_STM32F302x8)
elseif("TARGET_STM32F303x8" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_TARGET_STM32F303x8)
elseif("STM32F303xC" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_STM32F303xC)
elseif("STM32F303xE" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_STM32F303xE)
elseif("STM32F334x8" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_STM32F334x8)
endif()
add_subdirectory(device)
add_subdirectory(STM32Cube_FW)
target_include_directories(mbed-core
INTERFACE

View File

@ -0,0 +1,86 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
target_sources(mbed-core
INTERFACE
STM32F3xx_HAL_Driver/Legacy/stm32f3xx_hal_can_legacy.c
STM32F3xx_HAL_Driver/stm32f3xx_hal.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_adc.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_adc_ex.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_can.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_cec.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_comp.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_cortex.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_crc.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_crc_ex.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_dac.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_dac_ex.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_dma.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_exti.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_flash.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_flash_ex.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_gpio.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_hrtim.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_i2c.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_i2c_ex.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_i2s.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_i2s_ex.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_irda.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_iwdg.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_nand.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_nor.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_opamp.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_opamp_ex.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_pccard.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_pcd.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_pcd_ex.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_pwr.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_pwr_ex.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_rcc.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_rcc_ex.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_rtc.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_rtc_ex.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_sdadc.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_smartcard.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_smartcard_ex.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_smbus.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_spi.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_spi_ex.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_sram.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_tim.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_tim_ex.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_tsc.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_uart.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_uart_ex.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_usart.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_usart_ex.c
STM32F3xx_HAL_Driver/stm32f3xx_hal_wwdg.c
STM32F3xx_HAL_Driver/stm32f3xx_ll_adc.c
STM32F3xx_HAL_Driver/stm32f3xx_ll_comp.c
STM32F3xx_HAL_Driver/stm32f3xx_ll_crc.c
STM32F3xx_HAL_Driver/stm32f3xx_ll_dac.c
STM32F3xx_HAL_Driver/stm32f3xx_ll_dma.c
STM32F3xx_HAL_Driver/stm32f3xx_ll_exti.c
STM32F3xx_HAL_Driver/stm32f3xx_ll_fmc.c
STM32F3xx_HAL_Driver/stm32f3xx_ll_gpio.c
STM32F3xx_HAL_Driver/stm32f3xx_ll_hrtim.c
STM32F3xx_HAL_Driver/stm32f3xx_ll_i2c.c
STM32F3xx_HAL_Driver/stm32f3xx_ll_opamp.c
STM32F3xx_HAL_Driver/stm32f3xx_ll_pwr.c
STM32F3xx_HAL_Driver/stm32f3xx_ll_rcc.c
STM32F3xx_HAL_Driver/stm32f3xx_ll_rtc.c
STM32F3xx_HAL_Driver/stm32f3xx_ll_spi.c
STM32F3xx_HAL_Driver/stm32f3xx_ll_tim.c
STM32F3xx_HAL_Driver/stm32f3xx_ll_usart.c
STM32F3xx_HAL_Driver/stm32f3xx_ll_usb.c
STM32F3xx_HAL_Driver/stm32f3xx_ll_utils.c
system_stm32f3xx.c
)
target_include_directories(mbed-core
INTERFACE
.
CMSIS
STM32F3xx_HAL_Driver
STM32F3xx_HAL_Driver/Legacy
)

View File

@ -5,7 +5,21 @@ if("NUCLEO_F303K8" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_NUCLEO_F303K8)
endif()
add_subdirectory(device)
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
set(STARTUP_FILE TOOLCHAIN_GCC_ARM/startup_stm32f303x8.S)
set(LINKER_FILE TOOLCHAIN_GCC_ARM/STM32F303X8.ld)
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32f303x8.S)
set(LINKER_FILE TOOLCHAIN_ARM/stm32f303x8.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

View File

@ -9,5 +9,4 @@ target_include_directories(mbed-core
target_sources(mbed-core
INTERFACE
PeripheralPins.c
system_clock.c
)

View File

@ -1,32 +0,0 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
function(_mbed_get_assembly_stm32f303x8)
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
set(STARTUP_FILE TOOLCHAIN_GCC_ARM/startup_stm32f303x8.S)
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32f303x8.S)
elseif(${MBED_TOOLCHAIN} STREQUAL "IAR")
set(STARTUP_FILE TOOLCHAIN_IAR/startup_stm32f303x8.S)
endif()
target_sources(mbed-core INTERFACE ${STARTUP_FILE})
endfunction()
function(_mbed_set_linker_file)
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
set(LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/TOOLCHAIN_GCC_ARM/STM32F303X8.ld)
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
set(LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/TOOLCHAIN_ARM/stm32f303x8.sct)
elseif(${MBED_TOOLCHAIN} STREQUAL "IAR")
set(LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/TOOLCHAIN_IAR/stm32f303x8.icf)
endif()
set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${LINKER_FILE})
endfunction()
_mbed_get_assembly_stm32f303x8()
_mbed_set_linker_file()
target_include_directories(mbed-core
INTERFACE
.
)

View File

@ -0,0 +1,26 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
if("NUCLEO_F303K8" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_NUCLEO_F303K8)
endif()
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
set(STARTUP_FILE TOOLCHAIN_GCC_ARM/startup_stm32f303xc.S)
set(LINKER_FILE TOOLCHAIN_GCC_ARM/STM32F303XC.ld)
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32f303xc.S)
set(LINKER_FILE TOOLCHAIN_ARM/stm32f303xc.sct)
endif()
set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
target_sources(mbed-core
INTERFACE
${STARTUP_FILE}
)
target_include_directories(mbed-core
INTERFACE
.
)

View File

@ -0,0 +1,29 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
if("NUCLEO_F303RE" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_NUCLEO_F303RE)
elseif("NUCLEO_F303ZE" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_NUCLEO_F303ZE)
endif()
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
set(STARTUP_FILE TOOLCHAIN_GCC_ARM/startup_stm32f303xe.S)
set(LINKER_FILE TOOLCHAIN_GCC_ARM/STM32F303XE.ld)
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32f303xe.S)
set(LINKER_FILE TOOLCHAIN_ARM/stm32f303xe.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
.
)

View File

@ -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
.
)

View File

@ -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
.
)

View File

@ -0,0 +1,22 @@
# 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_stm32f334x8.S)
set(LINKER_FILE TOOLCHAIN_GCC_ARM/STM32F334X8.ld)
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32f334x8.S)
set(LINKER_FILE TOOLCHAIN_ARM/stm32f334x8.sct)
endif()
set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
target_sources(mbed-core
INTERFACE
${STARTUP_FILE}
)
target_include_directories(mbed-core
INTERFACE
.
)

View File

@ -1,78 +0,0 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
target_include_directories(mbed-core
INTERFACE
.
)
target_sources(mbed-core
INTERFACE
stm32f3xx_hal.c
stm32f3xx_hal_adc.c
stm32f3xx_hal_adc_ex.c
stm32f3xx_hal_can.c
stm32f3xx_hal_cec.c
stm32f3xx_hal_comp.c
stm32f3xx_hal_cortex.c
stm32f3xx_hal_crc.c
stm32f3xx_hal_crc_ex.c
stm32f3xx_hal_dac.c
stm32f3xx_hal_dac_ex.c
stm32f3xx_hal_dma.c
stm32f3xx_hal_flash.c
stm32f3xx_hal_flash_ex.c
stm32f3xx_hal_gpio.c
stm32f3xx_hal_hrtim.c
stm32f3xx_hal_i2c.c
stm32f3xx_hal_i2c_ex.c
stm32f3xx_hal_i2s_ex.c
stm32f3xx_hal_irda.c
stm32f3xx_hal_iwdg.c
stm32f3xx_hal_nand.c
stm32f3xx_hal_nor.c
stm32f3xx_hal_opamp.c
stm32f3xx_hal_opamp_ex.c
stm32f3xx_hal_pccard.c
stm32f3xx_hal_pcd.c
stm32f3xx_hal_pcd_ex.c
stm32f3xx_hal_pwr.c
stm32f3xx_hal_pwr_ex.c
stm32f3xx_hal_rcc.c
stm32f3xx_hal_rcc_ex.c
stm32f3xx_hal_rtc.c
stm32f3xx_hal_rtc_ex.c
stm32f3xx_hal_sdadc.c
stm32f3xx_hal_smartcard.c
stm32f3xx_hal_smartcard_ex.c
stm32f3xx_hal_smbus.c
stm32f3xx_hal_spi.c
stm32f3xx_hal_spi_ex.c
stm32f3xx_hal_sram.c
stm32f3xx_hal_tim.c
stm32f3xx_hal_tim_ex.c
stm32f3xx_hal_tsc.c
stm32f3xx_hal_uart.c
stm32f3xx_hal_uart_ex.c
stm32f3xx_hal_usart.c
stm32f3xx_hal_wwdg.c
stm32f3xx_ll_adc.c
stm32f3xx_ll_comp.c
stm32f3xx_ll_crc.c
stm32f3xx_ll_dac.c
stm32f3xx_ll_dma.c
stm32f3xx_ll_exti.c
stm32f3xx_ll_fmc.c
stm32f3xx_ll_gpio.c
stm32f3xx_ll_hrtim.c
stm32f3xx_ll_i2c.c
stm32f3xx_ll_opamp.c
stm32f3xx_ll_pwr.c
stm32f3xx_ll_rcc.c
stm32f3xx_ll_rtc.c
stm32f3xx_ll_spi.c
stm32f3xx_ll_tim.c
stm32f3xx_ll_usart.c
stm32f3xx_ll_utils.c
system_stm32f3xx.c
)