CMake: add STM32F0 targets

pull/13915/head
Martin Kojtal 2020-11-17 11:43:09 +00:00
parent 66c05ddbf8
commit f05db1b47a
6 changed files with 201 additions and 1 deletions

View File

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

View File

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

View File

@ -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 TOOLCHAIN_GCC_ARM/startup_stm32f070xb.S)
set(LINKER_FILE TOOLCHAIN_GCC_ARM/STM32F070XB.ld)
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32f070xb.S)
set(LINKER_FILE 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
)

View File

@ -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 TOOLCHAIN_GCC_ARM/startup_stm32f072xb.S)
set(LINKER_FILE TOOLCHAIN_GCC_ARM/STM32F072XB.ld)
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32f072xb.S)
set(LINKER_FILE 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
)

View File

@ -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 TOOLCHAIN_GCC_ARM/startup_stm32f091xc.S)
set(LINKER_FILE TOOLCHAIN_GCC_ARM/STM32F091XC.ld)
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32f091xc.S)
set(LINKER_FILE 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
)

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