Skip to content

Commit 42b948a

Browse files
hugueskamba0xc0170
authored andcommitted
CMake: Add support for SiLabs EFR32MG12 targets
1 parent 02a70d2 commit 42b948a

File tree

2 files changed

+33
-1
lines changed

2 files changed

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

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFR32MG12/device/TOOLCHAIN_ARM_STD/efr32mg12p.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-m4
22
; *************************************************************
33
; *** Scatter-Loading Description File generated by uVision ***
44
; *************************************************************

0 commit comments

Comments
 (0)