From b4bc521f13edf6cfc885d03661db0918a6177646 Mon Sep 17 00:00:00 2001 From: Hugues Kamba Date: Thu, 26 Nov 2020 17:28:08 +0000 Subject: [PATCH 01/12] CMake: Add support for WICED target * Add CMakeLists.txt file * Update the list of supported target --- targets/CMakeLists.txt | 6 ++++-- targets/TARGET_WICED/CMakeLists.txt | 22 ++++++++++++++++++++++ tools/cmake/README.md | 3 +-- 3 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 targets/TARGET_WICED/CMakeLists.txt diff --git a/targets/CMakeLists.txt b/targets/CMakeLists.txt index d037f618b36..800f5b8ee35 100644 --- a/targets/CMakeLists.txt +++ b/targets/CMakeLists.txt @@ -7,8 +7,10 @@ elseif("Freescale" IN_LIST MBED_TARGET_LABELS) add_subdirectory(TARGET_Freescale) elseif("NORDIC" IN_LIST MBED_TARGET_LABELS) add_subdirectory(TARGET_NORDIC) +elseif("NUVOTON" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_NUVOTON) elseif("STM" IN_LIST MBED_TARGET_LABELS) add_subdirectory(TARGET_STM) -elseif("NUVOTON" IN_LIST MBED_TARGET_LABELS) - add_subdirectory(TARGET_NUVOTON) +elseif("WICED" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_WICED) endif() diff --git a/targets/TARGET_WICED/CMakeLists.txt b/targets/TARGET_WICED/CMakeLists.txt new file mode 100644 index 00000000000..ac1832a9ada --- /dev/null +++ b/targets/TARGET_WICED/CMakeLists.txt @@ -0,0 +1,22 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("WIO_EMW3166" IN_LIST MBED_TARGET_LABELS) + if(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(LIB_WICED_DRIVERS TOOLCHAIN_ARMC6/TARGET_WIO_EMW3166/libwiced_drivers.ar) + elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(LIB_WICED_DRIVERS TOOLCHAIN_GCC_ARM/TARGET_WIO_EMW3166/libwiced_drivers.a) + endif() +endif() + +target_link_libraries(mbed-core INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/${LIB_WICED_DRIVERS}) + +target_include_directories(mbed-core + INTERFACE + wiced_interface +) + +target_sources(mbed-core + INTERFACE + wiced_interface/default_wifi_interface.cpp +) diff --git a/tools/cmake/README.md b/tools/cmake/README.md index 6728b667bde..fbf0e7942b1 100644 --- a/tools/cmake/README.md +++ b/tools/cmake/README.md @@ -19,12 +19,11 @@ The full profile with the selected printf and C libraries. Only a limited set of targets is supported at the moment. The following targets are supported: -- K64F -- K66F - NRF52840_DK - ARM FM targets - Freescale targets - STM targets +- WICED ### Supported toolchains From af5782b29028a40664e32c9b35d235f56f23bde7 Mon Sep 17 00:00:00 2001 From: Hugues Kamba Date: Fri, 27 Nov 2020 12:02:43 +0000 Subject: [PATCH 02/12] CMake: Add support for Samsung SIDK_S1SBP6A target --- targets/CMakeLists.txt | 2 + targets/TARGET_Samsung/CMakeLists.txt | 8 ++++ .../TARGET_SIDK_S1SBP6A/CMakeLists.txt | 44 +++++++++++++++++++ .../device/TOOLCHAIN_ARM_STD/s1sbp6a.sct | 2 +- 4 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 targets/TARGET_Samsung/CMakeLists.txt create mode 100644 targets/TARGET_Samsung/TARGET_SIDK_S1SBP6A/CMakeLists.txt diff --git a/targets/CMakeLists.txt b/targets/CMakeLists.txt index b493d20a229..50a86f9f54c 100644 --- a/targets/CMakeLists.txt +++ b/targets/CMakeLists.txt @@ -15,6 +15,8 @@ elseif("NORDIC" IN_LIST MBED_TARGET_LABELS) add_subdirectory(TARGET_NORDIC) elseif("NUVOTON" IN_LIST MBED_TARGET_LABELS) add_subdirectory(TARGET_NUVOTON) +elseif("Samsung" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_Samsung) elseif("Silicon_Labs" IN_LIST MBED_TARGET_LABELS) add_subdirectory(TARGET_Silicon_Labs) elseif("STM" IN_LIST MBED_TARGET_LABELS) diff --git a/targets/TARGET_Samsung/CMakeLists.txt b/targets/TARGET_Samsung/CMakeLists.txt new file mode 100644 index 00000000000..4a93bfe1ddc --- /dev/null +++ b/targets/TARGET_Samsung/CMakeLists.txt @@ -0,0 +1,8 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("SIDK_S1SBP6A" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_SIDK_S1SBP6A) +elseif("SIDK_S5JS100" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_SIDK_S5JS100) +endif() diff --git a/targets/TARGET_Samsung/TARGET_SIDK_S1SBP6A/CMakeLists.txt b/targets/TARGET_Samsung/TARGET_SIDK_S1SBP6A/CMakeLists.txt new file mode 100644 index 00000000000..d4cc5de3fb5 --- /dev/null +++ b/targets/TARGET_Samsung/TARGET_SIDK_S1SBP6A/CMakeLists.txt @@ -0,0 +1,44 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(LINKER_FILE device/TOOLCHAIN_ARM_STD/s1sbp6a.sct) + set(STARTUP_FILE device/TOOLCHAIN_ARM_STD/startup_s1sbp6a.S) +elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/s1sbp6a.ld) + set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_s1sbp6a.S) +endif() + +set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE}) + +target_include_directories(mbed-core + INTERFACE + . + device +) + +target_sources(mbed-core + INTERFACE + PeripheralPins.c + flash_api.c + gpio_api.c + gpio_irq_api.c + i2c_api.c + pinmap.c + rtc_api.c + serial_api.c + sleep_api.c + spi_api.c + us_ticker.c + watchdog_api.c + + device/s1sbp6a_cmu.c + device/s1sbp6a_gpio.c + device/s1sbp6a_i2c.c + device/s1sbp6a_pmu.c + device/s1sbp6a_rtc.c + device/s1sbp6a_wdog.c + device/system_s1sbp6a.c + + ${STARTUP_FILE} +) diff --git a/targets/TARGET_Samsung/TARGET_SIDK_S1SBP6A/device/TOOLCHAIN_ARM_STD/s1sbp6a.sct b/targets/TARGET_Samsung/TARGET_SIDK_S1SBP6A/device/TOOLCHAIN_ARM_STD/s1sbp6a.sct index 26641b46673..5288d9a2d2c 100644 --- a/targets/TARGET_Samsung/TARGET_SIDK_S1SBP6A/device/TOOLCHAIN_ARM_STD/s1sbp6a.sct +++ b/targets/TARGET_Samsung/TARGET_SIDK_S1SBP6A/device/TOOLCHAIN_ARM_STD/s1sbp6a.sct @@ -1,4 +1,4 @@ -#! armcc -E +#! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m4 ;* Copyright (c) 2006-2019 ARM Limited ;* All rights reserved. ;* SPDX-License-Identifier: Apache-2.0 From 7c3cfabfb6bd458f47617dd0ad965d3752514dfe Mon Sep 17 00:00:00 2001 From: Hugues Kamba Date: Fri, 27 Nov 2020 17:53:19 +0000 Subject: [PATCH 03/12] CMake: Fix Cortex M7 flag passed to assembler --- tools/cmake/cores/Cortex-M7.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/cmake/cores/Cortex-M7.cmake b/tools/cmake/cores/Cortex-M7.cmake index 8b4f3473cfa..44cf7f9de2e 100644 --- a/tools/cmake/cores/Cortex-M7.cmake +++ b/tools/cmake/cores/Cortex-M7.cmake @@ -28,7 +28,7 @@ function(mbed_set_cpu_core_options target mbed_toolchain) INTERFACE $<$:${compile_options}> $<$:${compile_options}> - $<$:-mcpu=Cortex-M7.no_fp> + $<$:${compile_options}> ) target_link_options(${target} From 747dca9e9febde5f2548de3c7126672288175118 Mon Sep 17 00:00:00 2001 From: Hugues Kamba Date: Fri, 27 Nov 2020 17:55:27 +0000 Subject: [PATCH 04/12] Samsung: Correct ARM toolchain identifier TOOLCHAIN_ARM_STD is specific to Mbed OS and is not generated if Mbed CLI is not used. --- .../TARGET_SIDK_S5JS100/device/system_core_s5js100.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/targets/TARGET_Samsung/TARGET_SIDK_S5JS100/device/system_core_s5js100.c b/targets/TARGET_Samsung/TARGET_SIDK_S5JS100/device/system_core_s5js100.c index ecc3abe7543..70b462926e2 100644 --- a/targets/TARGET_Samsung/TARGET_SIDK_S5JS100/device/system_core_s5js100.c +++ b/targets/TARGET_Samsung/TARGET_SIDK_S5JS100/device/system_core_s5js100.c @@ -129,7 +129,7 @@ HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority) #define S5JS100_BOOTMEM_BASE 0x00000000 extern uint32_t __vector_table; extern uint32_t __Vectors_Size; -#elif defined (TOOLCHAIN_ARM_STD)/*__ARMCC_VERSION)*/ +#elif defined(__ARMCC_VERSION) #define S5JS100_BOOTMEM_BASE 0x00000000 extern uint32_t __Vectors; extern uint32_t __Vectors_Size; @@ -166,7 +166,7 @@ void SystemCoreConfig() //*dest++ = *src++; } -#elif defined (TOOLCHAIN_ARM_STD)/*__ARMCC_VERSION)*/ +#elif defined(__ARMCC_VERSION) src = (uint32_t *)&__Vectors; dest = (uint32_t *)S5JS100_BOOTMEM_BASE; From 742782d6571d5e0831225c76595a0f4d68ff30d1 Mon Sep 17 00:00:00 2001 From: Hugues Kamba Date: Fri, 27 Nov 2020 17:58:00 +0000 Subject: [PATCH 05/12] CMake: Add support for Samsung S5JS100 target --- .../TARGET_SIDK_S5JS100/CMakeLists.txt | 71 +++++++++++++++++++ .../device/TOOLCHAIN_ARM_STD/sidk_s5js100.sct | 2 +- 2 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 targets/TARGET_Samsung/TARGET_SIDK_S5JS100/CMakeLists.txt diff --git a/targets/TARGET_Samsung/TARGET_SIDK_S5JS100/CMakeLists.txt b/targets/TARGET_Samsung/TARGET_SIDK_S5JS100/CMakeLists.txt new file mode 100644 index 00000000000..3ff3fd90142 --- /dev/null +++ b/targets/TARGET_Samsung/TARGET_SIDK_S5JS100/CMakeLists.txt @@ -0,0 +1,71 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(LINKER_FILE device/TOOLCHAIN_ARM_STD/sidk_s5js100.sct) + set(STARTUP_FILE device/TOOLCHAIN_ARM_STD/startup_sidk_s5js100.S) +elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/sidk_s5js100.ld) + set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_sidk_s5js100.S) +endif() + +set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE}) + +target_include_directories(mbed-core + INTERFACE + . + device + modem + security_subsystem + security_subsystem/drivers +) + +target_sources(mbed-core + INTERFACE +# TODO CMAKE: The files commented below trigger a dependency on other libraries +# they should be moved somewhere in the connectivity directory. + # dcxo_update.cpp + # mbed_main_init.cpp + # modem/modem_io_device.cpp + # modem/modem_link_device_shmem.cpp + # modem/s5js100_mbox_ipc.cpp + # modem/shmem_save.cpp + gpio_api.c + gpio_irq_api.c + i2c_api.c + + mbed_sdk_init.c + pinmap.c + rtc_api.c + s5js100_dcxo.cpp + s5js100_pmip.c + s5js100_pwr.c + s5js100_watchdog.c + security_subsystem + serial_api.c + serial_dummy_api.c + serial_pl011_api.c + serial_usi_api.c + sleep.c + spi_api.c + us_ticker.c + watchdog_api.c + + device/s5js100_pwrcal.c + device/s5js100_systemreset.c + device/sflash_api.cpp + device/system_core_s5js100.c + device/system_core_version.c + device/system_s5js100.c + + security_subsystem/api/trng_api.c + + security_subsystem/drivers/mb_cmd_hash.c + security_subsystem/drivers/mb_cmd_rng.c + security_subsystem/drivers/mb_cmd_system.c + security_subsystem/drivers/sss_driver_rng.c + security_subsystem/drivers/sss_driver_sha2.c + security_subsystem/drivers/sss_driver_util.c + + ${STARTUP_FILE} +) diff --git a/targets/TARGET_Samsung/TARGET_SIDK_S5JS100/device/TOOLCHAIN_ARM_STD/sidk_s5js100.sct b/targets/TARGET_Samsung/TARGET_SIDK_S5JS100/device/TOOLCHAIN_ARM_STD/sidk_s5js100.sct index 136a9cbb593..727ed332e9c 100755 --- a/targets/TARGET_Samsung/TARGET_SIDK_S5JS100/device/TOOLCHAIN_ARM_STD/sidk_s5js100.sct +++ b/targets/TARGET_Samsung/TARGET_SIDK_S5JS100/device/TOOLCHAIN_ARM_STD/sidk_s5js100.sct @@ -1,4 +1,4 @@ -#! armcc -E +#! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m7 ;/**************************************************************************** ; * ; * Copyright 2020 Samsung Electronics All Rights Reserved. From 87e8c0bfacf0aeaa13506532a20052861307ab16 Mon Sep 17 00:00:00 2001 From: Hugues Kamba Date: Fri, 27 Nov 2020 17:58:24 +0000 Subject: [PATCH 06/12] CMake: Add Samsung to the 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 ba1509dd0b4..e75b67c7457 100644 --- a/tools/cmake/README.md +++ b/tools/cmake/README.md @@ -25,6 +25,7 @@ The following targets are supported: - Freescale targets - GigaDevice targets - MAXIM targets +- Samsung targets - Silicon Labs targets - STM targets From 6b0fceb2ffaff393b69a3023fb6c935bd4a6d4f6 Mon Sep 17 00:00:00 2001 From: Harrison Mutai Date: Tue, 8 Dec 2020 16:35:18 +0000 Subject: [PATCH 07/12] 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 08/12] 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 09/12] 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 From e7315e881ecee75c7e0159b3b89f7917efbb0a79 Mon Sep 17 00:00:00 2001 From: Martin Kojtal Date: Thu, 10 Dec 2020 13:53:43 +0000 Subject: [PATCH 10/12] ADUCM3029: remove flag that is already set in core CMake --- .../TARGET_ADUCM302X/TARGET_ADUCM3029/CMakeLists.txt | 6 ------ 1 file changed, 6 deletions(-) diff --git a/targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/CMakeLists.txt b/targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/CMakeLists.txt index 7d30391c790..05238d3d87c 100644 --- a/targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/CMakeLists.txt +++ b/targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/CMakeLists.txt @@ -20,12 +20,6 @@ if ("EV_COG_AD3029LZ" IN_LIST MBED_TARGET_LABELS) 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 From eef57d3a0fd8d2e05cad0b66df9cbb991a6b42b1 Mon Sep 17 00:00:00 2001 From: Martin Kojtal Date: Thu, 10 Dec 2020 14:12:44 +0000 Subject: [PATCH 11/12] Samsung: remove todo from CMake tracked here https://github.com/ARMmbed/mbed-os/issues/14025 --- targets/TARGET_Samsung/TARGET_SIDK_S5JS100/CMakeLists.txt | 8 -------- 1 file changed, 8 deletions(-) diff --git a/targets/TARGET_Samsung/TARGET_SIDK_S5JS100/CMakeLists.txt b/targets/TARGET_Samsung/TARGET_SIDK_S5JS100/CMakeLists.txt index 3ff3fd90142..929a500ac59 100644 --- a/targets/TARGET_Samsung/TARGET_SIDK_S5JS100/CMakeLists.txt +++ b/targets/TARGET_Samsung/TARGET_SIDK_S5JS100/CMakeLists.txt @@ -22,14 +22,6 @@ target_include_directories(mbed-core target_sources(mbed-core INTERFACE -# TODO CMAKE: The files commented below trigger a dependency on other libraries -# they should be moved somewhere in the connectivity directory. - # dcxo_update.cpp - # mbed_main_init.cpp - # modem/modem_io_device.cpp - # modem/modem_link_device_shmem.cpp - # modem/s5js100_mbox_ipc.cpp - # modem/shmem_save.cpp gpio_api.c gpio_irq_api.c i2c_api.c From 6a83bc096f344d57dbef641e7f3d2d78e9a47ce5 Mon Sep 17 00:00:00 2001 From: Martin Kojtal Date: Thu, 10 Dec 2020 15:56:45 +0000 Subject: [PATCH 12/12] CMake: fix targets missing ) --- targets/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/targets/CMakeLists.txt b/targets/CMakeLists.txt index bb21cfff66f..9a95cc43a37 100644 --- a/targets/CMakeLists.txt +++ b/targets/CMakeLists.txt @@ -20,7 +20,7 @@ elseif("NUVOTON" IN_LIST MBED_TARGET_LABELS) elseif("NXP" IN_LIST MBED_TARGET_LABELS) add_subdirectory(TARGET_NXP) elseif("Samsung" IN_LIST MBED_TARGET_LABELS) - add_subdirectory(TARGET_Samsung + add_subdirectory(TARGET_Samsung) elseif("Silicon_Labs" IN_LIST MBED_TARGET_LABELS) add_subdirectory(TARGET_Silicon_Labs) elseif("STM" IN_LIST MBED_TARGET_LABELS)