Skip to content

CMake: Add support for GigaDevice targets #13995

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions targets/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ elseif("Cypress" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_Cypress)
elseif("Freescale" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_Freescale)
elseif("GigaDevice" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_GigaDevice)
elseif("Maxim" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_Maxim)
elseif("NORDIC" IN_LIST MBED_TARGET_LABELS)
Expand Down
13 changes: 13 additions & 0 deletions targets/TARGET_GigaDevice/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

if("GD32F30X" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_GD32F30X)
elseif("GD32F4XX" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_GD32F4XX)
endif()

target_include_directories(mbed-core
INTERFACE
.
)
79 changes: 79 additions & 0 deletions targets/TARGET_GigaDevice/TARGET_GD32F30X/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

if("GD32F307VG" IN_LIST MBED_TARGET_LABELS)
target_include_directories(mbed-core
INTERFACE
TARGET_GD32F307VG
TARGET_GD32F307VG/device
)

target_sources(mbed-core
INTERFACE
TARGET_GD32F307VG/PeripheralPins.c

TARGET_GD32F307VG/device/system_gd32f30x.c
)

if(${MBED_TOOLCHAIN} STREQUAL "ARM")
set(LINKER_FILE TARGET_GD32F307VG/device/TOOLCHAIN_ARM_STD/gd32f307vg.sct)
set(STARTUP_FILE TARGET_GD32F307VG/device/TOOLCHAIN_ARM_STD/startup_gd32f30x_cl.S)
elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
set(LINKER_FILE TARGET_GD32F307VG/device/TOOLCHAIN_GCC_ARM/GD32F307xG.ld)
set(STARTUP_FILE TARGET_GD32F307VG/device/TOOLCHAIN_GCC_ARM/startup_gd32f30x_cl.S)
endif()
endif()

set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})

target_include_directories(mbed-core
INTERFACE
.
GD32F30x_standard_peripheral/Include
)

target_sources(mbed-core
INTERFACE
analogin_api.c
analogout_api.c
can_api.c
flash_api.c
gpio_api.c
gpio_irq_api.c
i2c_api.c
mbed_overrides.c
pinmap.c
port_api.c
pwmout_api.c
rtc_api.c
serial_api.c
sleep.c
spi_api.c
us_ticker.c

GD32F30x_standard_peripheral/Source/gd32f30x_adc.c
GD32F30x_standard_peripheral/Source/gd32f30x_bkp.c
GD32F30x_standard_peripheral/Source/gd32f30x_can.c
GD32F30x_standard_peripheral/Source/gd32f30x_ctc.c
GD32F30x_standard_peripheral/Source/gd32f30x_crc.c
GD32F30x_standard_peripheral/Source/gd32f30x_dac.c
GD32F30x_standard_peripheral/Source/gd32f30x_dbg.c
GD32F30x_standard_peripheral/Source/gd32f30x_dma.c
GD32F30x_standard_peripheral/Source/gd32f30x_enet.c
GD32F30x_standard_peripheral/Source/gd32f30x_exmc.c
GD32F30x_standard_peripheral/Source/gd32f30x_exti.c
GD32F30x_standard_peripheral/Source/gd32f30x_fmc.c
GD32F30x_standard_peripheral/Source/gd32f30x_fwdgt.c
GD32F30x_standard_peripheral/Source/gd32f30x_gpio.c
GD32F30x_standard_peripheral/Source/gd32f30x_i2c.c
GD32F30x_standard_peripheral/Source/gd32f30x_misc.c
GD32F30x_standard_peripheral/Source/gd32f30x_pmu.c
GD32F30x_standard_peripheral/Source/gd32f30x_rcu.c
GD32F30x_standard_peripheral/Source/gd32f30x_rtc.c
GD32F30x_standard_peripheral/Source/gd32f30x_sdio.c
GD32F30x_standard_peripheral/Source/gd32f30x_spi.c
GD32F30x_standard_peripheral/Source/gd32f30x_timer.c
GD32F30x_standard_peripheral/Source/gd32f30x_usart.c

${STARTUP_FILE}
)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! armcc -E
#! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m4
; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *****
Expand Down
86 changes: 86 additions & 0 deletions targets/TARGET_GigaDevice/TARGET_GD32F4XX/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

