Skip to content

Commit bf88a3f

Browse files
authored
Merge pull request #13995 from hugueskamba/hk_cmake_gigadevice_support
CMake: Add support for GigaDevice targets
2 parents 9662e40 + f13e495 commit bf88a3f

File tree

7 files changed

+183
-2
lines changed

7 files changed

+183
-2
lines changed

targets/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ elseif("Cypress" IN_LIST MBED_TARGET_LABELS)
77
add_subdirectory(TARGET_Cypress)
88
elseif("Freescale" IN_LIST MBED_TARGET_LABELS)
99
add_subdirectory(TARGET_Freescale)
10+
elseif("GigaDevice" IN_LIST MBED_TARGET_LABELS)
11+
add_subdirectory(TARGET_GigaDevice)
1012
elseif("Maxim" IN_LIST MBED_TARGET_LABELS)
1113
add_subdirectory(TARGET_Maxim)
1214
elseif("NORDIC" IN_LIST MBED_TARGET_LABELS)
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("GD32F30X" IN_LIST MBED_TARGET_LABELS)
5+
add_subdirectory(TARGET_GD32F30X)
6+
elseif("GD32F4XX" IN_LIST MBED_TARGET_LABELS)
7+
add_subdirectory(TARGET_GD32F4XX)
8+
endif()
9+
10+
target_include_directories(mbed-core
11+
INTERFACE
12+
.
13+
)
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if("GD32F307VG" IN_LIST MBED_TARGET_LABELS)
5+
target_include_directories(mbed-core
6+
INTERFACE
7+
TARGET_GD32F307VG
8+
TARGET_GD32F307VG/device
9+
)
10+
11+
target_sources(mbed-core
12+
INTERFACE
13+
TARGET_GD32F307VG/PeripheralPins.c
14+
15+
TARGET_GD32F307VG/device/system_gd32f30x.c
16+
)
17+
18+
if(${MBED_TOOLCHAIN} STREQUAL "ARM")
19+
set(LINKER_FILE TARGET_GD32F307VG/device/TOOLCHAIN_ARM_STD/gd32f307vg.sct)
20+
set(STARTUP_FILE TARGET_GD32F307VG/device/TOOLCHAIN_ARM_STD/startup_gd32f30x_cl.S)
21+
elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
22+
set(LINKER_FILE TARGET_GD32F307VG/device/TOOLCHAIN_GCC_ARM/GD32F307xG.ld)
23+
set(STARTUP_FILE TARGET_GD32F307VG/device/TOOLCHAIN_GCC_ARM/startup_gd32f30x_cl.S)
24+
endif()
25+
endif()
26+
27+
set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
28+
29+
target_include_directories(mbed-core
30+
INTERFACE
31+
.
32+
GD32F30x_standard_peripheral/Include
33+
)
34+
35+
target_sources(mbed-core
36+
INTERFACE
37+
analogin_api.c
38+
analogout_api.c
39+
can_api.c
40+
flash_api.c
41+
gpio_api.c
42+
gpio_irq_api.c
43+
i2c_api.c
44+
mbed_overrides.c
45+
pinmap.c
46+
port_api.c
47+
pwmout_api.c
48+
rtc_api.c
49+
serial_api.c
50+
sleep.c
51+
spi_api.c
52+
us_ticker.c
53+
54+
GD32F30x_standard_peripheral/Source/gd32f30x_adc.c
55+
GD32F30x_standard_peripheral/Source/gd32f30x_bkp.c
56+
GD32F30x_standard_peripheral/Source/gd32f30x_can.c
57+
GD32F30x_standard_peripheral/Source/gd32f30x_ctc.c
58+
GD32F30x_standard_peripheral/Source/gd32f30x_crc.c
59+
GD32F30x_standard_peripheral/Source/gd32f30x_dac.c
60+
GD32F30x_standard_peripheral/Source/gd32f30x_dbg.c
61+
GD32F30x_standard_peripheral/Source/gd32f30x_dma.c
62+
GD32F30x_standard_peripheral/Source/gd32f30x_enet.c
63+
GD32F30x_standard_peripheral/Source/gd32f30x_exmc.c
64+
GD32F30x_standard_peripheral/Source/gd32f30x_exti.c
65+
GD32F30x_standard_peripheral/Source/gd32f30x_fmc.c
66+
GD32F30x_standard_peripheral/Source/gd32f30x_fwdgt.c
67+
GD32F30x_standard_peripheral/Source/gd32f30x_gpio.c
68+
GD32F30x_standard_peripheral/Source/gd32f30x_i2c.c
69+
GD32F30x_standard_peripheral/Source/gd32f30x_misc.c
70+
GD32F30x_standard_peripheral/Source/gd32f30x_pmu.c
71+
GD32F30x_standard_peripheral/Source/gd32f30x_rcu.c
72+
GD32F30x_standard_peripheral/Source/gd32f30x_rtc.c
73+
GD32F30x_standard_peripheral/Source/gd32f30x_sdio.c
74+
GD32F30x_standard_peripheral/Source/gd32f30x_spi.c
75+
GD32F30x_standard_peripheral/Source/gd32f30x_timer.c
76+
GD32F30x_standard_peripheral/Source/gd32f30x_usart.c
77+
78+
${STARTUP_FILE}
79+
)

