From 8c65602476eebddb7b14659f7d297eabacfaece4 Mon Sep 17 00:00:00 2001 From: tymoteuszblochmobica Date: Thu, 24 Jun 2021 09:39:24 +0200 Subject: [PATCH 1/8] Enable CHIP to use latest Mbed --- .gitmodules | 2 +- .vscode/launch.json | 8 ++--- config/mbed/CMakeLists.txt | 29 +++++++++++++++++++ examples/all-clusters-app/mbed/CMakeLists.txt | 10 ++----- examples/lighting-app/mbed/CMakeLists.txt | 14 ++++----- examples/lighting-app/mbed/mbed_app.json | 2 +- examples/lock-app/mbed/CMakeLists.txt | 10 ++----- examples/lock-app/mbed/mbed_app.json | 2 +- examples/shell/mbed/CMakeLists.txt | 10 ++----- examples/shell/mbed/cmd_mbed_utils.cpp | 2 +- scripts/examples/mbed_example.sh | 2 +- src/inet/BUILD.gn | 2 +- src/platform/mbed/net/include/BSDSocket.h | 2 +- .../net/include/{common.h => net_common.h} | 0 .../net/src/{common.cpp => net_common.cpp} | 2 +- src/platform/mbed/net/src/net_dns.cpp | 2 +- src/platform/mbed/net/src/net_if.cpp | 2 +- src/platform/mbed/net/src/net_socket.cpp | 3 +- .../mbed/unit_tests/CMakeLists.txt | 13 +++++---- 19 files changed, 66 insertions(+), 51 deletions(-) rename src/platform/mbed/net/include/{common.h => net_common.h} (100%) rename src/platform/mbed/net/src/{common.cpp => net_common.cpp} (98%) diff --git a/.gitmodules b/.gitmodules index 6f20e0297105ef..7579297dd656fe 100644 --- a/.gitmodules +++ b/.gitmodules @@ -81,7 +81,7 @@ [submodule "mbed-os"] path = third_party/mbed-os/repo url = https://github.com/ARMmbed/mbed-os.git - branch = feature-chip + branch = master [submodule "wifi-ism43362"] path = third_party/wifi-ism43362/repo url = https://github.com/ATmobica/wifi-ism43362.git diff --git a/.vscode/launch.json b/.vscode/launch.json index 8766e06a3f475c..e501e5dd368317 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -90,7 +90,7 @@ "type": "cortex-debug", "request": "launch", "cwd": "${workspaceRoot}/examples/${input:mbedApp}/mbed", - "executable": "./build-CY8CPROTO_062_4343W/${input:mbedDebugProfile}/chip-mbed-${input:mbedApp}-example", + "executable": "./build-CY8CPROTO_062_4343W/${input:mbedDebugProfile}/chip-mbed-${input:mbedApp}-example.elf", "servertype": "openocd", "searchDir": [ "${workspaceRoot}/config/mbed/scripts", @@ -121,7 +121,7 @@ "type": "cortex-debug", "request": "launch", "cwd": "${workspaceRoot}/examples/${input:mbedApp}/mbed", - "executable": "./build-CY8CPROTO_062_4343W/${input:mbedDebugProfile}/chip-mbed-${input:mbedApp}-example", + "executable": "./build-CY8CPROTO_062_4343W/${input:mbedDebugProfile}/chip-mbed-${input:mbedApp}-example.elf", "servertype": "external", "gdbTarget": "host.docker.internal:3334", //port 3333 for the CM0+, 3334 for the CM4 "overrideLaunchCommands": [ @@ -147,7 +147,7 @@ "type": "cortex-debug", "request": "launch", "cwd": "${workspaceRoot}/examples/${input:mbedApp}/mbed", - "executable": "./build-CY8CPROTO_062_4343W/${input:mbedFlashProfile}/chip-mbed-${input:mbedApp}-example", + "executable": "./build-CY8CPROTO_062_4343W/${input:mbedFlashProfile}/chip-mbed-${input:mbedApp}-example.elf", "servertype": "openocd", "searchDir": [ "${workspaceRoot}/config/mbed/scripts", @@ -170,7 +170,7 @@ "type": "cortex-debug", "request": "launch", "cwd": "${workspaceRoot}/examples/${input:mbedApp}/mbed", - "executable": "./build-CY8CPROTO_062_4343W/${input:mbedFlashProfile}/chip-mbed-${input:mbedApp}-example.hex", + "executable": "./build-CY8CPROTO_062_4343W/${input:mbedFlashProfile}/chip-mbed-${input:mbedApp}-example.elf", "servertype": "external", "gdbTarget": "host.docker.internal:3334", //port 3333 for the CM0+, 3334 for the CM4 "overrideLaunchCommands": [ diff --git a/config/mbed/CMakeLists.txt b/config/mbed/CMakeLists.txt index af97211fa439da..c5eb290cb1dff6 100644 --- a/config/mbed/CMakeLists.txt +++ b/config/mbed/CMakeLists.txt @@ -142,6 +142,35 @@ mbed_get_lang_compile_flags(CHIP_CFLAGS_C mbed-core C) list(APPEND CHIP_CFLAGS_C ${CMAKE_C_FLAGS_INIT}) mbed_get_lang_compile_flags(CHIP_CFLAGS_CC mbed-core CXX) list(APPEND CHIP_CFLAGS_CC ${CMAKE_CXX_FLAGS_INIT}) +mbed_get_target_common_compile_flags(CHIP_MBEDCMSISCM_CFLAGS mbed-cmsis-cortex-m) +list(APPEND CHIP_CFLAGS ${CHIP_MBEDCMSISCM_CFLAGS}) + + +if("WHD" IN_LIST MBED_TARGET_LABELS) +mbed_get_target_common_compile_flags(CHIP_MBEDPSOC6_CFLAGS mbed-psoc6) +list(APPEND CHIP_CFLAGS ${CHIP_MBEDPSOC6_CFLAGS}) +mbed_get_target_common_compile_flags(CHIP_MBEDCAT1_CFLAGS mbed-cat1a) +list(APPEND CHIP_CFLAGS ${CHIP_MBEDCAT1_CFLAGS}) +mbed_get_target_common_compile_flags(CHIP_MBEDCMSISCY8_CFLAGS mbed-cy8cproto-062-4343w) +list(APPEND CHIP_CFLAGS ${CHIP_MBEDCMSISCY8_CFLAGS}) +mbed_get_target_common_compile_flags(CHIP_MBEDCMSISCY8MODUS_CFLAGS mbed-cy8cproto-062-4343w-bsp-design-modus) +list(APPEND CHIP_CFLAGS ${CHIP_MBEDCMSISCY8MODUS_CFLAGS}) +mbed_get_target_common_compile_flags(CHIP_MBEDCMSISCY8NET_CFLAGS mbed-cy-psoc6-common-network) +list(APPEND CHIP_CFLAGS ${CHIP_MBEDCMSISCY8NET_CFLAGS}) +endif() + +if("BlueNRG_MS" IN_LIST MBED_TARGET_LABELS) +mbed_get_target_common_compile_flags(CHIP_MBEDSTM_CFLAGS mbed-stm ) +list(APPEND CHIP_CFLAGS ${CHIP_MBEDSTM_CFLAGS}) +mbed_get_target_common_compile_flags(CHIP_MBEDCMSISCM_CFLAGS mbed-stm32l4) +list(APPEND CHIP_CFLAGS ${CHIP_MBEDCMSISCM_CFLAGS}) +mbed_get_target_common_compile_flags(CHIP_MBEDCSTMCUBE_CFLAGS mbed-stm32l4cube-fw) +list(APPEND CHIP_CFLAGS ${CHIP_MBEDCSTMCUBE_CFLAGS}) +mbed_get_target_common_compile_flags(CHIP_MBEDSTML4_CFLAGS mbed-stm32l475xg) +list(APPEND CHIP_CFLAGS ${CHIP_MBEDSTML4_CFLAGS}) +mbed_get_target_common_compile_flags(CHIP_MBEDSTML4IOT_CFLAGS mbed-disco-l475vg-iot01a) +list(APPEND CHIP_CFLAGS ${CHIP_MBEDSTML4IOT_CFLAGS}) +endif() # Add support for Mbed BLE mbed_get_target_common_compile_flags(CHIP_MBEDBLE_CFLAGS mbed-ble) diff --git a/examples/all-clusters-app/mbed/CMakeLists.txt b/examples/all-clusters-app/mbed/CMakeLists.txt index 01b955a2fa45a0..1925f1a3de3915 100644 --- a/examples/all-clusters-app/mbed/CMakeLists.txt +++ b/examples/all-clusters-app/mbed/CMakeLists.txt @@ -99,8 +99,6 @@ add_subdirectory(${CHIP_ROOT}/config/mbed ./chip_build) mbed_configure_app_target(${APP_TARGET}) -mbed_set_mbed_target_linker_script(${APP_TARGET}) - project(${APP_TARGET}) if("wifi_ism43362" IN_LIST MBED_TARGET_LABELS) @@ -111,17 +109,15 @@ endif() if("BlueNRG_MS" IN_LIST MBED_TARGET_LABELS) target_link_libraries(${APP_TARGET} - mbed-ble-blue_nrg + mbed-ble ) endif() if("WHD" IN_LIST MBED_TARGET_LABELS) - target_link_libraries(${APP_TARGET} - mbed-cy_psoc6_common_network mbed-emac mbed-cy_psoc6_whd - ) +target_link_libraries(${APP_TARGET} mbed-cy-psoc6-common-network) endif() -target_link_libraries(${APP_TARGET} mbed-os mbed-ble mbed-events mbed-netsocket mbed-storage mbed-storage-kv-global-api mbed-mbedtls mbed-mbedtls-cryptocell310 chip) +target_link_libraries(${APP_TARGET} mbed-os mbed-ble mbed-events mbed-netsocket mbed-storage mbed-storage-kv-global-api mbed-mbedtls mbed-emac chip) mbed_set_post_build(${APP_TARGET}) diff --git a/examples/lighting-app/mbed/CMakeLists.txt b/examples/lighting-app/mbed/CMakeLists.txt index b1aa06d51a7b1c..50452e08899c08 100644 --- a/examples/lighting-app/mbed/CMakeLists.txt +++ b/examples/lighting-app/mbed/CMakeLists.txt @@ -14,7 +14,8 @@ configure_file( @ONLY ) -set(MBED_PATH $ENV{MBED_OS_PATH} CACHE INTERNAL "") +#set(MBED_PATH $ENV{MBED_OS_PATH} CACHE INTERNAL "") +set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/mbed-os CACHE INTERNAL "") set(MBED_CONFIG_PATH ${CMAKE_CURRENT_BINARY_DIR} CACHE INTERNAL "") set(APP_TARGET chip-mbed-lighting-app-example) @@ -72,8 +73,7 @@ add_subdirectory(${CHIP_ROOT}/config/mbed ./chip_build) mbed_configure_app_target(${APP_TARGET}) -mbed_set_mbed_target_linker_script(${APP_TARGET}) - + project(${APP_TARGET}) if("wifi_ism43362" IN_LIST MBED_TARGET_LABELS) @@ -84,15 +84,13 @@ endif() if("BlueNRG_MS" IN_LIST MBED_TARGET_LABELS) target_link_libraries(${APP_TARGET} - mbed-ble-blue_nrg + mbed-ble ) endif() if("WHD" IN_LIST MBED_TARGET_LABELS) - target_link_libraries(${APP_TARGET} - mbed-cy_psoc6_common_network mbed-emac mbed-cy_psoc6_whd - ) +target_link_libraries(${APP_TARGET} mbed-cy-psoc6-common-network) endif() if("capsense" IN_LIST MBED_TARGET_LABELS) @@ -106,7 +104,7 @@ if("capsense" IN_LIST MBED_TARGET_LABELS) target_link_libraries(${APP_TARGET} capsense ${CAPSENSE_LIB}) endif() -target_link_libraries(${APP_TARGET} mbed-os mbed-ble mbed-events mbed-netsocket mbed-storage mbed-storage-kv-global-api mbed-mbedtls mbed-mbedtls-cryptocell310 chip) +target_link_libraries(${APP_TARGET} mbed-os mbed-ble mbed-events mbed-netsocket mbed-storage mbed-storage-kv-global-api mbed-mbedtls mbed-emac chip) mbed_set_post_build(${APP_TARGET}) diff --git a/examples/lighting-app/mbed/mbed_app.json b/examples/lighting-app/mbed/mbed_app.json index 237c0b101f2b98..e26becaa154e11 100644 --- a/examples/lighting-app/mbed/mbed_app.json +++ b/examples/lighting-app/mbed/mbed_app.json @@ -30,7 +30,7 @@ "CORDIO" ], "led-active-state": 1, - "lighting-button": "USER_BUTTON", + "lighting-button": "BUTTON1", "function-button": "NC" }, "CY8CPROTO_062_4343W": { diff --git a/examples/lock-app/mbed/CMakeLists.txt b/examples/lock-app/mbed/CMakeLists.txt index e8c0b16258a470..134509bb91d3ae 100644 --- a/examples/lock-app/mbed/CMakeLists.txt +++ b/examples/lock-app/mbed/CMakeLists.txt @@ -71,8 +71,6 @@ add_subdirectory(${CHIP_ROOT}/config/mbed ./chip_build) mbed_configure_app_target(${APP_TARGET}) -mbed_set_mbed_target_linker_script(${APP_TARGET}) - project(${APP_TARGET}) if("wifi_ism43362" IN_LIST MBED_TARGET_LABELS) @@ -83,14 +81,12 @@ endif() if("BlueNRG_MS" IN_LIST MBED_TARGET_LABELS) target_link_libraries(${APP_TARGET} - mbed-ble-blue_nrg + mbed-ble ) endif() if("WHD" IN_LIST MBED_TARGET_LABELS) - target_link_libraries(${APP_TARGET} - mbed-cy_psoc6_common_network mbed-emac mbed-cy_psoc6_whd - ) +target_link_libraries(${APP_TARGET} mbed-cy-psoc6-common-network) endif() if("capsense" IN_LIST MBED_TARGET_LABELS) @@ -104,7 +100,7 @@ if("capsense" IN_LIST MBED_TARGET_LABELS) target_link_libraries(${APP_TARGET} capsense ${CAPSENSE_LIB}) endif() -target_link_libraries(${APP_TARGET} mbed-os mbed-ble mbed-events mbed-netsocket mbed-storage mbed-storage-kv-global-api mbed-mbedtls mbed-mbedtls-cryptocell310 chip) +target_link_libraries(${APP_TARGET} mbed-os mbed-ble mbed-events mbed-netsocket mbed-storage mbed-storage-kv-global-api mbed-mbedtls mbed-emac chip) mbed_set_post_build(${APP_TARGET}) diff --git a/examples/lock-app/mbed/mbed_app.json b/examples/lock-app/mbed/mbed_app.json index c06296c162981f..d18924ecbfd667 100644 --- a/examples/lock-app/mbed/mbed_app.json +++ b/examples/lock-app/mbed/mbed_app.json @@ -30,7 +30,7 @@ "CORDIO" ], "led-active-state": 1, - "lock-button": "USER_BUTTON", + "lock-button": "BUTTON1", "function-button": "NC" }, "CY8CPROTO_062_4343W": { diff --git a/examples/shell/mbed/CMakeLists.txt b/examples/shell/mbed/CMakeLists.txt index f3936e9e10881b..8e20cb02315bdf 100644 --- a/examples/shell/mbed/CMakeLists.txt +++ b/examples/shell/mbed/CMakeLists.txt @@ -43,8 +43,6 @@ add_subdirectory(${CHIP_ROOT}/config/mbed ./chip_build) mbed_configure_app_target(${APP_TARGET}) -mbed_set_mbed_target_linker_script(${APP_TARGET}) - project(${APP_TARGET}) if("wifi_ism43362" IN_LIST MBED_TARGET_LABELS) @@ -55,17 +53,15 @@ endif() if("BlueNRG_MS" IN_LIST MBED_TARGET_LABELS) target_link_libraries(${APP_TARGET} - mbed-ble-blue_nrg + mbed-ble ) endif() if("WHD" IN_LIST MBED_TARGET_LABELS) - target_link_libraries(${APP_TARGET} - mbed-cy_psoc6_common_network mbed-emac mbed-cy_psoc6_whd - ) +target_link_libraries(${APP_TARGET} mbed-cy-psoc6-common-network) endif() -target_link_libraries(${APP_TARGET} mbed-os mbed-ble mbed-events mbed-netsocket mbed-storage mbed-storage-kv-global-api mbed-mbedtls mbed-mbedtls-cryptocell310 chip) +target_link_libraries(${APP_TARGET} mbed-os mbed-ble mbed-events mbed-netsocket mbed-storage mbed-storage-kv-global-api mbed-mbedtls mbed-emac chip) mbed_set_post_build(${APP_TARGET}) diff --git a/examples/shell/mbed/cmd_mbed_utils.cpp b/examples/shell/mbed/cmd_mbed_utils.cpp index 29a295eee04de7..914da21bf53b18 100644 --- a/examples/shell/mbed/cmd_mbed_utils.cpp +++ b/examples/shell/mbed/cmd_mbed_utils.cpp @@ -45,7 +45,7 @@ #include #include "netdb.h" -#include +#include #include using namespace chip; diff --git a/scripts/examples/mbed_example.sh b/scripts/examples/mbed_example.sh index 297efd0278c4af..d0f51eeefe50d6 100755 --- a/scripts/examples/mbed_example.sh +++ b/scripts/examples/mbed_example.sh @@ -154,5 +154,5 @@ if [[ "$COMMAND" == *"flash"* ]]; then MBED_FLASH_SCRIPTS_PATH=$CHIP_ROOT/config/mbed/scripts # Flash application - openocd -f $MBED_FLASH_SCRIPTS_PATH/$TARGET_BOARD.tcl -c "program $BUILD_DIRECTORY/chip-mbed-$APP-example verify reset exit" + openocd -f $MBED_FLASH_SCRIPTS_PATH/$TARGET_BOARD.tcl -c "program $BUILD_DIRECTORY/chip-mbed-$APP-example.elf verify reset exit" fi diff --git a/src/inet/BUILD.gn b/src/inet/BUILD.gn index e160c29d3eb281..23a5db5acc5732 100644 --- a/src/inet/BUILD.gn +++ b/src/inet/BUILD.gn @@ -79,7 +79,7 @@ if (chip_device_platform == "mbed") { "${chip_root}/src/platform/mbed/posix/src/socket.cpp", "${chip_root}/src/platform/mbed/posix/src/select.cpp", "${chip_root}/src/platform/mbed/posix/src/netdb.cpp", - "${chip_root}/src/platform/mbed/net/src/common.cpp", + "${chip_root}/src/platform/mbed/net/src/net_common.cpp", "${chip_root}/src/platform/mbed/net/src/net_if.cpp", "${chip_root}/src/platform/mbed/net/src/net_socket.cpp", "${chip_root}/src/platform/mbed/net/src/net_dns.cpp", diff --git a/src/platform/mbed/net/include/BSDSocket.h b/src/platform/mbed/net/include/BSDSocket.h index 3e9731e3a1c471..943467485ca9b5 100644 --- a/src/platform/mbed/net/include/BSDSocket.h +++ b/src/platform/mbed/net/include/BSDSocket.h @@ -19,7 +19,7 @@ #define MBED_NET_BSD_SOCKET_H #include "OpenFileHandleAsFileDescriptor.h" -#include "common.h" +#include "net_common.h" #include #include #include diff --git a/src/platform/mbed/net/include/common.h b/src/platform/mbed/net/include/net_common.h similarity index 100% rename from src/platform/mbed/net/include/common.h rename to src/platform/mbed/net/include/net_common.h diff --git a/src/platform/mbed/net/src/common.cpp b/src/platform/mbed/net/src/net_common.cpp similarity index 98% rename from src/platform/mbed/net/src/common.cpp rename to src/platform/mbed/net/src/net_common.cpp index 0ba937d470bff0..bbfe171df1ca98 100644 --- a/src/platform/mbed/net/src/common.cpp +++ b/src/platform/mbed/net/src/net_common.cpp @@ -1,4 +1,4 @@ -#include "common.h" +#include "net_common.h" #include #include diff --git a/src/platform/mbed/net/src/net_dns.cpp b/src/platform/mbed/net/src/net_dns.cpp index 8753b26d83c25c..82bb689af767e9 100644 --- a/src/platform/mbed/net/src/net_dns.cpp +++ b/src/platform/mbed/net/src/net_dns.cpp @@ -1,5 +1,5 @@ #include "net_dns.h" -#include +#include #include int mbed_getaddrinfo(const char * nodename, const char * servname, const struct addrinfo * hints, struct addrinfo ** res) diff --git a/src/platform/mbed/net/src/net_if.cpp b/src/platform/mbed/net/src/net_if.cpp index f64ea5cb96b00b..2c5a2095ca09f7 100644 --- a/src/platform/mbed/net/src/net_if.cpp +++ b/src/platform/mbed/net/src/net_if.cpp @@ -1,8 +1,8 @@ #include "net_if.h" -#include "common.h" #include #include #include +#include #include static int mbed_get_if_flags(unsigned int * flags); diff --git a/src/platform/mbed/net/src/net_socket.cpp b/src/platform/mbed/net/src/net_socket.cpp index 22f2d6e2ba26a3..7cccf0d2b72fa0 100644 --- a/src/platform/mbed/net/src/net_socket.cpp +++ b/src/platform/mbed/net/src/net_socket.cpp @@ -5,7 +5,7 @@ #include #include -#include "common.h" +#include "net_common.h" #include "mbed-trace/mbed_trace.h" @@ -15,7 +15,6 @@ using namespace rtos; #define TRACE_GROUP "NETS" #define NO_FREE_SOCKET_SLOT (-1) - static BSDSocket sockets[MBED_NET_SOCKET_MAX_NUMBER]; static BSDSocket * getBSDSocket(int fd) diff --git a/src/test_driver/mbed/unit_tests/CMakeLists.txt b/src/test_driver/mbed/unit_tests/CMakeLists.txt index b026529537a432..7bba3a2b74d705 100644 --- a/src/test_driver/mbed/unit_tests/CMakeLists.txt +++ b/src/test_driver/mbed/unit_tests/CMakeLists.txt @@ -37,7 +37,7 @@ add_subdirectory(${CHIP_ROOT}/config/mbed ./chip_build) mbed_configure_app_target(${APP_TARGET}) -mbed_set_mbed_target_linker_script(${APP_TARGET}) + project(${APP_TARGET}) @@ -49,16 +49,17 @@ endif() if("BlueNRG_MS" IN_LIST MBED_TARGET_LABELS) target_link_libraries(${APP_TARGET} - mbed-ble-blue_nrg + mbed-ble ) endif() + if("WHD" IN_LIST MBED_TARGET_LABELS) - target_link_libraries(${APP_TARGET} - mbed-cy_psoc6_common_network mbed-emac mbed-cy_psoc6_whd - ) +target_link_libraries(${APP_TARGET} mbed-cy-psoc6-common-network) endif() +target_link_libraries(${APP_TARGET} mbed-os mbed-ble mbed-events mbed-netsocket mbed-storage mbed-storage-kv-global-api mbed-mbedtls mbed-emac chip) + # As noted in the nrfconnect impl: # TODO: this list is hard to maintain manually (and currently incomplete). # An automated way that includes figuring out dependencies would be much better @@ -101,7 +102,7 @@ target_link_libraries(${APP_TARGET} MinimalMdnsRecords ) -target_link_libraries(${APP_TARGET} mbed-os mbed-ble mbed-events mbed-netsocket mbed-storage mbed-storage-kv-global-api mbed-mbedtls mbed-mbedtls-cryptocell310 chip) +target_link_libraries(${APP_TARGET} mbed-os mbed-ble mbed-events mbed-netsocket mbed-storage mbed-storage-kv-global-api mbed-mbedtls chip) mbed_set_post_build(${APP_TARGET}) From d2504f7ca18e26d3f43436b511ccea8cf49ec36b Mon Sep 17 00:00:00 2001 From: Lukasz Gniadzik Date: Fri, 2 Jul 2021 14:34:17 +0200 Subject: [PATCH 2/8] Update third_party/mbed-os/repo submodule branch --- third_party/mbed-os/repo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/mbed-os/repo b/third_party/mbed-os/repo index 2c6928cec0cbd9..4e121a7d798b85 160000 --- a/third_party/mbed-os/repo +++ b/third_party/mbed-os/repo @@ -1 +1 @@ -Subproject commit 2c6928cec0cbd91285409b39768a12a75c7a7433 +Subproject commit 4e121a7d798b859dc06932b62f83c1a69e5d1167 From a8b110eccb73e13abe5871e762e020e2eada3434 Mon Sep 17 00:00:00 2001 From: ATmobica Date: Mon, 9 Aug 2021 09:22:43 +0000 Subject: [PATCH 3/8] Improve apps CMakeLists - set correct MBED_PATH Fix pigweed app CMakeLists --- examples/all-clusters-app/mbed/CMakeLists.txt | 2 +- examples/lighting-app/mbed/CMakeLists.txt | 1 - examples/lock-app/mbed/CMakeLists.txt | 2 +- examples/pigweed-app/mbed/CMakeLists.txt | 14 +++----------- examples/shell/mbed/CMakeLists.txt | 2 +- 5 files changed, 6 insertions(+), 15 deletions(-) diff --git a/examples/all-clusters-app/mbed/CMakeLists.txt b/examples/all-clusters-app/mbed/CMakeLists.txt index 1925f1a3de3915..8f7dbd9646507a 100644 --- a/examples/all-clusters-app/mbed/CMakeLists.txt +++ b/examples/all-clusters-app/mbed/CMakeLists.txt @@ -14,7 +14,7 @@ configure_file( @ONLY ) -set(MBED_PATH $ENV{MBED_OS_PATH} CACHE INTERNAL "") +set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/mbed-os CACHE INTERNAL "") set(MBED_CONFIG_PATH ${CMAKE_CURRENT_BINARY_DIR} CACHE INTERNAL "") set(APP_TARGET chip-mbed-all-clusters-app-example) diff --git a/examples/lighting-app/mbed/CMakeLists.txt b/examples/lighting-app/mbed/CMakeLists.txt index 50452e08899c08..23781731fd8cac 100644 --- a/examples/lighting-app/mbed/CMakeLists.txt +++ b/examples/lighting-app/mbed/CMakeLists.txt @@ -14,7 +14,6 @@ configure_file( @ONLY ) -#set(MBED_PATH $ENV{MBED_OS_PATH} CACHE INTERNAL "") set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/mbed-os CACHE INTERNAL "") set(MBED_CONFIG_PATH ${CMAKE_CURRENT_BINARY_DIR} CACHE INTERNAL "") set(APP_TARGET chip-mbed-lighting-app-example) diff --git a/examples/lock-app/mbed/CMakeLists.txt b/examples/lock-app/mbed/CMakeLists.txt index 134509bb91d3ae..9e7867b58ee69b 100644 --- a/examples/lock-app/mbed/CMakeLists.txt +++ b/examples/lock-app/mbed/CMakeLists.txt @@ -14,7 +14,7 @@ configure_file( @ONLY ) -set(MBED_PATH $ENV{MBED_OS_PATH} CACHE INTERNAL "") +set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/mbed-os CACHE INTERNAL "") set(MBED_CONFIG_PATH ${CMAKE_CURRENT_BINARY_DIR} CACHE INTERNAL "") set(APP_TARGET chip-mbed-lock-app-example) diff --git a/examples/pigweed-app/mbed/CMakeLists.txt b/examples/pigweed-app/mbed/CMakeLists.txt index b05b25a7375a46..c469fd72cea46e 100644 --- a/examples/pigweed-app/mbed/CMakeLists.txt +++ b/examples/pigweed-app/mbed/CMakeLists.txt @@ -13,7 +13,7 @@ configure_file( @ONLY ) -set(MBED_PATH $ENV{MBED_OS_PATH} CACHE INTERNAL "") +set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/mbed-os CACHE INTERNAL "") set(MBED_CONFIG_PATH ${CMAKE_CURRENT_BINARY_DIR} CACHE INTERNAL "") set(APP_TARGET chip-mbed-pigweed-app-example) @@ -42,8 +42,6 @@ add_subdirectory(${CHIP_ROOT}/config/mbed ./chip_build) mbed_configure_app_target(${APP_TARGET}) -mbed_set_mbed_target_linker_script(${APP_TARGET}) - project(${APP_TARGET}) if("wifi_ism43362" IN_LIST MBED_TARGET_LABELS) @@ -52,19 +50,13 @@ if("wifi_ism43362" IN_LIST MBED_TARGET_LABELS) ) endif() -if("BlueNRG_MS" IN_LIST MBED_TARGET_LABELS) - target_link_libraries(${APP_TARGET} - mbed-ble-blue_nrg - ) -endif() - if("WHD" IN_LIST MBED_TARGET_LABELS) target_link_libraries(${APP_TARGET} - mbed-cy_psoc6_common_network mbed-emac mbed-cy_psoc6_whd + mbed-cy-psoc6-common-network ) endif() -target_link_libraries(${APP_TARGET} mbed-os mbed-ble mbed-events mbed-netsocket mbed-storage mbed-storage-kv-global-api mbed-mbedtls mbed-mbedtls-cryptocell310 chip) +target_link_libraries(${APP_TARGET} mbed-os mbed-ble mbed-events mbed-netsocket mbed-storage mbed-storage-kv-global-api mbed-mbedtls mbed-emac chip) mbed_set_post_build(${APP_TARGET}) diff --git a/examples/shell/mbed/CMakeLists.txt b/examples/shell/mbed/CMakeLists.txt index 8e20cb02315bdf..0b16023cabdf89 100644 --- a/examples/shell/mbed/CMakeLists.txt +++ b/examples/shell/mbed/CMakeLists.txt @@ -12,7 +12,7 @@ configure_file( @ONLY ) -set(MBED_PATH $ENV{MBED_OS_PATH} CACHE INTERNAL "") +set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/mbed-os CACHE INTERNAL "") set(MBED_CONFIG_PATH ${CMAKE_CURRENT_BINARY_DIR} CACHE INTERNAL "") set(APP_TARGET chip-mbed-shell-example) From 029ed4a74b394fb5ecbf47835c9cc09288aaf3a5 Mon Sep 17 00:00:00 2001 From: ATmobica Date: Mon, 9 Aug 2021 09:42:58 +0000 Subject: [PATCH 4/8] Add .elf extension to executable file for DISCO debug option --- .vscode/launch.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index e501e5dd368317..ba4b1825c9c4ee 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -187,7 +187,7 @@ "type": "cortex-debug", "request": "launch", "cwd": "${workspaceRoot}/examples/${input:mbedApp}/mbed", - "executable": "./build-DISCO_L475VG_IOT01A/${input:mbedDebugProfile}/chip-mbed-${input:mbedApp}-example", + "executable": "./build-DISCO_L475VG_IOT01A/${input:mbedDebugProfile}/chip-mbed-${input:mbedApp}-example.elf", "servertype": "openocd", "searchDir": [ "${workspaceRoot}/config/mbed/scripts", @@ -209,7 +209,7 @@ "type": "cortex-debug", "request": "launch", "cwd": "${workspaceRoot}/examples/${input:mbedApp}/mbed", - "executable": "./build-DISCO_L475VG_IOT01A/${input:mbedDebugProfile}/chip-mbed-${input:mbedApp}-example", + "executable": "./build-DISCO_L475VG_IOT01A/${input:mbedDebugProfile}/chip-mbed-${input:mbedApp}-example.elf", "servertype": "external", "gdbTarget": "host.docker.internal:3333", "overrideLaunchCommands": [ @@ -227,7 +227,7 @@ "type": "cortex-debug", "request": "launch", "cwd": "${workspaceRoot}/examples/${input:mbedApp}/mbed", - "executable": "./build-DISCO_L475VG_IOT01A/${input:mbedFlashProfile}/chip-mbed-${input:mbedApp}-example", + "executable": "./build-DISCO_L475VG_IOT01A/${input:mbedFlashProfile}/chip-mbed-${input:mbedApp}-example.elf", "servertype": "openocd", "searchDir": [ "${workspaceRoot}/config/mbed/scripts", @@ -248,7 +248,7 @@ "type": "cortex-debug", "request": "launch", "cwd": "${workspaceRoot}/examples/${input:mbedApp}/mbed", - "executable": "./build-DISCO_L475VG_IOT01A/${input:mbedFlashProfile}/chip-mbed-${input:mbedApp}-example.hex", + "executable": "./build-DISCO_L475VG_IOT01A/${input:mbedFlashProfile}/chip-mbed-${input:mbedApp}-example.elf", "servertype": "external", "gdbTarget": "host.docker.internal:3333", "overrideLaunchCommands": [ @@ -265,7 +265,7 @@ "type": "cortex-debug", "request": "launch", "cwd": "${workspaceRoot}/src/test_driver/mbed/unit_tests", - "executable": "./build-DISCO_L475VG_IOT01A/${input:mbedDebugProfile}/chip-mbed-unit-tests", + "executable": "./build-DISCO_L475VG_IOT01A/${input:mbedDebugProfile}/chip-mbed-unit-tests.elf", "servertype": "openocd", "searchDir": [ "${workspaceRoot}/config/mbed/scripts", @@ -287,7 +287,7 @@ "type": "cortex-debug", "request": "launch", "cwd": "${workspaceRoot}/src/test_driver/mbed/unit_tests", - "executable": "./build-CY8CPROTO_062_4343W/${input:mbedDebugProfile}/chip-mbed-unit-tests", + "executable": "./build-CY8CPROTO_062_4343W/${input:mbedDebugProfile}/chip-mbed-unit-tests.elf", "servertype": "openocd", "searchDir": [ "${workspaceRoot}/config/mbed/scripts", From cbb6f9a15a159c63e1b88bdb1ddf34a03f970376 Mon Sep 17 00:00:00 2001 From: ATmobica Date: Mon, 9 Aug 2021 10:14:17 +0000 Subject: [PATCH 5/8] Cleanup apps CMakeLists --- examples/all-clusters-app/mbed/CMakeLists.txt | 6 ------ examples/lighting-app/mbed/CMakeLists.txt | 7 ------- examples/lock-app/mbed/CMakeLists.txt | 6 ------ examples/shell/mbed/CMakeLists.txt | 6 ------ src/test_driver/mbed/unit_tests/CMakeLists.txt | 7 ------- 5 files changed, 32 deletions(-) diff --git a/examples/all-clusters-app/mbed/CMakeLists.txt b/examples/all-clusters-app/mbed/CMakeLists.txt index 8f7dbd9646507a..53707868fb19bf 100644 --- a/examples/all-clusters-app/mbed/CMakeLists.txt +++ b/examples/all-clusters-app/mbed/CMakeLists.txt @@ -107,12 +107,6 @@ if("wifi_ism43362" IN_LIST MBED_TARGET_LABELS) ) endif() -if("BlueNRG_MS" IN_LIST MBED_TARGET_LABELS) - target_link_libraries(${APP_TARGET} - mbed-ble - ) -endif() - if("WHD" IN_LIST MBED_TARGET_LABELS) target_link_libraries(${APP_TARGET} mbed-cy-psoc6-common-network) endif() diff --git a/examples/lighting-app/mbed/CMakeLists.txt b/examples/lighting-app/mbed/CMakeLists.txt index 23781731fd8cac..d31f480d09277e 100644 --- a/examples/lighting-app/mbed/CMakeLists.txt +++ b/examples/lighting-app/mbed/CMakeLists.txt @@ -81,13 +81,6 @@ if("wifi_ism43362" IN_LIST MBED_TARGET_LABELS) ) endif() -if("BlueNRG_MS" IN_LIST MBED_TARGET_LABELS) - target_link_libraries(${APP_TARGET} - mbed-ble - ) -endif() - - if("WHD" IN_LIST MBED_TARGET_LABELS) target_link_libraries(${APP_TARGET} mbed-cy-psoc6-common-network) endif() diff --git a/examples/lock-app/mbed/CMakeLists.txt b/examples/lock-app/mbed/CMakeLists.txt index 9e7867b58ee69b..ea2914b99cace9 100644 --- a/examples/lock-app/mbed/CMakeLists.txt +++ b/examples/lock-app/mbed/CMakeLists.txt @@ -79,12 +79,6 @@ if("wifi_ism43362" IN_LIST MBED_TARGET_LABELS) ) endif() -if("BlueNRG_MS" IN_LIST MBED_TARGET_LABELS) - target_link_libraries(${APP_TARGET} - mbed-ble - ) -endif() - if("WHD" IN_LIST MBED_TARGET_LABELS) target_link_libraries(${APP_TARGET} mbed-cy-psoc6-common-network) endif() diff --git a/examples/shell/mbed/CMakeLists.txt b/examples/shell/mbed/CMakeLists.txt index 0b16023cabdf89..9148ec1f667f2d 100644 --- a/examples/shell/mbed/CMakeLists.txt +++ b/examples/shell/mbed/CMakeLists.txt @@ -51,12 +51,6 @@ if("wifi_ism43362" IN_LIST MBED_TARGET_LABELS) ) endif() -if("BlueNRG_MS" IN_LIST MBED_TARGET_LABELS) - target_link_libraries(${APP_TARGET} - mbed-ble - ) -endif() - if("WHD" IN_LIST MBED_TARGET_LABELS) target_link_libraries(${APP_TARGET} mbed-cy-psoc6-common-network) endif() diff --git a/src/test_driver/mbed/unit_tests/CMakeLists.txt b/src/test_driver/mbed/unit_tests/CMakeLists.txt index 7bba3a2b74d705..12735bfcfb1aa0 100644 --- a/src/test_driver/mbed/unit_tests/CMakeLists.txt +++ b/src/test_driver/mbed/unit_tests/CMakeLists.txt @@ -47,13 +47,6 @@ if("wifi_ism43362" IN_LIST MBED_TARGET_LABELS) ) endif() -if("BlueNRG_MS" IN_LIST MBED_TARGET_LABELS) - target_link_libraries(${APP_TARGET} - mbed-ble - ) -endif() - - if("WHD" IN_LIST MBED_TARGET_LABELS) target_link_libraries(${APP_TARGET} mbed-cy-psoc6-common-network) endif() From b7e8b6663b2ab83b08ebaa50a874da9d04079684 Mon Sep 17 00:00:00 2001 From: ATmobica Date: Mon, 9 Aug 2021 11:43:27 +0000 Subject: [PATCH 6/8] Set -Wno-error for mbed pigweed build --- examples/platform/mbed/pw_sys_io/BUILD.gn | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/platform/mbed/pw_sys_io/BUILD.gn b/examples/platform/mbed/pw_sys_io/BUILD.gn index ad312f577e9ffc..e0854171e44243 100644 --- a/examples/platform/mbed/pw_sys_io/BUILD.gn +++ b/examples/platform/mbed/pw_sys_io/BUILD.gn @@ -30,8 +30,7 @@ pw_source_set("pw_sys_io_mbed") { cflags = [ "-Wconversion" ] cflags_cc = [ - "-Wno-error=undef", - "-Wno-error=cast-qual" + "-Wno-error" ] public_configs = [ ":default_config" ] From d1e7ec1cd0774f68cad48e4a8203e14ce7222bc0 Mon Sep 17 00:00:00 2001 From: ATmobica Date: Mon, 9 Aug 2021 13:45:35 +0000 Subject: [PATCH 7/8] Fix pigweed app building Remove -Wno-error for mbed pigweed build Remove passing mbed-cy-psoc6-common-network compilation flags --- config/mbed/CMakeLists.txt | 6 ++---- examples/platform/mbed/pw_sys_io/BUILD.gn | 3 ++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/config/mbed/CMakeLists.txt b/config/mbed/CMakeLists.txt index c5eb290cb1dff6..aa4c40cc894b11 100644 --- a/config/mbed/CMakeLists.txt +++ b/config/mbed/CMakeLists.txt @@ -147,16 +147,14 @@ list(APPEND CHIP_CFLAGS ${CHIP_MBEDCMSISCM_CFLAGS}) if("WHD" IN_LIST MBED_TARGET_LABELS) +mbed_get_target_common_compile_flags(CHIP_MBEDCMSISCY8_CFLAGS mbed-cy8cproto-062-4343w) +list(APPEND CHIP_CFLAGS ${CHIP_MBEDCMSISCY8_CFLAGS}) mbed_get_target_common_compile_flags(CHIP_MBEDPSOC6_CFLAGS mbed-psoc6) list(APPEND CHIP_CFLAGS ${CHIP_MBEDPSOC6_CFLAGS}) mbed_get_target_common_compile_flags(CHIP_MBEDCAT1_CFLAGS mbed-cat1a) list(APPEND CHIP_CFLAGS ${CHIP_MBEDCAT1_CFLAGS}) -mbed_get_target_common_compile_flags(CHIP_MBEDCMSISCY8_CFLAGS mbed-cy8cproto-062-4343w) -list(APPEND CHIP_CFLAGS ${CHIP_MBEDCMSISCY8_CFLAGS}) mbed_get_target_common_compile_flags(CHIP_MBEDCMSISCY8MODUS_CFLAGS mbed-cy8cproto-062-4343w-bsp-design-modus) list(APPEND CHIP_CFLAGS ${CHIP_MBEDCMSISCY8MODUS_CFLAGS}) -mbed_get_target_common_compile_flags(CHIP_MBEDCMSISCY8NET_CFLAGS mbed-cy-psoc6-common-network) -list(APPEND CHIP_CFLAGS ${CHIP_MBEDCMSISCY8NET_CFLAGS}) endif() if("BlueNRG_MS" IN_LIST MBED_TARGET_LABELS) diff --git a/examples/platform/mbed/pw_sys_io/BUILD.gn b/examples/platform/mbed/pw_sys_io/BUILD.gn index e0854171e44243..ad312f577e9ffc 100644 --- a/examples/platform/mbed/pw_sys_io/BUILD.gn +++ b/examples/platform/mbed/pw_sys_io/BUILD.gn @@ -30,7 +30,8 @@ pw_source_set("pw_sys_io_mbed") { cflags = [ "-Wconversion" ] cflags_cc = [ - "-Wno-error" + "-Wno-error=undef", + "-Wno-error=cast-qual" ] public_configs = [ ":default_config" ] From 52621c40b404d9047a0906da94197a63ab747f7f Mon Sep 17 00:00:00 2001 From: ATmobica Date: Mon, 9 Aug 2021 15:10:44 +0000 Subject: [PATCH 8/8] Improve target's condition in CMakeLists --- config/mbed/CMakeLists.txt | 41 +++++++++---------- examples/all-clusters-app/mbed/CMakeLists.txt | 12 +++--- examples/lighting-app/mbed/CMakeLists.txt | 12 +++--- examples/lock-app/mbed/CMakeLists.txt | 12 +++--- examples/pigweed-app/mbed/CMakeLists.txt | 14 +++---- examples/shell/mbed/CMakeLists.txt | 12 +++--- 6 files changed, 45 insertions(+), 58 deletions(-) diff --git a/config/mbed/CMakeLists.txt b/config/mbed/CMakeLists.txt index aa4c40cc894b11..96678e6132c783 100644 --- a/config/mbed/CMakeLists.txt +++ b/config/mbed/CMakeLists.txt @@ -145,29 +145,28 @@ list(APPEND CHIP_CFLAGS_CC ${CMAKE_CXX_FLAGS_INIT}) mbed_get_target_common_compile_flags(CHIP_MBEDCMSISCM_CFLAGS mbed-cmsis-cortex-m) list(APPEND CHIP_CFLAGS ${CHIP_MBEDCMSISCM_CFLAGS}) - -if("WHD" IN_LIST MBED_TARGET_LABELS) -mbed_get_target_common_compile_flags(CHIP_MBEDCMSISCY8_CFLAGS mbed-cy8cproto-062-4343w) -list(APPEND CHIP_CFLAGS ${CHIP_MBEDCMSISCY8_CFLAGS}) -mbed_get_target_common_compile_flags(CHIP_MBEDPSOC6_CFLAGS mbed-psoc6) -list(APPEND CHIP_CFLAGS ${CHIP_MBEDPSOC6_CFLAGS}) -mbed_get_target_common_compile_flags(CHIP_MBEDCAT1_CFLAGS mbed-cat1a) -list(APPEND CHIP_CFLAGS ${CHIP_MBEDCAT1_CFLAGS}) -mbed_get_target_common_compile_flags(CHIP_MBEDCMSISCY8MODUS_CFLAGS mbed-cy8cproto-062-4343w-bsp-design-modus) -list(APPEND CHIP_CFLAGS ${CHIP_MBEDCMSISCY8MODUS_CFLAGS}) +if(MBED_TARGET STREQUAL "CY8CPROTO_062_4343W") + mbed_get_target_common_compile_flags(CHIP_MBEDCMSISCY8_CFLAGS mbed-cy8cproto-062-4343w) + list(APPEND CHIP_CFLAGS ${CHIP_MBEDCMSISCY8_CFLAGS}) + mbed_get_target_common_compile_flags(CHIP_MBEDPSOC6_CFLAGS mbed-psoc6) + list(APPEND CHIP_CFLAGS ${CHIP_MBEDPSOC6_CFLAGS}) + mbed_get_target_common_compile_flags(CHIP_MBEDCAT1_CFLAGS mbed-cat1a) + list(APPEND CHIP_CFLAGS ${CHIP_MBEDCAT1_CFLAGS}) + mbed_get_target_common_compile_flags(CHIP_MBEDCMSISCY8MODUS_CFLAGS mbed-cy8cproto-062-4343w-bsp-design-modus) + list(APPEND CHIP_CFLAGS ${CHIP_MBEDCMSISCY8MODUS_CFLAGS}) endif() -if("BlueNRG_MS" IN_LIST MBED_TARGET_LABELS) -mbed_get_target_common_compile_flags(CHIP_MBEDSTM_CFLAGS mbed-stm ) -list(APPEND CHIP_CFLAGS ${CHIP_MBEDSTM_CFLAGS}) -mbed_get_target_common_compile_flags(CHIP_MBEDCMSISCM_CFLAGS mbed-stm32l4) -list(APPEND CHIP_CFLAGS ${CHIP_MBEDCMSISCM_CFLAGS}) -mbed_get_target_common_compile_flags(CHIP_MBEDCSTMCUBE_CFLAGS mbed-stm32l4cube-fw) -list(APPEND CHIP_CFLAGS ${CHIP_MBEDCSTMCUBE_CFLAGS}) -mbed_get_target_common_compile_flags(CHIP_MBEDSTML4_CFLAGS mbed-stm32l475xg) -list(APPEND CHIP_CFLAGS ${CHIP_MBEDSTML4_CFLAGS}) -mbed_get_target_common_compile_flags(CHIP_MBEDSTML4IOT_CFLAGS mbed-disco-l475vg-iot01a) -list(APPEND CHIP_CFLAGS ${CHIP_MBEDSTML4IOT_CFLAGS}) +if(MBED_TARGET STREQUAL "DISCO_L475VG_IOT01A") + mbed_get_target_common_compile_flags(CHIP_MBEDSTM_CFLAGS mbed-stm ) + list(APPEND CHIP_CFLAGS ${CHIP_MBEDSTM_CFLAGS}) + mbed_get_target_common_compile_flags(CHIP_MBEDCMSISCM_CFLAGS mbed-stm32l4) + list(APPEND CHIP_CFLAGS ${CHIP_MBEDCMSISCM_CFLAGS}) + mbed_get_target_common_compile_flags(CHIP_MBEDCSTMCUBE_CFLAGS mbed-stm32l4cube-fw) + list(APPEND CHIP_CFLAGS ${CHIP_MBEDCSTMCUBE_CFLAGS}) + mbed_get_target_common_compile_flags(CHIP_MBEDSTML4_CFLAGS mbed-stm32l475xg) + list(APPEND CHIP_CFLAGS ${CHIP_MBEDSTML4_CFLAGS}) + mbed_get_target_common_compile_flags(CHIP_MBEDSTML4IOT_CFLAGS mbed-disco-l475vg-iot01a) + list(APPEND CHIP_CFLAGS ${CHIP_MBEDSTML4IOT_CFLAGS}) endif() # Add support for Mbed BLE diff --git a/examples/all-clusters-app/mbed/CMakeLists.txt b/examples/all-clusters-app/mbed/CMakeLists.txt index 53707868fb19bf..87af4b8aacbf34 100644 --- a/examples/all-clusters-app/mbed/CMakeLists.txt +++ b/examples/all-clusters-app/mbed/CMakeLists.txt @@ -21,7 +21,7 @@ set(APP_TARGET chip-mbed-all-clusters-app-example) include(${MBED_PATH}/tools/cmake/app.cmake) add_subdirectory(${MBED_PATH} ./mbed_build) -if("wifi_ism43362" IN_LIST MBED_TARGET_LABELS) +if(MBED_TARGET STREQUAL "DISCO_L475VG_IOT01A") add_subdirectory(wifi-ism43362) endif() @@ -101,14 +101,12 @@ mbed_configure_app_target(${APP_TARGET}) project(${APP_TARGET}) -if("wifi_ism43362" IN_LIST MBED_TARGET_LABELS) - target_link_libraries(${APP_TARGET} - wifi-ism43362 - ) +if(MBED_TARGET STREQUAL "DISCO_L475VG_IOT01A") + target_link_libraries(${APP_TARGET} wifi-ism43362) endif() -if("WHD" IN_LIST MBED_TARGET_LABELS) -target_link_libraries(${APP_TARGET} mbed-cy-psoc6-common-network) +if(MBED_TARGET STREQUAL "CY8CPROTO_062_4343W") + target_link_libraries(${APP_TARGET} mbed-cy-psoc6-common-network) endif() target_link_libraries(${APP_TARGET} mbed-os mbed-ble mbed-events mbed-netsocket mbed-storage mbed-storage-kv-global-api mbed-mbedtls mbed-emac chip) diff --git a/examples/lighting-app/mbed/CMakeLists.txt b/examples/lighting-app/mbed/CMakeLists.txt index d31f480d09277e..8702e9ccfc6d86 100644 --- a/examples/lighting-app/mbed/CMakeLists.txt +++ b/examples/lighting-app/mbed/CMakeLists.txt @@ -21,7 +21,7 @@ set(APP_TARGET chip-mbed-lighting-app-example) include(${MBED_PATH}/tools/cmake/app.cmake) add_subdirectory(${MBED_PATH} ./mbed_build) -if("wifi_ism43362" IN_LIST MBED_TARGET_LABELS) +if(MBED_TARGET STREQUAL "DISCO_L475VG_IOT01A") add_subdirectory(wifi-ism43362) endif() @@ -75,14 +75,12 @@ mbed_configure_app_target(${APP_TARGET}) project(${APP_TARGET}) -if("wifi_ism43362" IN_LIST MBED_TARGET_LABELS) - target_link_libraries(${APP_TARGET} - wifi-ism43362 - ) +if(MBED_TARGET STREQUAL "DISCO_L475VG_IOT01A") + target_link_libraries(${APP_TARGET} wifi-ism43362) endif() -if("WHD" IN_LIST MBED_TARGET_LABELS) -target_link_libraries(${APP_TARGET} mbed-cy-psoc6-common-network) +if(MBED_TARGET STREQUAL "CY8CPROTO_062_4343W") + target_link_libraries(${APP_TARGET} mbed-cy-psoc6-common-network) endif() if("capsense" IN_LIST MBED_TARGET_LABELS) diff --git a/examples/lock-app/mbed/CMakeLists.txt b/examples/lock-app/mbed/CMakeLists.txt index ea2914b99cace9..9351bd18f7f4c1 100644 --- a/examples/lock-app/mbed/CMakeLists.txt +++ b/examples/lock-app/mbed/CMakeLists.txt @@ -21,7 +21,7 @@ set(APP_TARGET chip-mbed-lock-app-example) include(${MBED_PATH}/tools/cmake/app.cmake) add_subdirectory(${MBED_PATH} ./mbed_build) -if("wifi_ism43362" IN_LIST MBED_TARGET_LABELS) +if(MBED_TARGET STREQUAL "DISCO_L475VG_IOT01A") add_subdirectory(wifi-ism43362) endif() @@ -73,14 +73,12 @@ mbed_configure_app_target(${APP_TARGET}) project(${APP_TARGET}) -if("wifi_ism43362" IN_LIST MBED_TARGET_LABELS) - target_link_libraries(${APP_TARGET} - wifi-ism43362 - ) +if(MBED_TARGET STREQUAL "DISCO_L475VG_IOT01A") + target_link_libraries(${APP_TARGET} wifi-ism43362) endif() -if("WHD" IN_LIST MBED_TARGET_LABELS) -target_link_libraries(${APP_TARGET} mbed-cy-psoc6-common-network) +if(MBED_TARGET STREQUAL "CY8CPROTO_062_4343W") + target_link_libraries(${APP_TARGET} mbed-cy-psoc6-common-network) endif() if("capsense" IN_LIST MBED_TARGET_LABELS) diff --git a/examples/pigweed-app/mbed/CMakeLists.txt b/examples/pigweed-app/mbed/CMakeLists.txt index c469fd72cea46e..c71e48ccf49df8 100644 --- a/examples/pigweed-app/mbed/CMakeLists.txt +++ b/examples/pigweed-app/mbed/CMakeLists.txt @@ -20,7 +20,7 @@ set(APP_TARGET chip-mbed-pigweed-app-example) include(${MBED_PATH}/tools/cmake/app.cmake) add_subdirectory(${MBED_PATH} ./mbed_build) -if("wifi_ism43362" IN_LIST MBED_TARGET_LABELS) +if(MBED_TARGET STREQUAL "DISCO_L475VG_IOT01A") add_subdirectory(wifi-ism43362) endif() @@ -44,16 +44,12 @@ mbed_configure_app_target(${APP_TARGET}) project(${APP_TARGET}) -if("wifi_ism43362" IN_LIST MBED_TARGET_LABELS) - target_link_libraries(${APP_TARGET} - wifi-ism43362 - ) +if(MBED_TARGET STREQUAL "DISCO_L475VG_IOT01A") + target_link_libraries(${APP_TARGET} wifi-ism43362) endif() -if("WHD" IN_LIST MBED_TARGET_LABELS) - target_link_libraries(${APP_TARGET} - mbed-cy-psoc6-common-network - ) +if(MBED_TARGET STREQUAL "CY8CPROTO_062_4343W") + target_link_libraries(${APP_TARGET} mbed-cy-psoc6-common-network) endif() target_link_libraries(${APP_TARGET} mbed-os mbed-ble mbed-events mbed-netsocket mbed-storage mbed-storage-kv-global-api mbed-mbedtls mbed-emac chip) diff --git a/examples/shell/mbed/CMakeLists.txt b/examples/shell/mbed/CMakeLists.txt index 9148ec1f667f2d..e0b93531ac332b 100644 --- a/examples/shell/mbed/CMakeLists.txt +++ b/examples/shell/mbed/CMakeLists.txt @@ -19,7 +19,7 @@ set(APP_TARGET chip-mbed-shell-example) include(${MBED_PATH}/tools/cmake/app.cmake) add_subdirectory(${MBED_PATH} ./mbed_build) -if("wifi_ism43362" IN_LIST MBED_TARGET_LABELS) +if(MBED_TARGET STREQUAL "DISCO_L475VG_IOT01A") add_subdirectory(wifi-ism43362) endif() @@ -45,14 +45,12 @@ mbed_configure_app_target(${APP_TARGET}) project(${APP_TARGET}) -if("wifi_ism43362" IN_LIST MBED_TARGET_LABELS) - target_link_libraries(${APP_TARGET} - wifi-ism43362 - ) +if(MBED_TARGET STREQUAL "DISCO_L475VG_IOT01A") + target_link_libraries(${APP_TARGET} wifi-ism43362) endif() -if("WHD" IN_LIST MBED_TARGET_LABELS) -target_link_libraries(${APP_TARGET} mbed-cy-psoc6-common-network) +if(MBED_TARGET STREQUAL "CY8CPROTO_062_4343W") + target_link_libraries(${APP_TARGET} mbed-cy-psoc6-common-network) endif() target_link_libraries(${APP_TARGET} mbed-os mbed-ble mbed-events mbed-netsocket mbed-storage mbed-storage-kv-global-api mbed-mbedtls mbed-emac chip)