From 6b0fceb2ffaff393b69a3023fb6c935bd4a6d4f6 Mon Sep 17 00:00:00 2001 From: Harrison Mutai Date: Tue, 8 Dec 2020 16:35:18 +0000 Subject: [PATCH 1/3] Add CMake support for all Renesas targets Add configuration files for targets and individual MCUs. Add include paths and sources to mbed-core link library and specify linker and startup scripts. --- targets/CMakeLists.txt | 2 + targets/TARGET_Analog_Devices/CMakeLists.txt | 13 ++ .../TARGET_ADUCM302X/CMakeLists.txt | 6 + .../TARGET_ADUCM3029/CMakeLists.txt | 111 ++++++++++++++++++ .../TARGET_ADUCM4X50/CMakeLists.txt | 6 + .../TARGET_ADUCM4050/CMakeLists.txt | 107 +++++++++++++++++ 6 files changed, 245 insertions(+) create mode 100644 targets/TARGET_Analog_Devices/CMakeLists.txt create mode 100644 targets/TARGET_Analog_Devices/TARGET_ADUCM302X/CMakeLists.txt create mode 100644 targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/CMakeLists.txt create mode 100644 targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/CMakeLists.txt create mode 100644 targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/TARGET_ADUCM4050/CMakeLists.txt diff --git a/targets/CMakeLists.txt b/targets/CMakeLists.txt index ac595d18edf..e7f325c838a 100644 --- a/targets/CMakeLists.txt +++ b/targets/CMakeLists.txt @@ -21,4 +21,6 @@ elseif("Silicon_Labs" IN_LIST MBED_TARGET_LABELS) add_subdirectory(TARGET_Silicon_Labs) elseif("STM" IN_LIST MBED_TARGET_LABELS) add_subdirectory(TARGET_STM) +elseif("Analog_Devices" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_Analog_Devices) endif() diff --git a/targets/TARGET_Analog_Devices/CMakeLists.txt b/targets/TARGET_Analog_Devices/CMakeLists.txt new file mode 100644 index 00000000000..dab28453166 --- /dev/null +++ b/targets/TARGET_Analog_Devices/CMakeLists.txt @@ -0,0 +1,13 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("ADUCM4X50" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_ADUCM4X50) +elseif("ADUCM302X" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_ADUCM302X) +endif() + +target_include_directories(mbed-core + INTERFACE + . +) diff --git a/targets/TARGET_Analog_Devices/TARGET_ADUCM302X/CMakeLists.txt b/targets/TARGET_Analog_Devices/TARGET_ADUCM302X/CMakeLists.txt new file mode 100644 index 00000000000..48f63d8f146 --- /dev/null +++ b/targets/TARGET_Analog_Devices/TARGET_ADUCM302X/CMakeLists.txt @@ -0,0 +1,6 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("ADUCM3029" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_ADUCM3029) +endif() diff --git a/targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/CMakeLists.txt b/targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/CMakeLists.txt new file mode 100644 index 00000000000..7d30391c790 --- /dev/null +++ b/targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/CMakeLists.txt @@ -0,0 +1,111 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(LINKER_FILE TOOLCHAIN_ARM_STD/ADuCM3029.sct) +elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(LINKER_FILE TOOLCHAIN_GCC_ARM/ADuCM3029.ld) +endif() + +if ("EV_COG_AD3029LZ" IN_LIST MBED_TARGET_LABELS) + target_include_directories(mbed-core + INTERFACE + TARGET_EV_COG_AD3029LZ + TARGET_EV_COG_AD3029LZ/device + ) + + target_sources(mbed-core + INTERFACE + TARGET_EV_COG_AD3029LZ/device/system_ADuCM3029.c + TARGET_EV_COG_AD3029LZ/device/startup_ADuCM3029.c + ) + + target_compile_options(mbed-core + INTERFACE + -mcpu=cortex-m3 + ) + endif() + +set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE}) + +target_include_directories(mbed-core + INTERFACE + api + bsp + bsp/adc + bsp/beep + bsp/config + bsp/crc + bsp/crypto + bsp/drivers/adc + bsp/drivers/beep + bsp/drivers/crc + bsp/drivers/crypto + bsp/drivers/dma + bsp/drivers/flash + bsp/drivers/general + bsp/drivers/gpio + bsp/drivers/i2c + bsp/drivers/pwr + bsp/drivers/rng + bsp/drivers/rtc + bsp/drivers/spi + bsp/drivers/sport + bsp/drivers/tmr + bsp/drivers/uart + bsp/drivers/wdt + bsp/drivers/xint + bsp/flash + bsp/gpio + bsp/i2c + bsp/pwr + bsp/rng + bsp/rtc + bsp/rtos_map + bsp/spi + bsp/sport + bsp/sys + bsp/uart + bsp/xint +) + +target_sources(mbed-core + INTERFACE + bsp/crypto/adi_crypto.c + bsp/wdt/adi_wdt.c + bsp/crc/adi_crc.c + bsp/i2c/adi_i2c.c + bsp/i2c/adi_i2c_data.c + bsp/sport/adi_sport.c + bsp/tmr/adi_tmr_data.c + bsp/tmr/adi_tmr.c + bsp/flash/adi_flash.c + bsp/flash/adi_flash_data.c + bsp/spi/adi_spi_data.c + bsp/spi/adi_spi.c + bsp/xint/adi_xint.c + bsp/adc/adi_adc.c + bsp/adc/adi_adc_data.c + bsp/beep/adi_beep.c + bsp/rtc/adi_rtc_data.c + bsp/rtc/adi_rtc.c + bsp/pwr/adi_pwr.c + bsp/dma/adi_dma.c + bsp/gpio/adi_gpio.c + bsp/uart/adi_uart.c + bsp/rng/adi_rng.c + api/us_ticker.c + api/serial_api.c + api/gpio_dev_mem.c + api/gpio_api.c + api/flash_api.c + api/spi_api.c + api/i2c_api.c + api/gpio_irq_api.c + api/trng_api.c + api/sleep.c + api/PeripheralPins.c + api/analogin_api.c + api/rtc_api.c + api/pinmap.c +) diff --git a/targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/CMakeLists.txt b/targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/CMakeLists.txt new file mode 100644 index 00000000000..4e018e32c60 --- /dev/null +++ b/targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/CMakeLists.txt @@ -0,0 +1,6 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if ("ADUCM4050" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_ADUCM4050) +endif() diff --git a/targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/TARGET_ADUCM4050/CMakeLists.txt b/targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/TARGET_ADUCM4050/CMakeLists.txt new file mode 100644 index 00000000000..6c8fdc01e6c --- /dev/null +++ b/targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/TARGET_ADUCM4050/CMakeLists.txt @@ -0,0 +1,107 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(LINKER_FILE TOOLCHAIN_GCC_ARM/ADuCM4050.ld) +elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(LINKER_FILE TOOLCHAIN_ARM_STD/ADuCM4050.sct) +endif() + +if("EV_COG_AD4050LZ" IN_LIST MBED_TARGET_LABELS) + target_include_directories(mbed-core + INTERFACE + TARGET_EV_COG_AD4050LZ + TARGET_EV_COG_AD4050LZ/device + ) + + target_sources(mbed-core + INTERFACE + TARGET_EV_COG_AD4050LZ/device/system_ADuCM4050.c + TARGET_EV_COG_AD4050LZ/device/startup_ADuCM4050.c + ) +endif() + +set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE}) + +target_include_directories(mbed-core + INTERFACE + api + bsp + bsp/adc + bsp/beep + bsp/config + bsp/crc + bsp/crypto + bsp/drivers/adc + bsp/drivers/beep + bsp/drivers/crc + bsp/drivers/crypto + bsp/drivers/dma + bsp/drivers/flash + bsp/drivers/general + bsp/drivers/gpio + bsp/drivers/i2c + bsp/drivers/pwr + bsp/drivers/rng + bsp/drivers/rtc + bsp/drivers/spi + bsp/drivers/sport + bsp/drivers/tmr + bsp/drivers/uart + bsp/drivers/wdt + bsp/drivers/xint + bsp/flash + bsp/gpio + bsp/i2c + bsp/pwr + bsp/rng + bsp/rtc + bsp/rtos_map + bsp/spi + bsp/sport + bsp/sys + bsp/uart + bsp/xint +) + +target_sources(mbed-core + INTERFACE + bsp/crypto/adi_crypto.c + bsp/wdt/adi_wdt.c + bsp/crc/adi_crc.c + bsp/i2c/adi_i2c.c + bsp/i2c/adi_i2c_data.c + bsp/sport/adi_sport.c + bsp/tmr/adi_tmr_data.c + bsp/tmr/adi_tmr.c + bsp/flash/adi_flash.c + bsp/flash/adi_flash_data.c + bsp/spi/adi_spi_data.c + bsp/spi/adi_spi.c + bsp/xint/adi_xint.c + bsp/adc/adi_adc.c + bsp/adc/adi_adc_data.c + bsp/beep/adi_beep.c + bsp/rtc/adi_rtc_data.c + bsp/rtc/adi_rtc.c + bsp/pwr/adi_pwr.c + bsp/dma/adi_dma.c + bsp/gpio/adi_gpio.c + bsp/uart/adi_uart.c + bsp/rng/adi_rng.c + api/us_ticker.c + api/serial_api.c + api/gpio_dev_mem.c + api/gpio_api.c + api/flash_api.c + api/spi_api.c + api/i2c_api.c + api/gpio_irq_api.c + api/trng_api.c + api/sleep.c + api/PeripheralPins.c + api/analogin_api.c + api/rtc_api.c + api/pinmap.c + + ) From e3cee853508a09b0097c96de7b0facfc18e64072 Mon Sep 17 00:00:00 2001 From: Harrison Mutai Date: Wed, 9 Dec 2020 15:25:19 +0000 Subject: [PATCH 2/3] Update interpreter program used in ARM scatter file Change interpreter program from armcc to armclang. Pass it different optional arguments: specify the target compiler and core core type. --- .../TARGET_ADUCM3029/TOOLCHAIN_ARM_STD/ADuCM3029.sct | 2 +- .../TARGET_ADUCM4050/TOOLCHAIN_ARM_STD/ADuCM4050.sct | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/TOOLCHAIN_ARM_STD/ADuCM3029.sct b/targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/TOOLCHAIN_ARM_STD/ADuCM3029.sct index d38887344e4..b252d25417b 100755 --- a/targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/TOOLCHAIN_ARM_STD/ADuCM3029.sct +++ b/targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/TOOLCHAIN_ARM_STD/ADuCM3029.sct @@ -1,4 +1,4 @@ -#! armcc -E +#! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m3 ;****************************************************************************** ; File: ADuCM3029.sct ; Scatter loading file for Analog Devices ADuCM3029 processor diff --git a/targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/TARGET_ADUCM4050/TOOLCHAIN_ARM_STD/ADuCM4050.sct b/targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/TARGET_ADUCM4050/TOOLCHAIN_ARM_STD/ADuCM4050.sct index 8bc497c0a50..6b297683758 100755 --- a/targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/TARGET_ADUCM4050/TOOLCHAIN_ARM_STD/ADuCM4050.sct +++ b/targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/TARGET_ADUCM4050/TOOLCHAIN_ARM_STD/ADuCM4050.sct @@ -1,4 +1,4 @@ -#! armcc -E +#! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m4 ;****************************************************************************** ; File: ADuCM4050.sct ; Scatter loading file for Analog Devices ADuCM4050 processor From 613f7f00aff7787023ca6e0a92389cbb12b000d2 Mon Sep 17 00:00:00 2001 From: Harrison Mutai Date: Thu, 10 Dec 2020 12:26:26 +0000 Subject: [PATCH 3/3] Add Analog Devices to list of supported targets --- tools/cmake/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/cmake/README.md b/tools/cmake/README.md index 6ddc5aac163..f88575aaf2d 100644 --- a/tools/cmake/README.md +++ b/tools/cmake/README.md @@ -28,6 +28,7 @@ The following targets are supported: - NXP targets - Silicon Labs targets - STM targets +- Analog Devices targets ### Supported toolchains