targets/TARGET_GigaDevice/TARGET_GD32F30X/TARGET_GD32F307VG/device/TOOLCHAIN_ARM_STD/gd32f307vg.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
; *****
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if("GD32F450ZI" IN_LIST MBED_TARGET_LABELS)
5+
target_include_directories(mbed-core
6+
INTERFACE
7+
TARGET_GD32F450ZI
8+
)
9+
10+
target_sources(mbed-core
11+
INTERFACE
12+
TARGET_GD32F450ZI/PeripheralPins.c
13+
)
14+
endif()
15+
16+
if(${MBED_TOOLCHAIN} STREQUAL "ARM")
17+
set(LINKER_FILE device/TOOLCHAIN_ARM_STD/gd32f450zi.sct)
18+
set(STARTUP_FILE device/TOOLCHAIN_ARM_STD/startup_gd32f450.S)
19+
elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
20+
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/GD32F450xI.ld)
21+
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_gd32f450.S)
22+
endif()
23+
24+
set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
25+
26+
target_include_directories(mbed-core
27+
INTERFACE
28+
.
29+
device
30+
GD32F4xx_standard_peripheral/Include
31+
)
32+
33+
target_sources(mbed-core
34+
INTERFACE
35+
analogin_api.c
36+
analogout_api.c
37+
can_api.c
38+
flash_api.c
39+
gpio_api.c
40+
gpio_irq_api.c
41+
i2c_api.c
42+
mbed_overrides.c
43+
pinmap.c
44+
port_api.c
45+
pwmout_api.c
46+
rtc_api.c
47+
serial_api.c
48+
sleep.c
49+
spi_api.c
50+
trng_api.c
51+
us_ticker.c
52+
53+
device/system_gd32f4xx.c
54+
55+
GD32F4xx_standard_peripheral/Source/gd32f4xx_adc.c
56+
GD32F4xx_standard_peripheral/Source/gd32f4xx_can.c
57+
GD32F4xx_standard_peripheral/Source/gd32f4xx_crc.c
58+
GD32F4xx_standard_peripheral/Source/gd32f4xx_ctc.c
59+
GD32F4xx_standard_peripheral/Source/gd32f4xx_dac.c
60+
GD32F4xx_standard_peripheral/Source/gd32f4xx_dbg.c
61+
GD32F4xx_standard_peripheral/Source/gd32f4xx_dci.c
62+
GD32F4xx_standard_peripheral/Source/gd32f4xx_dma.c
63+
GD32F4xx_standard_peripheral/Source/gd32f4xx_enet.c
64+
GD32F4xx_standard_peripheral/Source/gd32f4xx_exmc.c
65+
GD32F4xx_standard_peripheral/Source/gd32f4xx_exti.c
66+
GD32F4xx_standard_peripheral/Source/gd32f4xx_fmc.c
67+
GD32F4xx_standard_peripheral/Source/gd32f4xx_fwdgt.c
68+
GD32F4xx_standard_peripheral/Source/gd32f4xx_gpio.c
69+
GD32F4xx_standard_peripheral/Source/gd32f4xx_i2c.c
70+
GD32F4xx_standard_peripheral/Source/gd32f4xx_ipa.c
71+
GD32F4xx_standard_peripheral/Source/gd32f4xx_iref.c
72+
GD32F4xx_standard_peripheral/Source/gd32f4xx_misc.c
73+
GD32F4xx_standard_peripheral/Source/gd32f4xx_pmu.c
74+
GD32F4xx_standard_peripheral/Source/gd32f4xx_rcu.c
75+
GD32F4xx_standard_peripheral/Source/gd32f4xx_rtc.c
76+
GD32F4xx_standard_peripheral/Source/gd32f4xx_sdio.c
77+
GD32F4xx_standard_peripheral/Source/gd32f4xx_spi.c
78+
GD32F4xx_standard_peripheral/Source/gd32f4xx_syscfg.c
79+
GD32F4xx_standard_peripheral/Source/gd32f4xx_timer.c
80+
GD32F4xx_standard_peripheral/Source/gd32f4xx_tli.c
81+
GD32F4xx_standard_peripheral/Source/gd32f4xx_trng.c
82+
GD32F4xx_standard_peripheral/Source/gd32f4xx_usart.c
83+
GD32F4xx_standard_peripheral/Source/gd32f4xx_wwdgt.c
84+
85+
${STARTUP_FILE}
86+
)

targets/TARGET_GigaDevice/TARGET_GD32F4XX/device/TOOLCHAIN_ARM_STD/gd32f450zi.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
; *****

tools/cmake/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ The following targets are supported:
2323
- ARM FM targets
2424
- Cypress targets
2525
- Freescale targets
26+
- GigaDevice targets
2627
- MAXIM targets
2728
- STM targets
2829

0 commit comments

Comments
 (0)