CMake: Add support for NUCLEO_F401RE

pull/13566/head
Hugues Kamba 2020-09-18 15:11:34 +01:00
parent 4c22554bed
commit 22dd57b35b
4 changed files with 50 additions and 2 deletions

View File

@ -0,0 +1,34 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
function(_mbed_get_assembly_stm32f401xe)
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
set(STARTUP_FILE TOOLCHAIN_GCC_ARM/startup_stm32f401xe.S)
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32f401xe.S)
elseif(${MBED_TOOLCHAIN} STREQUAL "IAR")
set(STARTUP_FILE TOOLCHAIN_IAR/startup_stm32f401xe.S)
endif()
target_sources(mbed-os PRIVATE ${STARTUP_FILE})
endfunction()
function(_mbed_set_linker_file)
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
set(LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/TOOLCHAIN_GCC_ARM/STM32F401XE.ld)
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
set(LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/TOOLCHAIN_ARM/stm32f401xe.sct)
elseif(${MBED_TOOLCHAIN} STREQUAL "IAR")
set(LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/TOOLCHAIN_IAR/stm32f401xe.icf)
endif()
set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${LINKER_FILE})
endfunction()
_mbed_get_assembly_stm32f401xe()
_mbed_set_linker_file()
mbed_add_cmake_directory_if_labels("TARGET")
target_include_directories(mbed-os
PUBLIC
.
)

View File

@ -0,0 +1,13 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
target_include_directories(mbed-os
PUBLIC
.
)
target_sources(mbed-os
PRIVATE
PeripheralPins.c
system_clock.c
)

View File

@ -1,4 +1,4 @@
#! armcc -E
#! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m4
; Scatter-Loading Description File
;
; SPDX-License-Identifier: BSD-3-Clause

View File

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