Skip to content

Commit 8ef0087

Browse files
committed
CMake: Add support for Freescale KLXX targets
All Freescale KLXX targets supported by Mbed OS can now be built with CMake.
1 parent b20278a commit 8ef0087

File tree

6 files changed

+101
-3
lines changed

6 files changed

+101
-3
lines changed

targets/TARGET_Freescale/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Copyright (c) 2020 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
if("MCUXpresso_MCUS" IN_LIST MBED_TARGET_LABELS)
4+
if("KLXX" IN_LIST MBED_TARGET_LABELS)
5+
add_subdirectory(TARGET_KLXX)
6+
elseif("MCUXpresso_MCUS" IN_LIST MBED_TARGET_LABELS)
57
add_subdirectory(TARGET_MCUXpresso_MCUS)
68
endif()
79

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if("KL25Z" IN_LIST MBED_TARGET_LABELS)
5+
add_subdirectory(TARGET_KL25Z)
6+
elseif("KL46Z" IN_LIST MBED_TARGET_LABELS)
7+
add_subdirectory(TARGET_KL46Z)
8+
endif()
9+
10+
target_include_directories(mbed-core
11+
INTERFACE
12+
.
13+
)
14+
15+
target_sources(mbed-core
16+
INTERFACE
17+
analogin_api.c
18+
analogout_api.c
19+
gpio_api.c
20+
i2c_api.c
21+
pinmap.c
22+
port_api.c
23+
pwmout_api.c
24+
rtc_api.c
25+
sleep.c
26+
us_ticker.c
27+
)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if(${MBED_TOOLCHAIN} STREQUAL "ARM")
5+
set(LINKER_FILE device/TOOLCHAIN_ARM_STD/MKL25Z4.sct)
6+
set(STARTUP_FILE device/TOOLCHAIN_ARM_STD/startup_MKL25Z4.S)
7+
elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
8+
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/MKL25Z4.ld)
9+
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_MKL25Z4.S)
10+
endif()
11+
12+
set_property(
13+
GLOBAL PROPERTY
14+
MBED_TARGET_LINKER_FILE
15+
${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE}
16+
)
17+
18+
target_include_directories(mbed-core
19+
INTERFACE
20+
.
21+
device
22+
)
23+
24+
target_sources(mbed-core
25+
INTERFACE
26+
PeripheralPins.c
27+
gpio_irq_api.c
28+
mbed_overrides.c
29+
serial_api.c
30+
spi_api.c
31+
32+
device/system_MKL25Z4.c
33+
${STARTUP_FILE}
34+
)

targets/TARGET_Freescale/TARGET_KLXX/TARGET_KL25Z/device/TOOLCHAIN_ARM_STD/MKL25Z4.sct

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! armcc -E
1+
#! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m0plus
22

33
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
44
# if defined(MBED_BOOT_STACK_SIZE)
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if(${MBED_TOOLCHAIN} STREQUAL "ARM")
5+
set(LINKER_FILE device/TOOLCHAIN_ARM_STD/MKL46Z4.sct)
6+
set(STARTUP_FILE device/TOOLCHAIN_ARM_STD/startup_MKL46Z4.S)
7+
elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
8+
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/MKL46Z4.ld)
9+
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_MKL46Z4.S)
10+
endif()
11+
12+
set_property(
13+
GLOBAL PROPERTY
14+
MBED_TARGET_LINKER_FILE
15+
${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE}
16+
)
17+
18+
target_include_directories(mbed-core
19+
INTERFACE
20+
.
21+
device
22+
)
23+
24+
target_sources(mbed-core
25+
INTERFACE
26+
PeripheralPins.c
27+
flash_api.c
28+
gpio_irq_api.c
29+
mbed_overrides.c
30+
serial_api.c
31+
spi_api.c
32+
33+
device/system_MKL46Z4.c
34+
${STARTUP_FILE}
35+
)

targets/TARGET_Freescale/TARGET_KLXX/TARGET_KL46Z/device/TOOLCHAIN_ARM_STD/MKL46Z4.sct

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! armcc -E
1+
#! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m0plus
22

33
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
44
# if defined(MBED_BOOT_STACK_SIZE)

0 commit comments

Comments
 (0)