CMake: add STM32F1 targets

pull/13915/head
Martin Kojtal 2020-11-17 11:59:44 +00:00
parent f05db1b47a
commit 81b61b2090
4 changed files with 144 additions and 0 deletions

View File

@ -0,0 +1,25 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
if("STM32F103x8" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_STM32F103x8)
elseif("STM32F103xB" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_STM32F103xB)
endif()
target_sources(mbed-core
INTERFACE
analogin_device.c
flash_api.c
gpio_irq_device.c
pwmout_device.c
serial_device.c
spi_api.c
)
add_subdirectory(STM32Cube_FW)
target_include_directories(mbed-core
INTERFACE
.
)

View File

@ -0,0 +1,73 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
target_sources(mbed-core
INTERFACE
STM32F1xx_HAL_Driver/Legacy/stm32f1xx_hal_can_legacy.c
STM32F1xx_HAL_Driver/stm32f1xx_hal.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_adc.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_adc_ex.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_can.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_cec.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_cortex.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_crc.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_dac.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_dac_ex.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_dma.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_eth.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_exti.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_flash.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_flash_ex.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_gpio.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_gpio_ex.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_hcd.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_i2c.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_i2s.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_irda.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_iwdg.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_mmc.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_nand.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_nor.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_pccard.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_pcd.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_pcd_ex.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_pwr.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_rcc.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_rcc_ex.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_rtc.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_rtc_ex.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_sd.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_smartcard.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_spi.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_sram.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_tim.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_tim_ex.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_uart.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_usart.c
STM32F1xx_HAL_Driver/stm32f1xx_hal_wwdg.c
STM32F1xx_HAL_Driver/stm32f1xx_ll_adc.c
STM32F1xx_HAL_Driver/stm32f1xx_ll_crc.c
STM32F1xx_HAL_Driver/stm32f1xx_ll_dac.c
STM32F1xx_HAL_Driver/stm32f1xx_ll_dma.c
STM32F1xx_HAL_Driver/stm32f1xx_ll_exti.c
STM32F1xx_HAL_Driver/stm32f1xx_ll_fsmc.c
STM32F1xx_HAL_Driver/stm32f1xx_ll_gpio.c
STM32F1xx_HAL_Driver/stm32f1xx_ll_i2c.c
STM32F1xx_HAL_Driver/stm32f1xx_ll_pwr.c
STM32F1xx_HAL_Driver/stm32f1xx_ll_rcc.c
STM32F1xx_HAL_Driver/stm32f1xx_ll_rtc.c
STM32F1xx_HAL_Driver/stm32f1xx_ll_sdmmc.c
STM32F1xx_HAL_Driver/stm32f1xx_ll_spi.c
STM32F1xx_HAL_Driver/stm32f1xx_ll_tim.c
STM32F1xx_HAL_Driver/stm32f1xx_ll_usart.c
STM32F1xx_HAL_Driver/stm32f1xx_ll_usb.c
STM32F1xx_HAL_Driver/stm32f1xx_ll_utils.c
system_stm32f1xx.c
)
target_include_directories(mbed-core
INTERFACE
.
CMSIS
Legacy
)

View File

@ -0,0 +1,23 @@
# 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_stm32f103xb.S)
set(LINKER_FILE TOOLCHAIN_GCC_ARM/stm32f103x8.ld)
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32f103xb.S)
set(LINKER_FILE TOOLCHAIN_ARM/stm32f103x8.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,23 @@
# 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_stm32f103xb.S)
set(LINKER_FILE TOOLCHAIN_GCC_ARM/stm32f103xb.ld)
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32f103xb.S)
set(LINKER_FILE TOOLCHAIN_ARM/stm32f103xb.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
.
)