if("GD32F450ZI" IN_LIST MBED_TARGET_LABELS)
target_include_directories(mbed-core
INTERFACE
TARGET_GD32F450ZI
)

target_sources(mbed-core
INTERFACE
TARGET_GD32F450ZI/PeripheralPins.c
)
endif()

if(${MBED_TOOLCHAIN} STREQUAL "ARM")
set(LINKER_FILE device/TOOLCHAIN_ARM_STD/gd32f450zi.sct)
set(STARTUP_FILE device/TOOLCHAIN_ARM_STD/startup_gd32f450.S)
elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/GD32F450xI.ld)
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_gd32f450.S)
endif()

set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})

target_include_directories(mbed-core
INTERFACE
.
device
GD32F4xx_standard_peripheral/Include
)

target_sources(mbed-core
INTERFACE
analogin_api.c
analogout_api.c
can_api.c
flash_api.c
gpio_api.c
gpio_irq_api.c
i2c_api.c
mbed_overrides.c
pinmap.c
port_api.c
pwmout_api.c
rtc_api.c
serial_api.c
sleep.c
spi_api.c
trng_api.c
us_ticker.c

device/system_gd32f4xx.c

GD32F4xx_standard_peripheral/Source/gd32f4xx_adc.c
GD32F4xx_standard_peripheral/Source/gd32f4xx_can.c
GD32F4xx_standard_peripheral/Source/gd32f4xx_crc.c
GD32F4xx_standard_peripheral/Source/gd32f4xx_ctc.c
GD32F4xx_standard_peripheral/Source/gd32f4xx_dac.c
GD32F4xx_standard_peripheral/Source/gd32f4xx_dbg.c
GD32F4xx_standard_peripheral/Source/gd32f4xx_dci.c
GD32F4xx_standard_peripheral/Source/gd32f4xx_dma.c
GD32F4xx_standard_peripheral/Source/gd32f4xx_enet.c
GD32F4xx_standard_peripheral/Source/gd32f4xx_exmc.c
GD32F4xx_standard_peripheral/Source/gd32f4xx_exti.c
GD32F4xx_standard_peripheral/Source/gd32f4xx_fmc.c
GD32F4xx_standard_peripheral/Source/gd32f4xx_fwdgt.c
GD32F4xx_standard_peripheral/Source/gd32f4xx_gpio.c
GD32F4xx_standard_peripheral/Source/gd32f4xx_i2c.c
GD32F4xx_standard_peripheral/Source/gd32f4xx_ipa.c
GD32F4xx_standard_peripheral/Source/gd32f4xx_iref.c
GD32F4xx_standard_peripheral/Source/gd32f4xx_misc.c
GD32F4xx_standard_peripheral/Source/gd32f4xx_pmu.c
GD32F4xx_standard_peripheral/Source/gd32f4xx_rcu.c
GD32F4xx_standard_peripheral/Source/gd32f4xx_rtc.c
GD32F4xx_standard_peripheral/Source/gd32f4xx_sdio.c
GD32F4xx_standard_peripheral/Source/gd32f4xx_spi.c
GD32F4xx_standard_peripheral/Source/gd32f4xx_syscfg.c
GD32F4xx_standard_peripheral/Source/gd32f4xx_timer.c
GD32F4xx_standard_peripheral/Source/gd32f4xx_tli.c
GD32F4xx_standard_peripheral/Source/gd32f4xx_trng.c
GD32F4xx_standard_peripheral/Source/gd32f4xx_usart.c
GD32F4xx_standard_peripheral/Source/gd32f4xx_wwdgt.c

${STARTUP_FILE}
)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! armcc -E
#! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m4
; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *****
Expand Down
1 change: 1 addition & 0 deletions tools/cmake/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ The following targets are supported:
- ARM FM targets
- Cypress targets
- Freescale targets
- GigaDevice targets
- MAXIM targets
- STM targets

Expand Down