From ea6955bd1c28f25a8de850191cb1db7df739e03e Mon Sep 17 00:00:00 2001 From: Hugues Kamba Date: Mon, 15 Feb 2021 13:09:41 +0000 Subject: [PATCH 1/2] CMake: Refactor Cypress targets Refactor all Cypress targets to be CMake buildsystem targets. This removes the need for checking MBED_TARGET_LABELS repeatedly and allows us to be more flexible in the way we include MBED_TARGET source in the build. A side effect of this is it will allow us to support custom targets without breaking the build for 'standard' targets, as we use CMake's standard mechanism for adding build rules to the build system, rather than implementing our own layer of logic to exclude files not needed for the target being built. Using this approach, if an MBED_TARGET is not linked to using target_link_libraries its source files will not be added to the build. This means custom target source can be added to the user's application CMakeLists.txt without polluting the build system when trying to compile for a standard MBED_TARGET. --- .../COMPONENT_SCL/CMakeLists.txt | 3 +- targets/TARGET_Cypress/CMakeLists.txt | 15 +- .../TARGET_PSOC6/CMakeLists.txt | 180 ++++++++---------- .../TARGET_PSOC6/COMPONENT_SCL/CMakeLists.txt | 12 +- .../TARGET_PSOC6/COMPONENT_WHD/CMakeLists.txt | 165 +++++++++------- .../CMakeLists.txt | 114 ++++++----- .../TARGET_CY8CKIT_062S2_43012/CMakeLists.txt | 113 ++++++----- .../TARGET_CY8CKIT_062_BLE/CMakeLists.txt | 110 ++++++----- .../TARGET_CY8CKIT_062_WIFI_BT/CMakeLists.txt | 115 ++++++----- .../CMakeLists.txt | 114 ++++++----- .../TARGET_CY8CPROTO_062_4343W/CMakeLists.txt | 114 ++++++----- .../TARGET_CYSBSYSKIT_01/CMakeLists.txt | 83 ++++---- .../TARGET_CYTFM_064B0S2_4343W/CMakeLists.txt | 107 ++++++----- .../CMakeLists.txt | 117 +++++++----- .../CMakeLists.txt | 116 ++++++----- .../common/COMPONENT_WHD/CMakeLists.txt | 14 +- .../psoc6csp/abstraction/rtos/CMakeLists.txt | 41 ++-- 17 files changed, 856 insertions(+), 677 deletions(-) diff --git a/connectivity/drivers/emac/TARGET_Cypress/COMPONENT_SCL/CMakeLists.txt b/connectivity/drivers/emac/TARGET_Cypress/COMPONENT_SCL/CMakeLists.txt index 3f31f7dba5..907800b492 100644 --- a/connectivity/drivers/emac/TARGET_Cypress/COMPONENT_SCL/CMakeLists.txt +++ b/connectivity/drivers/emac/TARGET_Cypress/COMPONENT_SCL/CMakeLists.txt @@ -9,7 +9,8 @@ target_include_directories(mbed-emac target_sources(mbed-emac INTERFACE - interface/SclSTAInterface.cpp interface/default_wifi_interface.cpp interface/scl_emac.cpp + interface/SclAccessPoint.cpp + interface/SclSTAInterface.cpp ) diff --git a/targets/TARGET_Cypress/CMakeLists.txt b/targets/TARGET_Cypress/CMakeLists.txt index c926d4436d..6fe5526e05 100644 --- a/targets/TARGET_Cypress/CMakeLists.txt +++ b/targets/TARGET_Cypress/CMakeLists.txt @@ -1,6 +1,13 @@ -# Copyright (c) 2020 ARM Limited. All rights reserved. +# Copyright (c) 2020-2021 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -if("PSOC6" IN_LIST MBED_TARGET_LABELS) - add_subdirectory(TARGET_PSOC6) -endif() +add_subdirectory(TARGET_PSOC6 EXCLUDE_FROM_ALL) + +add_library(mbed-cy-external-wifi-fw INTERFACE) +target_compile_definitions(mbed-cy-external-wifi-fw + INTERFACE + "CY_ENABLE_XIP_PROGRAM" + "CY_STORAGE_WIFI_DATA=\".cy_xip\"" + "CY_STORAGE_WIFI_DATA_OUTPUT=cy_xip" + "CY_EXT_WIFI_FW_STORAGE=QSPIF" +) diff --git a/targets/TARGET_Cypress/TARGET_PSOC6/CMakeLists.txt b/targets/TARGET_Cypress/TARGET_PSOC6/CMakeLists.txt index cbd1b46eda..eccb5965fc 100644 --- a/targets/TARGET_Cypress/TARGET_PSOC6/CMakeLists.txt +++ b/targets/TARGET_Cypress/TARGET_PSOC6/CMakeLists.txt @@ -1,115 +1,94 @@ -# Copyright (c) 2020 ARM Limited. All rights reserved. +# Copyright (c) 2020-2021 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -if("SCL" IN_LIST MBED_TARGET_LABELS) - add_subdirectory(COMPONENT_SCL EXCLUDE_FROM_ALL) -endif() +add_subdirectory(COMPONENT_SCL EXCLUDE_FROM_ALL) +add_subdirectory(COMPONENT_WHD EXCLUDE_FROM_ALL) +add_subdirectory(common/COMPONENT_WHD EXCLUDE_FROM_ALL) -if("WHD" IN_LIST MBED_TARGET_LABELS) - add_subdirectory(COMPONENT_WHD EXCLUDE_FROM_ALL) - add_subdirectory(common/COMPONENT_WHD EXCLUDE_FROM_ALL) -endif() +add_library(mbed-cat1a INTERFACE) -if("CAT1A" IN_LIST MBED_TARGET_LABELS) - target_include_directories(mbed-core - INTERFACE - psoc6pdl/devices/COMPONENT_CAT1A/include - psoc6pdl/devices/COMPONENT_CAT1A/include/ip - ) -endif() +target_include_directories(mbed-cat1a + INTERFACE + psoc6pdl/devices/COMPONENT_CAT1A/include + psoc6pdl/devices/COMPONENT_CAT1A/include/ip +) -if("CY8CKIT064B0S2_4343W" IN_LIST MBED_TARGET_LABELS) - add_subdirectory(TARGET_CY8CKIT064B0S2_4343W) -elseif("CY8CKIT_062S2_43012" IN_LIST MBED_TARGET_LABELS) - add_subdirectory(TARGET_CY8CKIT_062S2_43012) -elseif("CY8CKIT_062_BLE" IN_LIST MBED_TARGET_LABELS) - add_subdirectory(TARGET_CY8CKIT_062_BLE) -elseif("CY8CKIT_062_WIFI_BT" IN_LIST MBED_TARGET_LABELS) - add_subdirectory(TARGET_CY8CKIT_062_WIFI_BT) -elseif("CY8CPROTO_062S3_4343W" IN_LIST MBED_TARGET_LABELS) - add_subdirectory(TARGET_CY8CPROTO_062S3_4343W) -elseif("CY8CPROTO_062_4343W" IN_LIST MBED_TARGET_LABELS) - add_subdirectory(TARGET_CY8CPROTO_062_4343W) -elseif("CYSBSYSKIT_01" IN_LIST MBED_TARGET_LABELS) - add_subdirectory(TARGET_CYSBSYSKIT_01) -elseif("CYTFM_064B0S2_4343W" IN_LIST MBED_TARGET_LABELS) - add_subdirectory(TARGET_CYTFM_064B0S2_4343W) -elseif("CYW9P62S1_43012EVB_01" IN_LIST MBED_TARGET_LABELS) - add_subdirectory(TARGET_CYW9P62S1_43012EVB_01) -elseif("CYW9P62S1_43438EVB_01" IN_LIST MBED_TARGET_LABELS) - add_subdirectory(TARGET_CYW9P62S1_43438EVB_01) -endif() +add_subdirectory(TARGET_CY8CKIT064B0S2_4343W EXCLUDE_FROM_ALL) +add_subdirectory(TARGET_CY8CKIT_062S2_43012 EXCLUDE_FROM_ALL) +add_subdirectory(TARGET_CY8CKIT_062_BLE EXCLUDE_FROM_ALL) +add_subdirectory(TARGET_CY8CKIT_062_WIFI_BT EXCLUDE_FROM_ALL) +add_subdirectory(TARGET_CY8CPROTO_062S3_4343W EXCLUDE_FROM_ALL) +add_subdirectory(TARGET_CY8CPROTO_062_4343W EXCLUDE_FROM_ALL) +add_subdirectory(TARGET_CYSBSYSKIT_01 EXCLUDE_FROM_ALL) +add_subdirectory(TARGET_CYTFM_064B0S2_4343W EXCLUDE_FROM_ALL) +add_subdirectory(TARGET_CYW9P62S1_43012EVB_01 EXCLUDE_FROM_ALL) +add_subdirectory(TARGET_CYW9P62S1_43438EVB_01 EXCLUDE_FROM_ALL) add_subdirectory(psoc6csp/abstraction/rtos EXCLUDE_FROM_ALL) -if("CM0P_BLESS" IN_LIST MBED_TARGET_LABELS) - target_sources(mbed-core - INTERFACE - psoc6cm0p/COMPONENT_CM0P_BLESS/psoc6_cm0p_bless.c - ) -endif() +add_library(mbed-cm0p-bless INTERFACE) +target_sources(mbed-cm0p-bless + INTERFACE + psoc6cm0p/COMPONENT_CM0P_BLESS/psoc6_cm0p_bless.c +) -if("CM0P_CRYPTO" IN_LIST MBED_TARGET_LABELS) - target_sources(mbed-core - INTERFACE - psoc6cm0p/COMPONENT_CM0P_CRYPTO/psoc6_01_cm0p_crypto.c - psoc6cm0p/COMPONENT_CM0P_CRYPTO/psoc6_02_cm0p_crypto.c - psoc6cm0p/COMPONENT_CM0P_CRYPTO/psoc6_03_cm0p_crypto.c - psoc6cm0p/COMPONENT_CM0P_CRYPTO/psoc6_04_cm0p_crypto.c - ) -endif() +add_library(mbed-cm0p-crypto INTERFACE) +target_sources(mbed-cm0p-crypto + INTERFACE + psoc6cm0p/COMPONENT_CM0P_CRYPTO/psoc6_01_cm0p_crypto.c + psoc6cm0p/COMPONENT_CM0P_CRYPTO/psoc6_02_cm0p_crypto.c + psoc6cm0p/COMPONENT_CM0P_CRYPTO/psoc6_03_cm0p_crypto.c + psoc6cm0p/COMPONENT_CM0P_CRYPTO/psoc6_04_cm0p_crypto.c +) -if("CM0P_SECURE" IN_LIST MBED_TARGET_LABELS) - target_sources(mbed-core - INTERFACE - psoc6cm0p/COMPONENT_CM0P_SECURE/psoc6_02_cm0p_secure.c - psoc6cm0p/COMPONENT_CM0P_SECURE/psoc6_03_cm0p_secure.c - ) -endif() +add_library(mbed-cm0p-secure INTERFACE) +target_sources(mbed-cm0p-secure + INTERFACE + psoc6cm0p/COMPONENT_CM0P_SECURE/psoc6_02_cm0p_secure.c + psoc6cm0p/COMPONENT_CM0P_SECURE/psoc6_03_cm0p_secure.c +) -if("CM0P_SLEEP" IN_LIST MBED_TARGET_LABELS) - target_sources(mbed-core - INTERFACE - psoc6cm0p/COMPONENT_CM0P_SLEEP/psoc6_01_cm0p_sleep.c - psoc6cm0p/COMPONENT_CM0P_SLEEP/psoc6_02_cm0p_sleep.c - psoc6cm0p/COMPONENT_CM0P_SLEEP/psoc6_03_cm0p_sleep.c - psoc6cm0p/COMPONENT_CM0P_SLEEP/psoc6_04_cm0p_sleep.c - ) -endif() +add_library(mbed-cm0p-sleep INTERFACE) +target_sources(mbed-cm0p-sleep + INTERFACE + psoc6cm0p/COMPONENT_CM0P_SLEEP/psoc6_01_cm0p_sleep.c + psoc6cm0p/COMPONENT_CM0P_SLEEP/psoc6_02_cm0p_sleep.c + psoc6cm0p/COMPONENT_CM0P_SLEEP/psoc6_03_cm0p_sleep.c + psoc6cm0p/COMPONENT_CM0P_SLEEP/psoc6_04_cm0p_sleep.c +) -if("UDB_SDIO_P12" IN_LIST MBED_TARGET_LABELS) - target_include_directories(mbed-core - INTERFACE - common/udb-sdio-whd/COMPONENT_UDB_SDIO_P12 - ) +add_library(mbed-udb-sdio-p12 INTERFACE) +target_include_directories(mbed-udb-sdio-p12 + INTERFACE + common/udb-sdio-whd/COMPONENT_UDB_SDIO_P12 +) +target_sources(mbed-udb-sdio-p12 + INTERFACE + common/udb-sdio-whd/COMPONENT_UDB_SDIO_P12/SDIO_HOST_cfg.c +) - target_sources(mbed-core - INTERFACE - common/udb-sdio-whd/COMPONENT_UDB_SDIO_P12/SDIO_HOST_cfg.c - ) -elseif("UDB_SDIO_P2" IN_LIST MBED_TARGET_LABELS) - target_include_directories(mbed-core - INTERFACE - common/udb-sdio-whd/COMPONENT_UDB_SDIO_P2 - ) +add_library(mbed-udb-sdio-p2 INTERFACE) +target_include_directories(mbed-udb-sdio-p2 + INTERFACE + common/udb-sdio-whd/COMPONENT_UDB_SDIO_P2 +) +target_sources(mbed-udb-sdio-p2 + INTERFACE + common/udb-sdio-whd/COMPONENT_UDB_SDIO_P2/SDIO_HOST_cfg.c +) - target_sources(mbed-core - INTERFACE - common/udb-sdio-whd/COMPONENT_UDB_SDIO_P2/SDIO_HOST_cfg.c - ) -elseif("UDB_SDIO_P9" IN_LIST MBED_TARGET_LABELS) - target_include_directories(mbed-core - INTERFACE - common/udb-sdio-whd/COMPONENT_UDB_SDIO_P9 - ) +add_library(mbed-udb-sdio-p9 INTERFACE) +target_include_directories(mbed-udb-sdio-p9 + INTERFACE + common/udb-sdio-whd/COMPONENT_UDB_SDIO_P9 +) +target_sources(mbed-udb-sdio-p9 + INTERFACE + common/udb-sdio-whd/COMPONENT_UDB_SDIO_P9/SDIO_HOST_cfg.c +) - target_sources(mbed-core - INTERFACE - common/udb-sdio-whd/COMPONENT_UDB_SDIO_P9/SDIO_HOST_cfg.c - ) -endif() - -target_include_directories(mbed-core +add_library(mbed-psoc6 INTERFACE) +target_include_directories(mbed-psoc6 INTERFACE . common @@ -130,7 +109,7 @@ elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") set(ASSEMBLY_ROUTINES psoc6pdl/drivers/source/TOOLCHAIN_GCC_ARM/cy_syslib_gcc.S) endif() -target_sources(mbed-core +target_sources(mbed-psoc6 INTERFACE cy_analogin_api.c cy_analogout_api.c @@ -300,3 +279,8 @@ target_sources(mbed-core ${ASSEMBLY_ROUTINES} ) + +# TODO: Include only if mbed-baremetal is not used +if("CY_RTOS_AWARE" IN_LIST MBED_CONFIG_DEFINITIONS) + target_link_libraries(mbed-psoc6 INTERFACE mbed-cy-rtos mbed-cy-rtx) +endif() diff --git a/targets/TARGET_Cypress/TARGET_PSOC6/COMPONENT_SCL/CMakeLists.txt b/targets/TARGET_Cypress/TARGET_PSOC6/COMPONENT_SCL/CMakeLists.txt index 2ad4507e5f..2a1a824acf 100644 --- a/targets/TARGET_Cypress/TARGET_PSOC6/COMPONENT_SCL/CMakeLists.txt +++ b/targets/TARGET_Cypress/TARGET_PSOC6/COMPONENT_SCL/CMakeLists.txt @@ -1,19 +1,19 @@ -# Copyright (c) 2020 ARM Limited. All rights reserved. +# Copyright (c) 2020-2021 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -add_library(mbed-cy_psoc6_scl INTERFACE) +add_library(mbed-cy-psoc6-scl INTERFACE) -target_include_directories(mbed-cy_psoc6_scl +target_include_directories(mbed-cy-psoc6-scl INTERFACE . inc src/include ) -target_sources(mbed-cy_psoc6_scl +target_sources(mbed-cy-psoc6-scl INTERFACE - scl_buffer_api.c - scl_wifi_api.c + src/scl_buffer_api.c + src/scl_wifi_api.c src/IPC/scl_ipc.c ) diff --git a/targets/TARGET_Cypress/TARGET_PSOC6/COMPONENT_WHD/CMakeLists.txt b/targets/TARGET_Cypress/TARGET_PSOC6/COMPONENT_WHD/CMakeLists.txt index 644cc35fc8..5127c51734 100644 --- a/targets/TARGET_Cypress/TARGET_PSOC6/COMPONENT_WHD/CMakeLists.txt +++ b/targets/TARGET_Cypress/TARGET_PSOC6/COMPONENT_WHD/CMakeLists.txt @@ -1,67 +1,103 @@ -# Copyright (c) 2020 ARM Limited. All rights reserved. +# Copyright (c) 2020-2021 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -add_library(mbed-cy_psoc6_whd INTERFACE) +add_library(mbed-cy-psoc6-whd-43012 INTERFACE) +target_include_directories(mbed-cy-psoc6-whd-43012 + INTERFACE + resources/firmware/COMPONENT_43012 +) +target_sources(mbed-cy-psoc6-whd-43012 + INTERFACE + resources/firmware/COMPONENT_43012/43012C0-mfgtest_bin.c + resources/firmware/COMPONENT_43012/43012C0-mfgtest_clm_blob.c + resources/firmware/COMPONENT_43012/43012C0_bin.c + resources/firmware/COMPONENT_43012/43012C0_clm_blob.c +) -if("43012" IN_LIST MBED_TARGET_LABELS) - set(MFGTEST_BIN_C resources/firmware/COMPONENT_43012/43012C0-mfgtest_bin.c) - set(MFGTEST_CLM_BLOB_C resources/firmware/COMPONENT_43012/43012C0-mfgtest_clm_blob.c) - set(BIN_C resources/firmware/COMPONENT_43012/43012C0_bin.c) - set(CLM_BLOB_C resources/firmware/COMPONENT_43012/43012C0_clm_blob.c) - set(RESOURCE_INC_DIR resources/firmware/COMPONENT_43012) -elseif("43438" IN_LIST MBED_TARGET_LABELS) - set(MFGTEST_BIN_C resources/firmware/COMPONENT_43438/43438A1-mfgtest_bin.c) - set(MFGTEST_CLM_BLOB_C resources/firmware/COMPONENT_43438/43438A1-mfgtest_clm_blob.c) - set(BIN_C resources/firmware/COMPONENT_43438/43438A1_bin.c) - set(CLM_BLOB_C resources/firmware/COMPONENT_43438/43438A1_clm_blob.c) - set(RESOURCE_INC_DIR resources/firmware/COMPONENT_43438) -elseif("4343W" IN_LIST MBED_TARGET_LABELS) - set(MFGTEST_BIN_C resources/firmware/COMPONENT_4343W/4343WA1-mfgtest_bin.c) - set(MFGTEST_CLM_BLOB_C resources/firmware/COMPONENT_4343W/4343WA1-mfgtest_clm_blob.c) - set(BIN_C resources/firmware/COMPONENT_4343W/4343WA1_bin.c) - set(CLM_BLOB_C resources/firmware/COMPONENT_4343W/4343WA1_clm_blob.c) - set(RESOURCE_INC_DIR resources/firmware/COMPONENT_4343W) -endif() +add_library(mbed-cy-psoc6-whd-43438 INTERFACE) +target_include_directories(mbed-cy-psoc6-whd-43438 + INTERFACE + resources/firmware/COMPONENT_43438 +) +target_sources(mbed-cy-psoc6-whd-43438 + INTERFACE + resources/firmware/COMPONENT_43438/43438A1-mfgtest_bin.c + resources/firmware/COMPONENT_43438/43438A1-mfgtest_clm_blob.c + resources/firmware/COMPONENT_43438/43438A1_bin.c + resources/firmware/COMPONENT_43438/43438A1_clm_blob.c +) -if("CY8CKIT064B0S2_4343W" IN_LIST MBED_TARGET_LABELS) - set(WIFI_NVRAM_IMAGE_INC_DIR resources/nvram/TARGET_CY8CKIT064B0S2_4343W) -elseif("CY8CKIT_062S2_43012" IN_LIST MBED_TARGET_LABELS) - set(WIFI_NVRAM_IMAGE_INC_DIR resources/nvram/TARGET_CY8CKIT_062S2_43012) -elseif("CY8CKIT_062S2_4343W" IN_LIST MBED_TARGET_LABELS) - set(WIFI_NVRAM_IMAGE_INC_DIR resources/nvram/TARGET_CY8CKIT_062S2_4343W) -elseif("CY8CKIT_062_4343W" IN_LIST MBED_TARGET_LABELS) - set(WIFI_NVRAM_IMAGE_INC_DIR resources/nvram/TARGET_CY8CKIT_062_4343W) -elseif("CY8CKIT_062_WIFI_BT" IN_LIST MBED_TARGET_LABELS) - set(WIFI_NVRAM_IMAGE_INC_DIR resources/nvram/TARGET_CY8CKIT_062_WIFI_BT) -elseif("CY8CKIT_064S1_4343W" IN_LIST MBED_TARGET_LABELS) - set(WIFI_NVRAM_IMAGE_INC_DIR resources/nvram/TARGET_CY8CKIT_064S1_4343W) -elseif("CY8CKIT_064S2_4343W" IN_LIST MBED_TARGET_LABELS) - set(WIFI_NVRAM_IMAGE_INC_DIR resources/nvram/TARGET_CY8CKIT_064S2_4343W) -elseif("CY8CMOD_062S2_43012" IN_LIST MBED_TARGET_LABELS) - set(WIFI_NVRAM_IMAGE_INC_DIR resources/nvram/TARGET_CY8CMOD_062S2_43012) -elseif("CY8CMOD_062S3_4343W" IN_LIST MBED_TARGET_LABELS) - set(WIFI_NVRAM_IMAGE_INC_DIR resources/nvram/TARGET_CY8CMOD_062S3_4343W) -elseif("CY8CMOD_062_4343W" IN_LIST MBED_TARGET_LABELS) - set(WIFI_NVRAM_IMAGE_INC_DIR resources/nvram/TARGET_CY8CMOD_062_4343W) -elseif("CY8CPROTO_062S3_4343W" IN_LIST MBED_TARGET_LABELS) - set(WIFI_NVRAM_IMAGE_INC_DIR resources/nvram/TARGET_CY8CPROTO_062S3_4343W) -elseif("CY8CPROTO_062_4343W" IN_LIST MBED_TARGET_LABELS) - set(WIFI_NVRAM_IMAGE_INC_DIR resources/nvram/TARGET_CY8CPROTO_062_4343W) -elseif("CYTFM_064B0S2_4343W" IN_LIST MBED_TARGET_LABELS) - set(WIFI_NVRAM_IMAGE_INC_DIR resources/nvram/TARGET_CYTFM_064B0S2_4343W) -elseif("CYW943012P6EVB_01" IN_LIST MBED_TARGET_LABELS) - set(WIFI_NVRAM_IMAGE_INC_DIR resources/nvram/TARGET_CYW943012P6EVB_01) -elseif("CYW943012WCD2" IN_LIST MBED_TARGET_LABELS) - set(WIFI_NVRAM_IMAGE_INC_DIR resources/nvram/TARGET_CYW943012WCD2) -elseif("CYW9P62S1_43012CAR_01" IN_LIST MBED_TARGET_LABELS) - set(WIFI_NVRAM_IMAGE_INC_DIR resources/nvram/TARGET_CYW9P62S1_43012CAR_01) -elseif("CYW9P62S1_43012EVB_01" IN_LIST MBED_TARGET_LABELS) - set(WIFI_NVRAM_IMAGE_INC_DIR resources/nvram/TARGET_CYW9P62S1_43012EVB_01) -elseif("CYW9P62S1_43438EVB_01" IN_LIST MBED_TARGET_LABELS) - set(WIFI_NVRAM_IMAGE_INC_DIR resources/nvram/TARGET_CYW9P62S1_43438EVB_01) -endif() +add_library(mbed-cy-psoc6-whd-4343w INTERFACE) +target_include_directories(mbed-cy-psoc6-whd-4343w + INTERFACE + resources/firmware/COMPONENT_4343W +) +target_sources(mbed-cy-psoc6-whd-4343w + INTERFACE + resources/firmware/COMPONENT_4343W/4343WA1-mfgtest_bin.c + resources/firmware/COMPONENT_4343W/4343WA1-mfgtest_clm_blob.c + resources/firmware/COMPONENT_4343W/4343WA1_bin.c + resources/firmware/COMPONENT_4343W/4343WA1_clm_blob.c +) -target_include_directories(mbed-cy_psoc6_whd +add_library(mbed-cy8ckit-062s2-43012-whd INTERFACE) +target_include_directories(mbed-cy8ckit-062s2-43012-whd INTERFACE resources/nvram/TARGET_CY8CKIT_062S2_43012) + +add_library(mbed-cy8ckit-062s2-4343w-whd INTERFACE) +target_include_directories(mbed-cy8ckit-062s2-4343w-whd INTERFACE resources/nvram/TARGET_CY8CKIT_062S2_4343W) + +add_library(mbed-cy8ckit-062-4343w-whd INTERFACE) +target_include_directories(mbed-cy8ckit-062-4343w-whd INTERFACE resources/nvram/TARGET_CY8CKIT_062_4343W) + +add_library(mbed-cy8ckit-062-wifi-bt-whd INTERFACE) +target_include_directories(mbed-cy8ckit-062-wifi-bt-whd INTERFACE resources/nvram/TARGET_CY8CKIT_062_WIFI_BT) + +add_library(mbed-cy8ckit-064s1-4343w-whd INTERFACE) +target_include_directories(mbed-cy8ckit-064s1-4343w-whd INTERFACE resources/nvram/TARGET_CY8CKIT_064S1_4343W) + +add_library(mbed-cy8ckit-064s2-4343w-whd INTERFACE) +target_include_directories(mbed-cy8ckit-064s2-4343w-whd INTERFACE resources/nvram/TARGET_CY8CKIT_064S2_4343W) + +add_library(mbed-cy8cmod-062s2-43012-whd INTERFACE) +target_include_directories(mbed-cy8cmod-062s2-43012-whd INTERFACE resources/nvram/TARGET_CY8CMOD_062S2_43012) + +add_library(mbed-cy8cmod-062s3-4343w-whd INTERFACE) +target_include_directories(mbed-cy8cmod-062s3-4343w-whd INTERFACE resources/nvram/TARGET_CY8CMOD_062S3_4343W) + +add_library(mbed-cy8cmod-062-4343w-whd INTERFACE) +target_include_directories(mbed-cy8cmod-062-4343w-whd INTERFACE resources/nvram/TARGET_CY8CMOD_062_4343W) + +add_library(mbed-cy8cproto-062s3-4343w-whd INTERFACE) +target_include_directories(mbed-cy8cproto-062s3-4343w-whd INTERFACE resources/nvram/TARGET_CY8CPROTO_062S3_4343W) + +add_library(mbed-cy8cproto-062-4343w-whd INTERFACE) +target_include_directories(mbed-cy8cproto-062-4343w-whd INTERFACE resources/nvram/TARGET_CY8CPROTO_062_4343W) + +add_library(mbed-cytfm-064b0s2-4343w-whd INTERFACE) +target_include_directories(mbed-cytfm-064b0s2-4343w-whd INTERFACE resources/nvram/TARGET_CYTFM_064B0S2_4343W) + +add_library(mbed-cyw943012p6evb-01-whd INTERFACE) +target_include_directories(mbed-cyw943012p6evb-01-whd INTERFACE resources/nvram/TARGET_CYW943012P6EVB_01) + +add_library(mbed-cyw943012wcd2-whd INTERFACE) +target_include_directories(mbed-cyw943012wcd2-whd INTERFACE resources/nvram/TARGET_CYW943012WCD2) + +add_library(mbed-cyw9p62s1-43012car-01-whd INTERFACE) +target_include_directories(mbed-cyw9p62s1-43012car-01-whd INTERFACE resources/nvram/TARGET_CYW9P62S1_43012CAR_01) + +add_library(mbed-cyw9p62s1-43012evb-01-whd INTERFACE) +target_include_directories(mbed-cyw9p62s1-43012evb-01-whd INTERFACE resources/nvram/TARGET_CYW9P62S1_43012EVB_01) + +add_library(mbed-cyw9p62s1-43438evb-01-whd INTERFACE) +target_include_directories(mbed-cyw9p62s1-43438evb-01-whd INTERFACE resources/nvram/TARGET_CYW9P62S1_43438EVB_01) + +add_library(mbed-cy8ckit-064b0s2-4343w-whd INTERFACE) +target_include_directories(mbed-cy8ckit-064b0s2-4343w-whd INTERFACE resources/nvram/TARGET_CY8CKIT_064B0S2_4343W) + + +add_library(mbed-cy-psoc6-whd INTERFACE) + +target_include_directories(mbed-cy-psoc6-whd INTERFACE . inc @@ -69,11 +105,9 @@ target_include_directories(mbed-cy_psoc6_whd src src/include src/bus_protocols - ${RESOURCE_INC_DIR} - ${WIFI_NVRAM_IMAGE_INC_DIR} ) -target_sources(mbed-cy_psoc6_whd +target_sources(mbed-cy-psoc6-whd INTERFACE resources/resource_imp/whd_resources.c @@ -100,14 +134,9 @@ target_sources(mbed-cy_psoc6_whd src/bus_protocols/whd_bus_common.c src/bus_protocols/whd_bus_sdio_protocol.c src/bus_protocols/whd_bus_spi_protocol.c - - ${MFGTEST_BIN_C} - ${MFGTEST_CLM_BLOB_C} - ${BIN_C} - ${CLM_BLOB_C} ) -target_compile_definitions(mbed-cy_psoc6_whd +target_compile_definitions(mbed-cy-psoc6-whd INTERFACE MBED_CONF_CY_PSOC6_WHD_PRESENT=1 ) diff --git a/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CKIT064B0S2_4343W/CMakeLists.txt b/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CKIT064B0S2_4343W/CMakeLists.txt index 583879e5e3..8aa0f567c7 100644 --- a/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CKIT064B0S2_4343W/CMakeLists.txt +++ b/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CKIT064B0S2_4343W/CMakeLists.txt @@ -1,64 +1,82 @@ -# Copyright (c) 2020 ARM Limited. All rights reserved. +# Copyright (c) 2020-2021 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 include(${MBED_PATH}/targets/TARGET_Cypress/scripts/mbed_set_post_build_cypress.cmake) -if("BSP_DESIGN_MODUS" IN_LIST MBED_TARGET_LABELS) - target_include_directories(mbed-core - INTERFACE - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource - ) - - target_sources(mbed-core - INTERFACE - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_clocks.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_peripherals.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_pins.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_qspi_memslot.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_routing.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_system.c - ) -endif() - -if("CM0P" IN_LIST MBED_TARGET_LABELS) - set(SYSTEM_SOURCE device/COMPONENT_CM0P/system_psoc6_cm0plus.c) - if(${MBED_TOOLCHAIN} STREQUAL "ARM") - set(STARTUP_FILE device/COMPONENT_CM0P/TOOLCHAIN_ARM/startup_psoc6_02_cm0plus.S) - set(LINKER_FILE device/COMPONENT_CM0P/TOOLCHAIN_ARM/cyb06xxa_cm0plus.sct) - elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") - set(STARTUP_FILE device/COMPONENT_CM0P/TOOLCHAIN_GCC_ARM/startup_psoc6_02_cm0plus.S) - set(LINKER_FILE device/COMPONENT_CM0P/TOOLCHAIN_GCC_ARM/cyb06xxa_cm0plus.ld) - endif() -elseif("CM4" IN_LIST MBED_TARGET_LABELS) - set(SYSTEM_SOURCE device/COMPONENT_CM4/system_psoc6_cm4.c) - if(${MBED_TOOLCHAIN} STREQUAL "ARM") - set(STARTUP_FILE device/COMPONENT_CM4/TOOLCHAIN_ARM/startup_psoc6_02_cm4.S) - set(LINKER_FILE device/COMPONENT_CM4/TOOLCHAIN_ARM/cyb06xxa_cm4_dual.sct) - elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") - set(STARTUP_FILE device/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/startup_psoc6_02_cm4.S) - set(LINKER_FILE device/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/cyb06xxa_cm4_dual.ld) - endif() -endif() - -set_property( - GLOBAL PROPERTY - MBED_TARGET_LINKER_FILE - ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE} +add_library(mbed-cy8ckit064b0s2-4343w-bsp-design-modus INTERFACE) +target_include_directories(mbed-cy8ckit064b0s2-4343w-bsp-design-modus + INTERFACE + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource +) +target_sources(mbed-cy8ckit064b0s2-4343w-bsp-design-modus + INTERFACE + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_clocks.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_peripherals.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_pins.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_qspi_memslot.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_routing.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_system.c ) -target_include_directories(mbed-core +add_library(mbed-cy8ckit064b0s2-4343w-cm0p INTERFACE) +if(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(STARTUP_FILE_CM0P device/COMPONENT_CM0P/TOOLCHAIN_ARM/startup_psoc6_02_cm0plus.S) + set(LINKER_FILE_CM0P device/COMPONENT_CM0P/TOOLCHAIN_ARM/cyb06xxa_cm0plus.sct) +elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(STARTUP_FILE_CM0P device/COMPONENT_CM0P/TOOLCHAIN_GCC_ARM/startup_psoc6_02_cm0plus.S) + set(LINKER_FILE_CM0P device/COMPONENT_CM0P/TOOLCHAIN_GCC_ARM/cyb06xxa_cm0plus.ld) +endif() +target_sources(mbed-cy8ckit064b0s2-4343w-cm0p + INTERFACE + device/COMPONENT_CM0P/system_psoc6_cm0plus.c + ${STARTUP_FILE_CM0P} +) +mbed_set_linker_script(mbed-cy8ckit064b0s2-4343w-cm0p ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE_CM0P}) + +add_library(mbed-cy8ckit064b0s2-4343w-cm4 INTERFACE) +if(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(STARTUP_FILE_CM4 device/COMPONENT_CM4/TOOLCHAIN_ARM/startup_psoc6_02_cm4.S) + set(LINKER_FILE_CM4 device/COMPONENT_CM4/TOOLCHAIN_ARM/cyb06xxa_cm4_dual.sct) +elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(STARTUP_FILE_CM4 device/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/startup_psoc6_02_cm4.S) + set(LINKER_FILE_CM4 device/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/cyb06xxa_cm4_dual.ld) +endif() +target_sources(mbed-cy8ckit064b0s2-4343w-cm4 + INTERFACE + device/COMPONENT_CM4/system_psoc6_cm4.c + ${STARTUP_FILE_CM4} +) +mbed_set_linker_script(mbed-cy8ckit064b0s2-4343w-cm4 ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE_CM4}) + +add_library(mbed-cy8ckit064b0s2-4343w INTERFACE) +target_include_directories(mbed-cy8ckit064b0s2-4343w INTERFACE . device ) - -target_sources(mbed-core +target_sources(mbed-cy8ckit064b0s2-4343w INTERFACE PeripheralPins.c cybsp.c - ${SYSTEM_SOURCE} - ${STARTUP_FILE} +) +target_link_libraries(mbed-cy8ckit064b0s2-4343w + INTERFACE + mbed-cat1a + mbed-cy8ckit064b0s2-4343w-cm4 + mbed-cy8ckit064b0s2-4343w-bsp-design-modus + mbed-cm0p-secure + mbed-psoc6 + mbed-cy-psoc6-whd + mbed-cy-psoc6-whd-4343w + mbed-cy8ckit-064b0s2-4343w-whd +) + +target_compile_definitions(mbed-cy8ckit064b0s2-4343w + INTERFACE + "CYB0644ABZI_S2D44" + "CY_IPC_DEFAULT_CFG_DISABLE" + "CYBSP_WIFI_CAPABLE" ) mbed_post_build_psoc6_sign_image( diff --git a/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CKIT_062S2_43012/CMakeLists.txt b/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CKIT_062S2_43012/CMakeLists.txt index 4707e55952..ffef882205 100644 --- a/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CKIT_062S2_43012/CMakeLists.txt +++ b/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CKIT_062S2_43012/CMakeLists.txt @@ -1,60 +1,77 @@ -# Copyright (c) 2020 ARM Limited. All rights reserved. +# Copyright (c) 2020-2021 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -if("BSP_DESIGN_MODUS" IN_LIST MBED_TARGET_LABELS) - target_include_directories(mbed-core - INTERFACE - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource - ) - - target_sources(mbed-core - INTERFACE - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_clocks.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_peripherals.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_pins.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_qspi_memslot.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_routing.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_system.c - ) -endif() - -if("CM0P" IN_LIST MBED_TARGET_LABELS) - set(SYSTEM_SOURCE device/COMPONENT_CM0P/system_psoc6_cm0plus.c) - if(${MBED_TOOLCHAIN} STREQUAL "ARM") - set(STARTUP_FILE device/COMPONENT_CM0P/TOOLCHAIN_ARM/startup_psoc6_02_cm0plus.S) - set(LINKER_FILE device/COMPONENT_CM0P/TOOLCHAIN_ARM/cy8c6xxa_cm0plus.sct) - elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") - set(STARTUP_FILE device/COMPONENT_CM0P/TOOLCHAIN_GCC_ARM/startup_psoc6_02_cm0plus.S) - set(LINKER_FILE device/COMPONENT_CM0P/TOOLCHAIN_GCC_ARM/cy8c6xxa_cm0plus.ld) - endif() -elseif("CM4" IN_LIST MBED_TARGET_LABELS) - set(SYSTEM_SOURCE device/COMPONENT_CM4/system_psoc6_cm4.c) - if(${MBED_TOOLCHAIN} STREQUAL "ARM") - set(STARTUP_FILE device/COMPONENT_CM4/TOOLCHAIN_ARM/startup_psoc6_02_cm4.S) - set(LINKER_FILE device/COMPONENT_CM4/TOOLCHAIN_ARM/cy8c6xxa_cm4_dual.sct) - elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") - set(STARTUP_FILE device/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/startup_psoc6_02_cm4.S) - set(LINKER_FILE device/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/cy8c6xxa_cm4_dual.ld) - endif() -endif() - -set_property( - GLOBAL PROPERTY - MBED_TARGET_LINKER_FILE - ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE} +add_library(mbed-cy8ckit-062s2-43012-bsp-design-modus INTERFACE) +target_include_directories(mbed-cy8ckit-062s2-43012-bsp-design-modus + INTERFACE + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource +) +target_sources(mbed-cy8ckit-062s2-43012-bsp-design-modus + INTERFACE + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_clocks.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_peripherals.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_pins.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_qspi_memslot.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_routing.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_system.c ) -target_include_directories(mbed-core +add_library(mbed-cy8ckit-062s2-43012-cm0p INTERFACE) +if(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(STARTUP_FILE_CM0P device/COMPONENT_CM0P/TOOLCHAIN_ARM/startup_psoc6_02_cm0plus.S) + set(LINKER_FILE_CM0P device/COMPONENT_CM0P/TOOLCHAIN_ARM/cy8c6xxa_cm0plus.sct) +elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(STARTUP_FILE_CM0P device/COMPONENT_CM0P/TOOLCHAIN_GCC_ARM/startup_psoc6_02_cm0plus.S) + set(LINKER_FILE_CM0P device/COMPONENT_CM0P/TOOLCHAIN_GCC_ARM/cy8c6xxa_cm0plus.ld) +endif() +target_sources(mbed-cy8ckit-062s2-43012-cm0p + INTERFACE + device/COMPONENT_CM0P/system_psoc6_cm0plus.c + ${STARTUP_FILE_CM0P} +) +mbed_set_linker_script(mbed-cy8ckit-062s2-43012-cm0p ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE_CM0P}) + +add_library(mbed-cy8ckit-062s2-43012-cm4 INTERFACE) +if(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(STARTUP_FILE_CM4 device/COMPONENT_CM4/TOOLCHAIN_ARM/startup_psoc6_02_cm4.S) + set(LINKER_FILE_CM4 device/COMPONENT_CM4/TOOLCHAIN_ARM/cy8c6xxa_cm4_dual.sct) +elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(STARTUP_FILE_CM4 device/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/startup_psoc6_02_cm4.S) + set(LINKER_FILE_CM4 device/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/cy8c6xxa_cm4_dual.ld) +endif() +target_sources(mbed-cy8ckit-062s2-43012-cm4 + INTERFACE + device/COMPONENT_CM4/system_psoc6_cm4.c + ${STARTUP_FILE_CM4} +) +mbed_set_linker_script(mbed-cy8ckit-062s2-43012-cm4 ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE_CM4}) + +add_library(mbed-cy8ckit-062s2-43012 INTERFACE) +target_include_directories(mbed-cy8ckit-062s2-43012 INTERFACE . device ) - -target_sources(mbed-core +target_sources(mbed-cy8ckit-062s2-43012 INTERFACE PeripheralPins.c cybsp.c - ${SYSTEM_SOURCE} - ${STARTUP_FILE} +) +target_link_libraries(mbed-cy8ckit-062s2-43012 + INTERFACE + mbed-cat1a + mbed-cy8ckit-062s2-43012-cm4 + mbed-cy8ckit-062s2-43012-bsp-design-modus + mbed-cm0p-sleep + mbed-psoc6 + mbed-cy-psoc6-whd + mbed-cy-psoc6-whd-43012 + mbed-cy8ckit-062s2-43012-whd +) + +target_compile_definitions(mbed-cy8ckit-062s2-43012 + INTERFACE + "CY8C624ABZI_D44" + "CYBSP_WIFI_CAPABLE" ) diff --git a/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CKIT_062_BLE/CMakeLists.txt b/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CKIT_062_BLE/CMakeLists.txt index f4f35dd9e5..78ab98a08b 100644 --- a/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CKIT_062_BLE/CMakeLists.txt +++ b/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CKIT_062_BLE/CMakeLists.txt @@ -1,60 +1,74 @@ -# Copyright (c) 2020 ARM Limited. All rights reserved. +# Copyright (c) 2020-2021 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -if("BSP_DESIGN_MODUS" IN_LIST MBED_TARGET_LABELS) - target_include_directories(mbed-core - INTERFACE - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource - ) - - target_sources(mbed-core - INTERFACE - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_clocks.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_peripherals.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_pins.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_qspi_memslot.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_routing.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_system.c - ) -endif() - -if("CM0P" IN_LIST MBED_TARGET_LABELS) - set(SYSTEM_SOURCE device/COMPONENT_CM0P/system_psoc6_cm0plus.c) - if(${MBED_TOOLCHAIN} STREQUAL "ARM") - set(LINKER_FILE device/COMPONENT_CM0P/TOOLCHAIN_ARM/cy8c6xx7_cm0plus.sct) - set(STARTUP_FILE device/COMPONENT_CM0P/TOOLCHAIN_ARM/startup_psoc6_01_cm0plus.S) - elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") - set(LINKER_FILE device/COMPONENT_CM0P/TOOLCHAIN_GCC_ARM/cy8c6xx7_cm0plus.ld) - set(STARTUP_FILE device/COMPONENT_CM0P/TOOLCHAIN_GCC_ARM/startup_psoc6_01_cm0plus.S) - endif() -elseif("CM4" IN_LIST MBED_TARGET_LABELS) - set(SYSTEM_SOURCE device/COMPONENT_CM4/system_psoc6_cm4.c) - if(${MBED_TOOLCHAIN} STREQUAL "ARM") - set(LINKER_FILE device/COMPONENT_CM4/TOOLCHAIN_ARM/cy8c6xx7_cm4_dual.sct) - set(STARTUP_FILE device/COMPONENT_CM4/TOOLCHAIN_ARM/startup_psoc6_01_cm4.S) - elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") - set(LINKER_FILE device/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/cy8c6xx7_cm4_dual.ld) - set(STARTUP_FILE device/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/startup_psoc6_01_cm4.S) - endif() -endif() - -set_property( - GLOBAL PROPERTY - MBED_TARGET_LINKER_FILE - ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE} +add_library(mbed-cy8ckit-062-ble-bsp-design-modus INTERFACE) +target_include_directories(mbed-cy8ckit-062-ble-bsp-design-modus + INTERFACE + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource +) +target_sources(mbed-cy8ckit-062-ble-bsp-design-modus + INTERFACE + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_clocks.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_peripherals.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_pins.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_qspi_memslot.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_routing.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_system.c ) -target_include_directories(mbed-core +add_library(mbed-cy8ckit-062-ble-cm0p INTERFACE) +if(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(LINKER_FILE_CM0P device/COMPONENT_CM0P/TOOLCHAIN_ARM/cy8c6xx7_cm0plus.sct) + set(STARTUP_FILE_CM0P device/COMPONENT_CM0P/TOOLCHAIN_ARM/startup_psoc6_01_cm0plus.S) +elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(LINKER_FILE_CM0P device/COMPONENT_CM0P/TOOLCHAIN_GCC_ARM/cy8c6xx7_cm0plus.ld) + set(STARTUP_FILE_CM0P device/COMPONENT_CM0P/TOOLCHAIN_GCC_ARM/startup_psoc6_01_cm0plus.S) +endif() +target_sources(mbed-cy8ckit-062-ble-cm0p + INTERFACE + device/COMPONENT_CM0P/system_psoc6_cm0plus.c + ${STARTUP_FILE_CM0P} +) +mbed_set_linker_script(mbed-cy8ckit-062-ble-cm0p ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE_CM0P}) + +add_library(mbed-cy8ckit-062-ble-cm4 INTERFACE) +if(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(LINKER_FILE_CM4 device/COMPONENT_CM4/TOOLCHAIN_ARM/cy8c6xx7_cm4_dual.sct) + set(STARTUP_FILE_CM4 device/COMPONENT_CM4/TOOLCHAIN_ARM/startup_psoc6_01_cm4.S) +elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(LINKER_FILE_CM4 device/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/cy8c6xx7_cm4_dual.ld) + set(STARTUP_FILE_CM4 device/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/startup_psoc6_01_cm4.S) +endif() +target_sources(mbed-cy8ckit-062-ble-cm4 + INTERFACE + device/COMPONENT_CM4/system_psoc6_cm4.c + ${STARTUP_FILE_CM4} +) +mbed_set_linker_script(mbed-cy8ckit-062-ble-cm4 ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE_CM4}) + + +add_library(mbed-cy8ckit-062-ble INTERFACE) +target_include_directories(mbed-cy8ckit-062-ble INTERFACE . device ) - -target_sources(mbed-core +target_sources(mbed-cy8ckit-062-ble INTERFACE PeripheralPins.c cybsp.c - ${SYSTEM_SOURCE} - ${STARTUP_FILE} +) +target_link_libraries(mbed-cy8ckit-062-ble + INTERFACE + mbed-cat1a + mbed-cy8ckit-062-ble-cm4 + mbed-cy8ckit-062-ble-bsp-design-modus + mbed-cm0p-sleep + mbed-psoc6 +) + +target_compile_definitions(mbed-cy8ckit-062-ble + INTERFACE + "CY8C6347BZI_BLD53" ) diff --git a/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CKIT_062_WIFI_BT/CMakeLists.txt b/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CKIT_062_WIFI_BT/CMakeLists.txt index f4f35dd9e5..5ca0d671bc 100644 --- a/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CKIT_062_WIFI_BT/CMakeLists.txt +++ b/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CKIT_062_WIFI_BT/CMakeLists.txt @@ -1,60 +1,79 @@ -# Copyright (c) 2020 ARM Limited. All rights reserved. +# Copyright (c) 2020-2021 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -if("BSP_DESIGN_MODUS" IN_LIST MBED_TARGET_LABELS) - target_include_directories(mbed-core - INTERFACE - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource - ) - - target_sources(mbed-core - INTERFACE - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_clocks.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_peripherals.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_pins.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_qspi_memslot.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_routing.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_system.c - ) -endif() - -if("CM0P" IN_LIST MBED_TARGET_LABELS) - set(SYSTEM_SOURCE device/COMPONENT_CM0P/system_psoc6_cm0plus.c) - if(${MBED_TOOLCHAIN} STREQUAL "ARM") - set(LINKER_FILE device/COMPONENT_CM0P/TOOLCHAIN_ARM/cy8c6xx7_cm0plus.sct) - set(STARTUP_FILE device/COMPONENT_CM0P/TOOLCHAIN_ARM/startup_psoc6_01_cm0plus.S) - elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") - set(LINKER_FILE device/COMPONENT_CM0P/TOOLCHAIN_GCC_ARM/cy8c6xx7_cm0plus.ld) - set(STARTUP_FILE device/COMPONENT_CM0P/TOOLCHAIN_GCC_ARM/startup_psoc6_01_cm0plus.S) - endif() -elseif("CM4" IN_LIST MBED_TARGET_LABELS) - set(SYSTEM_SOURCE device/COMPONENT_CM4/system_psoc6_cm4.c) - if(${MBED_TOOLCHAIN} STREQUAL "ARM") - set(LINKER_FILE device/COMPONENT_CM4/TOOLCHAIN_ARM/cy8c6xx7_cm4_dual.sct) - set(STARTUP_FILE device/COMPONENT_CM4/TOOLCHAIN_ARM/startup_psoc6_01_cm4.S) - elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") - set(LINKER_FILE device/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/cy8c6xx7_cm4_dual.ld) - set(STARTUP_FILE device/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/startup_psoc6_01_cm4.S) - endif() -endif() - -set_property( - GLOBAL PROPERTY - MBED_TARGET_LINKER_FILE - ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE} +add_library(mbed-cy8ckit-062-wifi-bt-bsp-design-modus INTERFACE) +target_include_directories(mbed-cy8ckit-062-wifi-bt-bsp-design-modus + INTERFACE + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource +) +target_sources(mbed-cy8ckit-062-wifi-bt-bsp-design-modus + INTERFACE + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_clocks.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_peripherals.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_pins.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_qspi_memslot.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_routing.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_system.c ) -target_include_directories(mbed-core +add_library(mbed-cy8ckit-062-wifi-bt-cm0p INTERFACE) +if(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(LINKER_FILE_CM0P device/COMPONENT_CM0P/TOOLCHAIN_ARM/cy8c6xx7_cm0plus.sct) + set(STARTUP_FILE_CM0P device/COMPONENT_CM0P/TOOLCHAIN_ARM/startup_psoc6_01_cm0plus.S) +elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(LINKER_FILE_CM0P device/COMPONENT_CM0P/TOOLCHAIN_GCC_ARM/cy8c6xx7_cm0plus.ld) + set(STARTUP_FILE_CM0P device/COMPONENT_CM0P/TOOLCHAIN_GCC_ARM/startup_psoc6_01_cm0plus.S) +endif() +target_sources(mbed-cy8ckit-062-wifi-bt-cm0p + INTERFACE + device/COMPONENT_CM0P/system_psoc6_cm0plus.c + ${STARTUP_FILE_CM0P} +) +mbed_set_linker_script(mbed-cy8ckit-062-wifi-bt-cm0p ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE_CM0P}) + +add_library(mbed-cy8ckit-062-wifi-bt-cm4 INTERFACE) +if(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(LINKER_FILE_CM4 device/COMPONENT_CM4/TOOLCHAIN_ARM/cy8c6xx7_cm4_dual.sct) + set(STARTUP_FILE_CM4 device/COMPONENT_CM4/TOOLCHAIN_ARM/startup_psoc6_01_cm4.S) +elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(LINKER_FILE_CM4 device/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/cy8c6xx7_cm4_dual.ld) + set(STARTUP_FILE_CM4 device/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/startup_psoc6_01_cm4.S) +endif() +target_sources(mbed-cy8ckit-062-wifi-bt-cm4 + INTERFACE + device/COMPONENT_CM4/system_psoc6_cm4.c + ${STARTUP_FILE_CM4} +) +mbed_set_linker_script(mbed-cy8ckit-062-wifi-bt-cm4 ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE_CM4}) + +add_library(mbed-cy8ckit-062-wifi-bt INTERFACE) +target_include_directories(mbed-cy8ckit-062-wifi-bt INTERFACE . device ) - -target_sources(mbed-core +target_sources(mbed-cy8ckit-062-wifi-bt INTERFACE PeripheralPins.c cybsp.c - ${SYSTEM_SOURCE} - ${STARTUP_FILE} +) +target_link_libraries(mbed-cy8ckit-062-wifi-bt + INTERFACE + mbed-cat1a + mbed-cy8ckit-062-wifi-bt-cm4 + mbed-cy8ckit-062-wifi-bt-bsp-design-modus + mbed-cm0p-sleep + mbed-psoc6 + mbed-cy-psoc6-whd + mbed-cy-psoc6-whd-4343w + mbed-cy8ckit-062-wifi-bt-whd + mbed-udb-sdio-p12 +) + +target_compile_definitions(mbed-cy8ckit-062-wifi-bt + INTERFACE + "CY8C6247BZI_D54" + "CYHAL_UDB_SDIO" + "CYBSP_WIFI_CAPABLE" ) diff --git a/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CPROTO_062S3_4343W/CMakeLists.txt b/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CPROTO_062S3_4343W/CMakeLists.txt index 469f0dd0fd..624167648a 100644 --- a/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CPROTO_062S3_4343W/CMakeLists.txt +++ b/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CPROTO_062S3_4343W/CMakeLists.txt @@ -1,60 +1,78 @@ -# Copyright (c) 2020 ARM Limited. All rights reserved. +# Copyright (c) 2020-2021 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -if("BSP_DESIGN_MODUS" IN_LIST MBED_TARGET_LABELS) - target_include_directories(mbed-core - INTERFACE - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource - ) - - target_sources(mbed-core - INTERFACE - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_clocks.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_peripherals.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_pins.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_qspi_memslot.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_routing.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_system.c - ) -endif() - -if("CM0P" IN_LIST MBED_TARGET_LABELS) - set(SYSTEM_SOURCE device/COMPONENT_CM0P/system_psoc6_cm0plus.c) - if(${MBED_TOOLCHAIN} STREQUAL "ARM") - set(LINKER_FILE device/COMPONENT_CM0P/TOOLCHAIN_ARM/cy8c6xx5_cm0plus.sct) - set(STARTUP_FILE device/COMPONENT_CM0P/TOOLCHAIN_ARM/startup_psoc6_03_cm0plus.S) - elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") - set(LINKER_FILE device/COMPONENT_CM0P/TOOLCHAIN_GCC_ARM/cy8c6xx5_cm0plus.ld) - set(STARTUP_FILE device/COMPONENT_CM0P/TOOLCHAIN_GCC_ARM/startup_psoc6_03_cm0plus.S) - endif() -elseif("CM4" IN_LIST MBED_TARGET_LABELS) - set(SYSTEM_SOURCE device/COMPONENT_CM4/system_psoc6_cm4.c) - if(${MBED_TOOLCHAIN} STREQUAL "ARM") - set(LINKER_FILE device/COMPONENT_CM4/TOOLCHAIN_ARM/cy8c6xx5_cm4_dual.sct) - set(STARTUP_FILE device/COMPONENT_CM4/TOOLCHAIN_ARM/startup_psoc6_03_cm4.S) - elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") - set(LINKER_FILE device/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/cy8c6xx5_cm4_dual.ld) - set(STARTUP_FILE device/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/startup_psoc6_03_cm4.S) - endif() -endif() - -set_property( - GLOBAL PROPERTY - MBED_TARGET_LINKER_FILE - ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE} +add_library(mbed-cy8cproto-062s3-4343w-bsp-design-modus INTERFACE) +target_include_directories(mbed-cy8cproto-062s3-4343w-bsp-design-modus + INTERFACE + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource +) +target_sources(mbed-cy8cproto-062s3-4343w-bsp-design-modus + INTERFACE + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_clocks.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_peripherals.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_pins.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_qspi_memslot.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_routing.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_system.c ) -target_include_directories(mbed-core +add_library(mbed-cy8cproto-062s3-4343w-cm0p INTERFACE) +if(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(LINKER_FILE_CM0P device/COMPONENT_CM0P/TOOLCHAIN_ARM/cy8c6xx5_cm0plus.sct) + set(STARTUP_FILE_CM0P device/COMPONENT_CM0P/TOOLCHAIN_ARM/startup_psoc6_03_cm0plus.S) +elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(LINKER_FILE_CM0P device/COMPONENT_CM0P/TOOLCHAIN_GCC_ARM/cy8c6xx5_cm0plus.ld) + set(STARTUP_FILE_CM0P device/COMPONENT_CM0P/TOOLCHAIN_GCC_ARM/startup_psoc6_03_cm0plus.S) +endif() +target_sources(mbed-cy8cproto-062s3-4343w-cm0p + INTERFACE + device/COMPONENT_CM0P/system_psoc6_cm0plus.c + ${STARTUP_FILE_CM0P} +) +mbed_set_linker_script(mbed-cy8cproto-062s3-4343w-cm0p ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE_CM0P}) + +add_library(mbed-cy8cproto-062s3-4343w-cm4 INTERFACE) +if(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(LINKER_FILE_CM4 device/COMPONENT_CM4/TOOLCHAIN_ARM/cy8c6xx5_cm4_dual.sct) + set(STARTUP_FILE_CM4 device/COMPONENT_CM4/TOOLCHAIN_ARM/startup_psoc6_03_cm4.S) +elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(LINKER_FILE_CM4 device/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/cy8c6xx5_cm4_dual.ld) + set(STARTUP_FILE_CM4 device/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/startup_psoc6_03_cm4.S) +endif() +target_sources(mbed-cy8cproto-062s3-4343w-cm4 + INTERFACE + device/COMPONENT_CM4/system_psoc6_cm4.c + ${STARTUP_FILE_CM4} +) +mbed_set_linker_script(mbed-cy8cproto-062s3-4343w-cm4 ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE_CM4}) + +add_library(mbed-cy8cproto-062s3-4343w INTERFACE) +target_include_directories(mbed-cy8cproto-062s3-4343w INTERFACE . device ) - -target_sources(mbed-core +target_sources(mbed-cy8cproto-062s3-4343w INTERFACE PeripheralPins.c cybsp.c - ${SYSTEM_SOURCE} - ${STARTUP_FILE} +) +target_link_libraries(mbed-cy8cproto-062s3-4343w + INTERFACE + mbed-cat1a + mbed-cy8cproto-062s3-4343w-cm4 + mbed-cy8cproto-062s3-4343w-bsp-design-modus + mbed-cm0p-sleep + mbed-psoc6 + mbed-cy-psoc6-whd + mbed-cy-psoc6-whd-4343w + mbed-cy8cproto-062s3-4343w-whd + mbed-cy-external-wifi-fw +) + +target_compile_definitions(mbed-cy8cproto-062s3-4343w + INTERFACE + "CY8C6245LQI_S3D72" + "CYBSP_WIFI_CAPABLE" ) diff --git a/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CPROTO_062_4343W/CMakeLists.txt b/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CPROTO_062_4343W/CMakeLists.txt index d5e7d4ffaa..ea56d5c039 100644 --- a/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CPROTO_062_4343W/CMakeLists.txt +++ b/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CPROTO_062_4343W/CMakeLists.txt @@ -1,60 +1,78 @@ -# Copyright (c) 2020 ARM Limited. All rights reserved. +# Copyright (c) 2020-2021 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -if("BSP_DESIGN_MODUS" IN_LIST MBED_TARGET_LABELS) - target_include_directories(mbed-core - INTERFACE - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource - ) - - target_sources(mbed-core - INTERFACE - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_clocks.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_peripherals.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_pins.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_qspi_memslot.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_routing.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_system.c - ) -endif() - -if("CM0P" IN_LIST MBED_TARGET_LABELS) - set(SYSTEM_SOURCE device/COMPONENT_CM0P/system_psoc6_cm0plus.c) - if(${MBED_TOOLCHAIN} STREQUAL "ARM") - set(LINKER_FILE device/COMPONENT_CM0P/TOOLCHAIN_ARM/cy8c6xxa_cm0plus.sct) - set(STARTUP_FILE device/COMPONENT_CM0P/TOOLCHAIN_ARM/startup_psoc6_02_cm0plus.S) - elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") - set(LINKER_FILE device/COMPONENT_CM0P/TOOLCHAIN_GCC_ARM/cy8c6xxa_cm0plus.ld) - set(STARTUP_FILE device/COMPONENT_CM0P/TOOLCHAIN_GCC_ARM/startup_psoc6_02_cm0plus.S) - endif() -elseif("CM4" IN_LIST MBED_TARGET_LABELS) - set(SYSTEM_SOURCE device/COMPONENT_CM4/system_psoc6_cm4.c) - if(${MBED_TOOLCHAIN} STREQUAL "ARM") - set(LINKER_FILE device/COMPONENT_CM4/TOOLCHAIN_ARM/cy8c6xxa_cm4_dual.sct) - set(STARTUP_FILE device/COMPONENT_CM4/TOOLCHAIN_ARM/startup_psoc6_02_cm4.S) - elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") - set(LINKER_FILE device/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/cy8c6xxa_cm4_dual.ld) - set(STARTUP_FILE device/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/startup_psoc6_02_cm4.S) - endif() -endif() - -set_property( - GLOBAL PROPERTY - MBED_TARGET_LINKER_FILE - ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE} +add_library(mbed-cy8cproto-062-4343w-bsp-design-modus INTERFACE) +target_include_directories(mbed-cy8cproto-062-4343w-bsp-design-modus + INTERFACE + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource +) +target_sources(mbed-cy8cproto-062-4343w-bsp-design-modus + INTERFACE + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_clocks.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_peripherals.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_pins.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_qspi_memslot.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_routing.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_system.c ) -target_include_directories(mbed-core +add_library(mbed-cy8cproto-062-4343w-cm0p INTERFACE) +if(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(LINKER_FILE_CM0P device/COMPONENT_CM0P/TOOLCHAIN_ARM/cy8c6xxa_cm0plus.sct) + set(STARTUP_FILE_CM0P device/COMPONENT_CM0P/TOOLCHAIN_ARM/startup_psoc6_02_cm0plus.S) +elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(LINKER_FILE_CM0P device/COMPONENT_CM0P/TOOLCHAIN_GCC_ARM/cy8c6xxa_cm0plus.ld) + set(STARTUP_FILE_CM0P device/COMPONENT_CM0P/TOOLCHAIN_GCC_ARM/startup_psoc6_02_cm0plus.S) +endif() +target_sources(mbed-cy8cproto-062-4343w-cm0p + INTERFACE + device/COMPONENT_CM0P/system_psoc6_cm0plus.c + ${STARTUP_FILE_CM0P} +) +mbed_set_linker_script(mbed-cy8cproto-062-4343w-cm0p ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE_CM0P}) + +add_library(mbed-cy8cproto-062-4343w-cm4 INTERFACE) +if(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(LINKER_FILE_CM4 device/COMPONENT_CM4/TOOLCHAIN_ARM/cy8c6xxa_cm4_dual.sct) + set(STARTUP_FILE_CM4 device/COMPONENT_CM4/TOOLCHAIN_ARM/startup_psoc6_02_cm4.S) +elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(LINKER_FILE_CM4 device/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/cy8c6xxa_cm4_dual.ld) + set(STARTUP_FILE_CM4 device/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/startup_psoc6_02_cm4.S) +endif() +target_sources(mbed-cy8cproto-062-4343w-cm4 + INTERFACE + device/COMPONENT_CM4/system_psoc6_cm4.c + ${STARTUP_FILE_CM4} +) +mbed_set_linker_script(mbed-cy8cproto-062-4343w-cm4 ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE_CM4}) + + +add_library(mbed-cy8cproto-062-4343w INTERFACE) +target_include_directories(mbed-cy8cproto-062-4343w INTERFACE . device ) - -target_sources(mbed-core +target_sources(mbed-cy8cproto-062-4343w INTERFACE PeripheralPins.c cybsp.c - ${SYSTEM_SOURCE} - ${STARTUP_FILE} +) +target_link_libraries(mbed-cy8cproto-062-4343w + INTERFACE + mbed-cat1a + mbed-cy8cproto-062-4343w-cm4 + mbed-cy8cproto-062-4343w-bsp-design-modus + mbed-cm0p-sleep + mbed-psoc6 + mbed-cy-psoc6-whd + mbed-cy-psoc6-whd-4343w + mbed-cy8cproto-062-4343w-whd +) + +target_compile_definitions(mbed-cy8cproto-062-4343w + INTERFACE + "CY8C624ABZI_D44" + "CYBSP_WIFI_CAPABLE" ) diff --git a/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CYSBSYSKIT_01/CMakeLists.txt b/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CYSBSYSKIT_01/CMakeLists.txt index bc6c3392c4..38e84e9ddb 100644 --- a/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CYSBSYSKIT_01/CMakeLists.txt +++ b/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CYSBSYSKIT_01/CMakeLists.txt @@ -1,53 +1,62 @@ -# Copyright (c) 2020 ARM Limited. All rights reserved. +# Copyright (c) 2020-2021 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 include(${MBED_PATH}/targets/TARGET_Cypress/scripts/mbed_set_post_build_cypress.cmake) -if("BSP_DESIGN_MODUS" IN_LIST MBED_TARGET_LABELS) - target_include_directories(mbed-core - INTERFACE - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource - ) - - target_sources(mbed-core - INTERFACE - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_pins.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_qspi_memslot.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_routing.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_system.c - ) -endif() - -if("CM4" IN_LIST MBED_TARGET_LABELS) - set(SYSTEM_SOURCE device/COMPONENT_CM4/system_psoc6_cm4.c) - if(${MBED_TOOLCHAIN} STREQUAL "ARM") - set(LINKER_FILE device/COMPONENT_CM4/TOOLCHAIN_ARM/cy8c6xxa_cm4_dual.sct) - set(STARTUP_FILE device/COMPONENT_CM4/TOOLCHAIN_ARM/startup_psoc6_02_cm4.S) - elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") - set(LINKER_FILE device/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/cy8c6xxa_cm4_dual.ld) - set(STARTUP_FILE device/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/startup_psoc6_02_cm4.S) - endif() -endif() - -set_property( - GLOBAL PROPERTY - MBED_TARGET_LINKER_FILE - ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE} +add_library(mbed-cysbsyskit-01-bsp-design-modus INTERFACE) +target_include_directories(mbed-cysbsyskit-01-bsp-design-modus + INTERFACE + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource +) +target_sources(mbed-cysbsyskit-01-bsp-design-modus + INTERFACE + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_pins.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_qspi_memslot.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_routing.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_system.c ) -target_include_directories(mbed-core +add_library(mbed-cysbsyskit-01-cm4 INTERFACE) +if(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(LINKER_FILE_CM4 device/COMPONENT_CM4/TOOLCHAIN_ARM/cy8c6xxa_cm4_dual.sct) + set(STARTUP_FILE_CM4 device/COMPONENT_CM4/TOOLCHAIN_ARM/startup_psoc6_02_cm4.S) +elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(LINKER_FILE_CM4 device/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/cy8c6xxa_cm4_dual.ld) + set(STARTUP_FILE_CM4 device/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/startup_psoc6_02_cm4.S) +endif() +target_sources(mbed-cysbsyskit-01-cm4 + INTERFACE + device/COMPONENT_CM4/system_psoc6_cm4.c + ${STARTUP_FILE_CM4} +) +mbed_set_linker_script(mbed-cysbsyskit-01-cm4 ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE_CM4}) + +add_library(mbed-cysbsyskit-01 INTERFACE) +target_include_directories(mbed-cysbsyskit-01 INTERFACE . device ) - -target_sources(mbed-core +target_sources(mbed-cysbsyskit-01 INTERFACE PeripheralPins.c cybsp.c - ${SYSTEM_SOURCE} - ${STARTUP_FILE} +) +target_link_libraries(mbed-cysbsyskit-01 + INTERFACE + mbed-cat1a + mbed-cysbsyskit-01-cm4 + mbed-cysbsyskit-01-bsp-design-modus + mbed-psoc6 + mbed-cy-psoc6-scl + mbed-lwipstack + mbed-emac +) + +target_compile_definitions(mbed-cysbsyskit-01 + INTERFACE + "CY8C624AFNI_S2D43F" ) mbed_post_build_psoc6_merge_hex() diff --git a/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CYTFM_064B0S2_4343W/CMakeLists.txt b/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CYTFM_064B0S2_4343W/CMakeLists.txt index 06db911fc0..d4f8ea3d12 100644 --- a/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CYTFM_064B0S2_4343W/CMakeLists.txt +++ b/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CYTFM_064B0S2_4343W/CMakeLists.txt @@ -1,68 +1,75 @@ -# Copyright (c) 2020 ARM Limited. All rights reserved. +# Copyright (c) 2020-2021 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 include(${MBED_PATH}/targets/TARGET_Cypress/scripts/mbed_set_post_build_cypress.cmake) -if("BSP_DESIGN_MODUS" IN_LIST MBED_TARGET_LABELS) - target_include_directories(mbed-core - INTERFACE - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource - ) - - target_sources(mbed-core - INTERFACE - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_clocks.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_peripherals.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_pins.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_qspi_memslot.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_routing.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_system.c - ) -endif() - -if("CM4" IN_LIST MBED_TARGET_LABELS) - set(SYSTEM_SOURCE device/COMPONENT_CM4/system_psoc6_cm4.c) - - target_include_directories(mbed-core - INTERFACE - device/COMPONENT_CM4 - ) - - target_sources(mbed-core - INTERFACE - device/COMPONENT_CM4/device_definition.c - ) - - if(${MBED_TOOLCHAIN} STREQUAL "ARM") - set(LINKER_FILE device/COMPONENT_CM4/TOOLCHAIN_ARM/cyb06xxa_cm4_dual.sct) - set(STARTUP_FILE device/COMPONENT_CM4/TOOLCHAIN_ARM/startup_psoc6_02_cm4.S) - elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") - set(LINKER_FILE device/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/cyb06xxa_cm4_dual.ld) - set(STARTUP_FILE device/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/startup_psoc6_02_cm4.S) - endif() -endif() - -set_property( - GLOBAL PROPERTY - MBED_TARGET_LINKER_FILE - ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE} +add_library(mbed-cytfm-064b0s2-4343w-bsp-design-modus INTERFACE) +target_include_directories(mbed-cytfm-064b0s2-4343w-bsp-design-modus + INTERFACE + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource +) +target_sources(mbed-cytfm-064b0s2-4343w-bsp-design-modus + INTERFACE + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_clocks.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_peripherals.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_pins.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_qspi_memslot.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_routing.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_system.c ) -target_include_directories(mbed-core +add_library(mbed-cytfm-064b0s2-4343w-cm4 INTERFACE) +if(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(LINKER_FILE_CM4 device/COMPONENT_CM4/TOOLCHAIN_ARM/cyb06xxa_cm4_dual.sct) + set(STARTUP_FILE_CM4 device/COMPONENT_CM4/TOOLCHAIN_ARM/startup_psoc6_02_cm4.S) +elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(LINKER_FILE_CM4 device/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/cyb06xxa_cm4_dual.ld) + set(STARTUP_FILE_CM4 device/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/startup_psoc6_02_cm4.S) +endif() +target_include_directories(mbed-cytfm-064b0s2-4343w-cm4 + INTERFACE + device/COMPONENT_CM4 +) +target_sources(mbed-cytfm-064b0s2-4343w-cm4 + INTERFACE + device/COMPONENT_CM4/system_psoc6_cm4.c + device/COMPONENT_CM4/device_definition.c + ${STARTUP_FILE_CM4} +) +mbed_set_linker_script(mbed-cytfm-064b0s2-4343w-cm4 ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE_CM4}) + +add_library(mbed-cytfm-064b0s2-4343w INTERFACE) +target_include_directories(mbed-cytfm-064b0s2-4343w INTERFACE . device partition ) - -target_sources(mbed-core +target_sources(mbed-cytfm-064b0s2-4343w INTERFACE PeripheralPins.c cybsp.c cytfm_flash_info.c - ${SYSTEM_SOURCE} - ${STARTUP_FILE} +) +target_link_libraries(mbed-cytfm-064b0s2-4343w + INTERFACE + mbed-cat1a + mbed-cytfm-064b0s2-4343w-cm4 + mbed-cytfm-064b0s2-4343w-bsp-design-modus + mbed-psoc6 + mbed-cy-psoc6-whd + mbed-cy-psoc6-whd-4343w + mbed-cytfm-064b0s2-4343w-whd +) + +target_compile_definitions(mbed-cytfm-064b0s2-4343w + INTERFACE + "CYB0644ABZI_S2D44" + "CY_IPC_DEFAULT_CFG_DISABLE" + "CYBSP_WIFI_CAPABLE" + "MXCRYPTO_DISABLED" + "TFM_MULTI_CORE_MULTI_CLIENT_CALL=1" ) mbed_post_build_psoc6_sign_image( diff --git a/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CYW9P62S1_43012EVB_01/CMakeLists.txt b/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CYW9P62S1_43012EVB_01/CMakeLists.txt index f4f35dd9e5..46711a1a12 100644 --- a/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CYW9P62S1_43012EVB_01/CMakeLists.txt +++ b/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CYW9P62S1_43012EVB_01/CMakeLists.txt @@ -1,60 +1,81 @@ -# Copyright (c) 2020 ARM Limited. All rights reserved. +# Copyright (c) 2020-2021 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -if("BSP_DESIGN_MODUS" IN_LIST MBED_TARGET_LABELS) - target_include_directories(mbed-core - INTERFACE - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource - ) - - target_sources(mbed-core - INTERFACE - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_clocks.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_peripherals.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_pins.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_qspi_memslot.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_routing.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_system.c - ) -endif() - -if("CM0P" IN_LIST MBED_TARGET_LABELS) - set(SYSTEM_SOURCE device/COMPONENT_CM0P/system_psoc6_cm0plus.c) - if(${MBED_TOOLCHAIN} STREQUAL "ARM") - set(LINKER_FILE device/COMPONENT_CM0P/TOOLCHAIN_ARM/cy8c6xx7_cm0plus.sct) - set(STARTUP_FILE device/COMPONENT_CM0P/TOOLCHAIN_ARM/startup_psoc6_01_cm0plus.S) - elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") - set(LINKER_FILE device/COMPONENT_CM0P/TOOLCHAIN_GCC_ARM/cy8c6xx7_cm0plus.ld) - set(STARTUP_FILE device/COMPONENT_CM0P/TOOLCHAIN_GCC_ARM/startup_psoc6_01_cm0plus.S) - endif() -elseif("CM4" IN_LIST MBED_TARGET_LABELS) - set(SYSTEM_SOURCE device/COMPONENT_CM4/system_psoc6_cm4.c) - if(${MBED_TOOLCHAIN} STREQUAL "ARM") - set(LINKER_FILE device/COMPONENT_CM4/TOOLCHAIN_ARM/cy8c6xx7_cm4_dual.sct) - set(STARTUP_FILE device/COMPONENT_CM4/TOOLCHAIN_ARM/startup_psoc6_01_cm4.S) - elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") - set(LINKER_FILE device/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/cy8c6xx7_cm4_dual.ld) - set(STARTUP_FILE device/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/startup_psoc6_01_cm4.S) - endif() -endif() - -set_property( - GLOBAL PROPERTY - MBED_TARGET_LINKER_FILE - ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE} +add_library(mbed-cyw9p62s1-43012evb-01-bsp-design-modus INTERFACE) +target_include_directories(mbed-cyw9p62s1-43012evb-01-bsp-design-modus + INTERFACE + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource ) -target_include_directories(mbed-core +target_sources(mbed-cyw9p62s1-43012evb-01-bsp-design-modus + INTERFACE + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_clocks.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_peripherals.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_pins.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_qspi_memslot.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_routing.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_system.c +) + +add_library(mbed-cyw9p62s1-43012evb-01-cm0p INTERFACE) +if(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(LINKER_FILE_CM0P device/COMPONENT_CM0P/TOOLCHAIN_ARM/cy8c6xx7_cm0plus.sct) + set(STARTUP_FILE_CM0P device/COMPONENT_CM0P/TOOLCHAIN_ARM/startup_psoc6_01_cm0plus.S) +elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(LINKER_FILE_CM0P device/COMPONENT_CM0P/TOOLCHAIN_GCC_ARM/cy8c6xx7_cm0plus.ld) + set(STARTUP_FILE_CM0P device/COMPONENT_CM0P/TOOLCHAIN_GCC_ARM/startup_psoc6_01_cm0plus.S) +endif() +target_sources(mbed-cyw9p62s1-43012evb-01-cm0p + INTERFACE + device/COMPONENT_CM0P/system_psoc6_cm0plus.c + ${STARTUP_FILE_CM0P} +) +mbed_set_linker_script(mbed-cyw9p62s1-43012evb-01-cm0p ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE_CM0P}) + +add_library(mbed-cyw9p62s1-43012evb-01-cm4 INTERFACE) +if(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(LINKER_FILE_CM4 device/COMPONENT_CM4/TOOLCHAIN_ARM/cy8c6xx7_cm4_dual.sct) + set(STARTUP_FILE_CM4 device/COMPONENT_CM4/TOOLCHAIN_ARM/startup_psoc6_01_cm4.S) +elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(LINKER_FILE_CM4 device/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/cy8c6xx7_cm4_dual.ld) + set(STARTUP_FILE_CM4 device/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/startup_psoc6_01_cm4.S) +endif() +target_sources(mbed-cyw9p62s1-43012evb-01-cm4 + INTERFACE + device/COMPONENT_CM4/system_psoc6_cm4.c + ${STARTUP_FILE_CM4} +) +mbed_set_linker_script(mbed-cyw9p62s1-43012evb-01-cm4 ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE_CM4}) + + +add_library(mbed-cyw9p62s1-43012evb-01 INTERFACE) +target_include_directories(mbed-cyw9p62s1-43012evb-01 INTERFACE . device ) - -target_sources(mbed-core +target_sources(mbed-cyw9p62s1-43012evb-01 INTERFACE PeripheralPins.c cybsp.c - ${SYSTEM_SOURCE} - ${STARTUP_FILE} +) +target_link_libraries(mbed-cyw9p62s1-43012evb-01 + INTERFACE + mbed-cat1a + mbed-cyw9p62s1-43012evb-01-cm4 + mbed-cyw9p62s1-43012evb-01-bsp-design-modus + mbed-cm0p-sleep + mbed-psoc6 + mbed-cy-psoc6-whd + mbed-cy-psoc6-whd-43012 + mbed-cyw9p62s1-43012evb-01-whd + mbed-udb-sdio-p12 +) + +target_compile_definitions(mbed-cyw9p62s1-43012evb-01 + INTERFACE + "CY8C6247FDI_D52" + "CYHAL_UDB_SDIO" + "CYBSP_WIFI_CAPABLE" ) diff --git a/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CYW9P62S1_43438EVB_01/CMakeLists.txt b/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CYW9P62S1_43438EVB_01/CMakeLists.txt index f4f35dd9e5..a5cddef07f 100644 --- a/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CYW9P62S1_43438EVB_01/CMakeLists.txt +++ b/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CYW9P62S1_43438EVB_01/CMakeLists.txt @@ -1,60 +1,80 @@ -# Copyright (c) 2020 ARM Limited. All rights reserved. +# Copyright (c) 2020-2021 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -if("BSP_DESIGN_MODUS" IN_LIST MBED_TARGET_LABELS) - target_include_directories(mbed-core - INTERFACE - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource - ) - - target_sources(mbed-core - INTERFACE - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_clocks.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_peripherals.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_pins.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_qspi_memslot.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_routing.c - COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_system.c - ) -endif() - -if("CM0P" IN_LIST MBED_TARGET_LABELS) - set(SYSTEM_SOURCE device/COMPONENT_CM0P/system_psoc6_cm0plus.c) - if(${MBED_TOOLCHAIN} STREQUAL "ARM") - set(LINKER_FILE device/COMPONENT_CM0P/TOOLCHAIN_ARM/cy8c6xx7_cm0plus.sct) - set(STARTUP_FILE device/COMPONENT_CM0P/TOOLCHAIN_ARM/startup_psoc6_01_cm0plus.S) - elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") - set(LINKER_FILE device/COMPONENT_CM0P/TOOLCHAIN_GCC_ARM/cy8c6xx7_cm0plus.ld) - set(STARTUP_FILE device/COMPONENT_CM0P/TOOLCHAIN_GCC_ARM/startup_psoc6_01_cm0plus.S) - endif() -elseif("CM4" IN_LIST MBED_TARGET_LABELS) - set(SYSTEM_SOURCE device/COMPONENT_CM4/system_psoc6_cm4.c) - if(${MBED_TOOLCHAIN} STREQUAL "ARM") - set(LINKER_FILE device/COMPONENT_CM4/TOOLCHAIN_ARM/cy8c6xx7_cm4_dual.sct) - set(STARTUP_FILE device/COMPONENT_CM4/TOOLCHAIN_ARM/startup_psoc6_01_cm4.S) - elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") - set(LINKER_FILE device/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/cy8c6xx7_cm4_dual.ld) - set(STARTUP_FILE device/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/startup_psoc6_01_cm4.S) - endif() -endif() - -set_property( - GLOBAL PROPERTY - MBED_TARGET_LINKER_FILE - ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE} +add_library(mbed-cyw9p62s1-43438evb-01-bsp-design-modus INTERFACE) +target_include_directories(mbed-cyw9p62s1-43438evb-01-bsp-design-modus + INTERFACE + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource +) +target_sources(mbed-cyw9p62s1-43438evb-01-bsp-design-modus + INTERFACE + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_clocks.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_peripherals.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_pins.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_qspi_memslot.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_routing.c + COMPONENT_BSP_DESIGN_MODUS/GeneratedSource/cycfg_system.c ) -target_include_directories(mbed-core +add_library(mbed-cyw9p62s1-43438evb-01-cm0p INTERFACE) +if(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(LINKER_FILE_CM0P device/COMPONENT_CM0P/TOOLCHAIN_ARM/cy8c6xx7_cm0plus.sct) + set(STARTUP_FILE_CM0P device/COMPONENT_CM0P/TOOLCHAIN_ARM/startup_psoc6_01_cm0plus.S) +elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(LINKER_FILE_CM0P device/COMPONENT_CM0P/TOOLCHAIN_GCC_ARM/cy8c6xx7_cm0plus.ld) + set(STARTUP_FILE_CM0P device/COMPONENT_CM0P/TOOLCHAIN_GCC_ARM/startup_psoc6_01_cm0plus.S) +endif() +target_sources(mbed-cyw9p62s1-43438evb-01-cm0p + INTERFACE + device/COMPONENT_CM0P/system_psoc6_cm0plus.c + ${STARTUP_FILE_CM0P} +) +mbed_set_linker_script(mbed-cyw9p62s1-43438evb-01-cm0p ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE_CM0P}) + +add_library(mbed-cyw9p62s1-43438evb-01-cm4 INTERFACE) +if(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(LINKER_FILE_CM4 device/COMPONENT_CM4/TOOLCHAIN_ARM/cy8c6xx7_cm4_dual.sct) + set(STARTUP_FILE_CM4 device/COMPONENT_CM4/TOOLCHAIN_ARM/startup_psoc6_01_cm4.S) +elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(LINKER_FILE_CM4 device/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/cy8c6xx7_cm4_dual.ld) + set(STARTUP_FILE_CM4 device/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/startup_psoc6_01_cm4.S) +endif() +target_sources(mbed-cyw9p62s1-43438evb-01-cm4 + INTERFACE + device/COMPONENT_CM4/system_psoc6_cm4.c + ${STARTUP_FILE_CM4} +) +mbed_set_linker_script(mbed-cyw9p62s1-43438evb-01-cm4 ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE_CM4}) + + +add_library(mbed-cyw9p62s1-43438evb-01 INTERFACE) +target_include_directories(mbed-cyw9p62s1-43438evb-01 INTERFACE . device ) - -target_sources(mbed-core +target_sources(mbed-cyw9p62s1-43438evb-01 INTERFACE PeripheralPins.c cybsp.c - ${SYSTEM_SOURCE} - ${STARTUP_FILE} +) +target_link_libraries(mbed-cyw9p62s1-43438evb-01 + INTERFACE + mbed-cat1a + mbed-cyw9p62s1-43438evb-01-cm4 + mbed-cyw9p62s1-43438evb-01-bsp-design-modus + mbed-cm0p-sleep + mbed-psoc6 + mbed-cy-psoc6-whd + mbed-cy-psoc6-whd-43438 + mbed-cyw9p62s1-43438evb-01-whd + mbed-udb-sdio-p2 +) + +target_compile_definitions(mbed-cyw9p62s1-43438evb-01 + INTERFACE + "CY8C6247BZI_D54" + "CYHAL_UDB_SDIO" + "CYBSP_WIFI_CAPABLE" ) diff --git a/targets/TARGET_Cypress/TARGET_PSOC6/common/COMPONENT_WHD/CMakeLists.txt b/targets/TARGET_Cypress/TARGET_PSOC6/common/COMPONENT_WHD/CMakeLists.txt index a9a5d22cc4..2c5b5f4c89 100644 --- a/targets/TARGET_Cypress/TARGET_PSOC6/common/COMPONENT_WHD/CMakeLists.txt +++ b/targets/TARGET_Cypress/TARGET_PSOC6/common/COMPONENT_WHD/CMakeLists.txt @@ -1,26 +1,26 @@ -# Copyright (c) 2020 ARM Limited. All rights reserved. +# Copyright (c) 2020-2021 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -add_library(mbed-cy_psoc6_common_network INTERFACE) +add_library(mbed-cy-psoc6-common-network INTERFACE) -target_include_directories(mbed-cy_psoc6_common_network +target_include_directories(mbed-cy-psoc6-common-network INTERFACE . ) -target_sources(mbed-cy_psoc6_common_network +target_sources(mbed-cy-psoc6-common-network INTERFACE cy_network_buffer.c cybsp_wifi.c ) -target_link_libraries(mbed-cy_psoc6_common_network +target_link_libraries(mbed-cy-psoc6-common-network INTERFACE mbed-lwipstack mbed-emac ) -target_compile_definitions(mbed-cy_psoc6_common_network +target_compile_definitions(mbed-cy-psoc6-common-network INTERFACE - MBED_CONF_CY_PSOC6_COMMON_NETWORK_PRESENT=1 + MBED_CONF_cy-psoc6-common-network_PRESENT=1 ) diff --git a/targets/TARGET_Cypress/TARGET_PSOC6/psoc6csp/abstraction/rtos/CMakeLists.txt b/targets/TARGET_Cypress/TARGET_PSOC6/psoc6csp/abstraction/rtos/CMakeLists.txt index 938341b33f..3ee5b7857f 100644 --- a/targets/TARGET_Cypress/TARGET_PSOC6/psoc6csp/abstraction/rtos/CMakeLists.txt +++ b/targets/TARGET_Cypress/TARGET_PSOC6/psoc6csp/abstraction/rtos/CMakeLists.txt @@ -1,25 +1,22 @@ -# Copyright (c) 2020 ARM Limited. All rights reserved. +# Copyright (c) 2020-2021 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -if("CY_RTOS_AWARE" IN_LIST MBED_CONFIG_DEFINITIONS) - if("RTX" IN_LIST MBED_TARGET_LABELS) - target_include_directories(mbed-core - INTERFACE - include/COMPONENT_RTX - ) - target_sources(mbed-core - INTERFACE - source/COMPONENT_RTX/cyabs_rtos_rtxv5.c - ) - endif() +add_library(mbed-cy-rtx INTERFACE) +target_include_directories(mbed-cy-rtx + INTERFACE + include/COMPONENT_RTX +) +target_sources(mbed-cy-rtx + INTERFACE + source/COMPONENT_RTX/cyabs_rtos_rtxv5.c +) - target_include_directories(mbed-core - INTERFACE - include - ) - - target_sources(mbed-core - INTERFACE - source/cy_worker_thread.c - ) -endif() +add_library(mbed-cy-rtos INTERFACE) +target_include_directories(mbed-cy-rtos + INTERFACE + include +) +target_sources(mbed-cy-rtos + INTERFACE + source/cy_worker_thread.c +) From 68b6e6ff9647cbdf79b7b96aadc15bbb47ad1de0 Mon Sep 17 00:00:00 2001 From: Hugues Kamba Date: Mon, 15 Feb 2021 17:39:27 +0000 Subject: [PATCH 2/2] Fix post build mechanism with unique CMake custom targets The CMake custom target must be unique to avoid more than one Mbed target adding the same. Only the CMake custom command added for the Mbed target being built is run as the custom CMake target now includes the Mbed target name. --- CMakeLists.txt | 4 ++-- .../TARGET_PSOC6/TARGET_CYSBSYSKIT_01/CMakeLists.txt | 2 +- .../scripts/mbed_set_post_build_cypress.cmake | 8 ++++++-- .../TARGET_LPC11XX_11CXX/TARGET_LPC11XX/CMakeLists.txt | 2 -- .../TARGET_LPC176X/TARGET_ARCH_PRO/CMakeLists.txt | 2 +- .../TARGET_LPC176X/TARGET_MBED_LPC1768/CMakeLists.txt | 2 +- .../device/TARGET_LPC54114_M4/CMakeLists.txt | 2 +- .../TARGET_MCU_LPC546XX/CMakeLists.txt | 3 ++- targets/TARGET_NXP/scripts/mbed_set_post_build_nxp.cmake | 2 +- tools/cmake/mbed_set_post_build.cmake | 9 +++++---- 10 files changed, 20 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f1967c3f65..ddd839ae69 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -195,11 +195,11 @@ function(mbed_generate_bin_hex target) VERBATIM ) - if(TARGET mbed-post-build-bin) + if(TARGET mbed-post-build-bin-${MBED_TARGET}) add_custom_target(mbed-post-build ALL DEPENDS - mbed-post-build-bin + mbed-post-build-bin-${MBED_TARGET} ) endif() endfunction() diff --git a/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CYSBSYSKIT_01/CMakeLists.txt b/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CYSBSYSKIT_01/CMakeLists.txt index 38e84e9ddb..14205ad81b 100644 --- a/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CYSBSYSKIT_01/CMakeLists.txt +++ b/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CYSBSYSKIT_01/CMakeLists.txt @@ -59,4 +59,4 @@ target_compile_definitions(mbed-cysbsyskit-01 "CY8C624AFNI_S2D43F" ) -mbed_post_build_psoc6_merge_hex() +mbed_post_build_psoc6_merge_hex("CYSBSYSKIT_01") diff --git a/targets/TARGET_Cypress/scripts/mbed_set_post_build_cypress.cmake b/targets/TARGET_Cypress/scripts/mbed_set_post_build_cypress.cmake index 804a7ea5e1..759edc774f 100644 --- a/targets/TARGET_Cypress/scripts/mbed_set_post_build_cypress.cmake +++ b/targets/TARGET_Cypress/scripts/mbed_set_post_build_cypress.cmake @@ -6,14 +6,18 @@ include(${MBED_PATH}/tools/cmake/mbed_set_post_build.cmake) # # Merge Cortex-M4 HEX and a Cortex-M0 HEX. # -function(mbed_post_build_psoc6_merge_hex) +function(mbed_post_build_psoc6_merge_hex mbed_target_name) find_package(Python3) + # Copy ${ARGN} to a variable first as it cannot be used directly with + # the list() command set (extra_macro_args ${ARGN}) - list(LENGTH cortex_m0_hex num_extra_args) + # Get the number of arguments past the last expected argument + list(LENGTH extra_macro_args num_extra_args) if(${num_extra_args} GREATER 0) + # Get extra argument as `cortex_m0_hex` list(GET extra_macro_args 0 cortex_m0_hex) set(post_build_command COMMAND ${Python3_EXECUTABLE} ${MBED_PATH}/targets/TARGET_Cypress/scripts/PSOC6.py diff --git a/targets/TARGET_NXP/TARGET_LPC11XX_11CXX/TARGET_LPC11XX/CMakeLists.txt b/targets/TARGET_NXP/TARGET_LPC11XX_11CXX/TARGET_LPC11XX/CMakeLists.txt index bdfa738b8a..56b2ca8285 100644 --- a/targets/TARGET_NXP/TARGET_LPC11XX_11CXX/TARGET_LPC11XX/CMakeLists.txt +++ b/targets/TARGET_NXP/TARGET_LPC11XX_11CXX/TARGET_LPC11XX/CMakeLists.txt @@ -16,5 +16,3 @@ target_sources(mbed-lpc11xx ) target_link_libraries(mbed-lpc11xx INTERFACE mbed-lpc11xx-11cxx) - -mbed_post_build_lpc_patch_vtable() diff --git a/targets/TARGET_NXP/TARGET_LPC176X/TARGET_ARCH_PRO/CMakeLists.txt b/targets/TARGET_NXP/TARGET_LPC176X/TARGET_ARCH_PRO/CMakeLists.txt index 4ce9d41663..2e0cf92a73 100644 --- a/targets/TARGET_NXP/TARGET_LPC176X/TARGET_ARCH_PRO/CMakeLists.txt +++ b/targets/TARGET_NXP/TARGET_LPC176X/TARGET_ARCH_PRO/CMakeLists.txt @@ -12,4 +12,4 @@ target_include_directories(mbed-arch-pro target_link_libraries(mbed-arch-pro INTERFACE mbed-lpc176x) -mbed_post_build_lpc_patch_vtable() +mbed_post_build_lpc_patch_vtable("ARCH_PRO") diff --git a/targets/TARGET_NXP/TARGET_LPC176X/TARGET_MBED_LPC1768/CMakeLists.txt b/targets/TARGET_NXP/TARGET_LPC176X/TARGET_MBED_LPC1768/CMakeLists.txt index dfe564388b..6a08010927 100644 --- a/targets/TARGET_NXP/TARGET_LPC176X/TARGET_MBED_LPC1768/CMakeLists.txt +++ b/targets/TARGET_NXP/TARGET_LPC176X/TARGET_MBED_LPC1768/CMakeLists.txt @@ -16,4 +16,4 @@ add_library(mbed-lpc1768 INTERFACE) target_link_libraries(mbed-lpc1768 INTERFACE mbed-mbed-lpc1768) -mbed_post_build_lpc_patch_vtable() +mbed_post_build_lpc_patch_vtable("LPC1768") diff --git a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC54114/device/TARGET_LPC54114_M4/CMakeLists.txt b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC54114/device/TARGET_LPC54114_M4/CMakeLists.txt index 487d3a3fb2..a99e516b74 100644 --- a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC54114/device/TARGET_LPC54114_M4/CMakeLists.txt +++ b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC54114/device/TARGET_LPC54114_M4/CMakeLists.txt @@ -33,4 +33,4 @@ target_sources(mbed-lpc54114-m4 mbed_set_linker_script(mbed-lpc54114-m4 ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE}) -mbed_post_build_lpc_patch_vtable() +mbed_post_build_lpc_patch_vtable("LPC54114") diff --git a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MCU_LPC546XX/CMakeLists.txt b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MCU_LPC546XX/CMakeLists.txt index e4f9a1e3da..bb472b03b2 100644 --- a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MCU_LPC546XX/CMakeLists.txt +++ b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MCU_LPC546XX/CMakeLists.txt @@ -94,4 +94,5 @@ target_link_libraries(mbed-lpc546xx mbed-lpc546xx-xpresso ) -mbed_post_build_lpc_patch_vtable() +mbed_post_build_lpc_patch_vtable("LPC546XX") +mbed_post_build_lpc_patch_vtable("FF_LPC546XX") diff --git a/targets/TARGET_NXP/scripts/mbed_set_post_build_nxp.cmake b/targets/TARGET_NXP/scripts/mbed_set_post_build_nxp.cmake index c1f9618b33..bfdc791e74 100644 --- a/targets/TARGET_NXP/scripts/mbed_set_post_build_nxp.cmake +++ b/targets/TARGET_NXP/scripts/mbed_set_post_build_nxp.cmake @@ -6,7 +6,7 @@ include(${MBED_PATH}/tools/cmake/mbed_set_post_build.cmake) # # Patch an LPC target vector table in the binary file. # -function(mbed_post_build_lpc_patch_vtable) +function(mbed_post_build_lpc_patch_vtable mbed_target_name) find_package(Python3) set(post_build_command diff --git a/tools/cmake/mbed_set_post_build.cmake b/tools/cmake/mbed_set_post_build.cmake index ce914482b8..c5480ab81c 100644 --- a/tools/cmake/mbed_set_post_build.cmake +++ b/tools/cmake/mbed_set_post_build.cmake @@ -5,16 +5,17 @@ # Sets the post build operation for Mbed targets. # macro(mbed_set_post_build_operation) - add_custom_target(mbed-post-build-bin - DEPENDS ${CMAKE_BINARY_DIR}/${APP_TARGET}.bin + + add_custom_target(mbed-post-build-bin-${mbed_target_name} + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${APP_TARGET}.bin ) # Ensures the application artefacts are created before manipulating them. - add_dependencies(mbed-post-build-bin ${APP_TARGET}) + add_dependencies(mbed-post-build-bin-${mbed_target_name} ${APP_TARGET}) add_custom_command( OUTPUT - ${CMAKE_BINARY_DIR}/${APP_TARGET}.bin + ${CMAKE_CURRENT_BINARY_DIR}/${APP_TARGET}.bin POST_BUILD COMMAND ${post_build_command}