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
pull/13566/head
Hugues Kamba 2020-10-28 11:37:24 +00:00
parent f8a02ce5de
commit e0aa49ffcf
8 changed files with 165 additions and 4 deletions

View File

@ -1,10 +1,12 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
if("STM32F4" IN_LIST MBED_TARGET_LABELS)
if("STM32F3" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_STM32F3)
elseif("STM32F4" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_STM32F4)
elseif("STM32L4" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_STM32L4)
add_subdirectory(TARGET_STM32L4)
endif()
target_include_directories(mbed-core

View File

@ -0,0 +1,24 @@
# 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)
endif()
add_subdirectory(device)
target_include_directories(mbed-core
INTERFACE
.
)
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
)

View File

@ -0,0 +1,13 @@
# 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()
add_subdirectory(device)
target_include_directories(mbed-core
INTERFACE
.
)

View File

@ -0,0 +1,13 @@
# 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
PeripheralPins.c
system_clock.c
)

View File

@ -0,0 +1,32 @@
# 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,78 @@
# 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
)

View File

@ -16,8 +16,6 @@ target_sources(mbed-core
pwmout_device.c
serial_device.c
spi_api.c
)
add_subdirectory(STM32Cube_FW)

View File

@ -23,6 +23,7 @@ The following targets are supported:
- K64F
- K66F
- NRF52840_DK
- NUCLEO_F303K8
- NUCLEO_F401RE
- WIO_3G