Skip to content

Commit e8614b3

Browse files
CMake: Port Renesas targets to CMake
Add targets subdirectory to high level CMake configuration file and create new configurations for MCUs and individual targets. Change the interpreter in the ARM scatter file to armclang, which is required for CMake. Remove private and public interfaces in emac target configuration. Ensure that all targets build on the arm gcc compiler and arm compiler.
1 parent 86ee300 commit e8614b3

File tree

10 files changed

+219
-3
lines changed

10 files changed

+219
-3
lines changed

targets/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ elseif("NUVOTON" IN_LIST MBED_TARGET_LABELS)
1919
add_subdirectory(TARGET_NUVOTON)
2020
elseif("NXP" IN_LIST MBED_TARGET_LABELS)
2121
add_subdirectory(TARGET_NXP)
22+
elseif("RENESAS" IN_LIST MBED_TARGET_LABELS)
23+
add_subdirectory(TARGET_RENESAS)
2224
elseif("Samsung" IN_LIST MBED_TARGET_LABELS)
2325
add_subdirectory(TARGET_Samsung)
2426
elseif("Silicon_Labs" IN_LIST MBED_TARGET_LABELS)

targets/TARGET_RENESAS/CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if ("RZ_A1XX" IN_LIST MBED_TARGET_LABELS)
5+
add_subdirectory(TARGET_RZ_A1XX)
6+
elseif("RZ_A2XX" IN_LIST MBED_TARGET_LABELS)
7+
add_subdirectory(TARGET_RZ_A2XX)
8+
endif()
9+
10+
target_include_directories(mbed-core
11+
INTERFACE
12+
.
13+
)
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if ("GR_LYCHEE" IN_LIST MBED_TARGET_LABELS)
5+
add_subdirectory(TARGET_GR_LYCHEE)
6+
elseif("RZ_A1H" IN_LIST MBED_TARGET_LABELS)
7+
add_subdirectory(TARGET_RZ_A1H)
8+
endif()
9+
10+
target_include_directories(mbed-core
11+
INTERFACE
12+
.
13+
common
14+
)
15+
16+
target_sources(mbed-core
17+
INTERFACE
18+
analogin_api.c
19+
can_api.c
20+
flash_api.c
21+
gpio_api.c
22+
gpio_irq_api.c
23+
i2c_api.c
24+
lp_ticker.c
25+
mtu2.c
26+
pinmap.c
27+
port_api.c
28+
pwmout_api.c
29+
rtc_api.c
30+
serial_api.c
31+
sleep.c
32+
spi_api.c
33+
trng_api.c
34+
us_ticker.c
35+
36+
common/rza_io_regrw.c
37+
)
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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/MBRZA1LU.sct)
6+
set(STARTUP_FILE device/TOOLCHAIN_ARM_STD/startup_RZ_A1LU.S)
7+
set(WEAK_HANDLER_FILE device/TOOLCHAIN_ARM_STD/weak_handler.S)
8+
elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
9+
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/RZA1LU.ld)
10+
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_RZ1ALU.S)
11+
set(WEAK_HANDLER_FILE device/TOOLCHAIN_GCC_ARM/weak_handler.S)
12+
endif()
13+
14+
set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
15+
16+
17+
target_include_directories(mbed-core
18+
INTERFACE
19+
.
20+
device
21+
device/inc
22+
device/inc/iobitmasks
23+
device/inc/iodefines
24+
)
25+
26+
target_sources(mbed-core
27+
INTERFACE
28+
trng_api_esp32.cpp
29+
PeripheralPins.c
30+
31+
device/RZ_A1_Init.c
32+
device/cmsis_nvic.c
33+
device/mbed_sf_boot.c
34+
device/mmu_RZ_A1LU.c
35+
device/nvic_wrapper.c
36+
device/os_tick_ostm.c
37+
device/system_RZ_A1LU.c
38+
39+
${STARTUP_FILE}
40+
${WEAK_HANDLER_FILE}
41+
)
42+

targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_GR_LYCHEE/device/TOOLCHAIN_ARM_STD/MBRZA1LU.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-a9
22
;**************************************************
33
; Copyright (c) 2017 ARM Ltd. All rights reserved.
44
;**************************************************
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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/MBRZA1H.sct)
6+
set(STARTUP_FILE device/TOOLCHAIN_ARM_STD/startup_RZ_A1H.S)
7+
set(WEAK_HANDLER_FILE device/TOOLCHAIN_ARM_STD/weak_handler.S)
8+
elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
9+
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/RZA1H.ld)
10+
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_RZ1AH.S)
11+
set(WEAK_HANDLER_FILE device/TOOLCHAIN_GCC_ARM/weak_handler.S)
12+
endif()
13+
14+
set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
15+
16+
17+
target_include_directories(mbed-core
18+
INTERFACE
19+
.
20+
device
21+
device/inc
22+
device/inc/iobitmasks
23+
device/inc/iodefines
24+
)
25+
26+
target_sources(mbed-core
27+
INTERFACE
28+
PeripheralPins.c
29+
30+
device/RZ_A1_Init.c
31+
device/cmsis_nvic.c
32+
device/mbed_sf_boot.c
33+
device/mmu_RZ_A1H.c
34+
device/nvic_wrapper.c
35+
device/os_tick_ostm.c
36+
device/system_RZ_A1H.c
37+
38+
${STARTUP_FILE}
39+
${WEAK_HANDLER_FILE}
40+
)

targets/TARGET_RENESAS/TARGET_RZ_A1XX/TARGET_RZ_A1H/device/TOOLCHAIN_ARM_STD/MBRZA1H.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-a9
22
;**************************************************
33
; Copyright (c) 2017 ARM Ltd. All rights reserved.
44
;**************************************************
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if ("GR_MANGO" IN_LIST MBED_TARGET_LABELS)
5+
add_subdirectory(TARGET_GR_MANGO)
6+
endif()
7+
8+
target_include_directories(mbed-core
9+
INTERFACE
10+
.
11+
common
12+
common/r_cache/inc
13+
common/r_octabus/inc
14+
r_can/inc
15+
)
16+
17+
target_sources(mbed-core
18+
INTERFACE
19+
analogin_api.c
20+
can_api.c
21+
flash_api.c
22+
gpio_api.c
23+
gpio_irq_api.c
24+
i2c_api.c
25+
pinmap.c
26+
port_api.c
27+
pwmout_api.c
28+
rtc_api.c
29+
serial_api.c
30+
sleep.c
31+
spi_api.c
32+
us_ticker.c
33+
34+
common/r_cache/src/lld/r_cache_lld_rza2m.c
35+
common/r_octabus/src/lld/r_octabus_lld_rza2m_api.c
36+
common/r_octabus/src/lld/r_octabus_memclk_setup.c
37+
common/rza_io_regrw.c
38+
39+
r_can/src/r_can_rz.c
40+
)
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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/MBRZA1H.sct)
6+
set(STARTUP_FILE device/TOOLCHAIN_ARM_STD/startup_RZ_A2M.S)
7+
set(WEAK_HANDLER_FILE device/TOOLCHAIN_ARM_STD/weak_handler.S)
8+
elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
9+
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/RZA2M.ld)
10+
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_RZA2M.S)
11+
set(WEAK_HANDLER_FILE device/TOOLCHAIN_GCC_ARM/weak_handler.S)
12+
endif()
13+
14+
set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
15+
16+
17+
target_include_directories(mbed-core
18+
INTERFACE
19+
.
20+
device
21+
device/inc
22+
device/inc/iodefine
23+
device/inc/iodefine/iobitmasks
24+
device/inc/iodefine/iodefines
25+
)
26+
27+
target_sources(mbed-core
28+
INTERFACE
29+
PeripheralPins.c
30+
31+
device/RZ_A2_Init.c
32+
device/cmsis_nvic.c
33+
device/mbed_sf_boot.c
34+
device/mmu_RZ_A2M.c
35+
device/nvic_wrapper.c
36+
device/octaram_init.c
37+
device/os_tick_ostm.c
38+
device/system_RZ_A2M.c
39+
40+
${STARTUP_FILE}
41+
${WEAK_HANDLER_FILE}
42+
)

targets/TARGET_RENESAS/TARGET_RZ_A2XX/TARGET_GR_MANGO/device/TOOLCHAIN_ARM_STD/MBRZA1H.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-a9
22
;**************************************************
33
; Copyright (c) 2017-2020 ARM Ltd. All rights reserved.
44
;**************************************************

0 commit comments

Comments
 (0)