Skip to content

Chip uses new Mbed #179

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Aug 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we can use it until ARMmbed/mbed-os#14847 has been merged

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should work with the code we have now but it won't with what's present upstream.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I think we can merge it to the current development but check it again before upstreaming.

[submodule "wifi-ism43362"]
path = third_party/wifi-ism43362/repo
url = https://github.com/ATmobica/wifi-ism43362.git
Expand Down
20 changes: 10 additions & 10 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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": [
Expand All @@ -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",
Expand All @@ -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": [
Expand All @@ -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",
Expand All @@ -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": [
Expand All @@ -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",
Expand All @@ -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": [
Expand All @@ -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",
Expand All @@ -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",
Expand Down
26 changes: 26 additions & 0 deletions config/mbed/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,32 @@ 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(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(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
mbed_get_target_common_compile_flags(CHIP_MBEDBLE_CFLAGS mbed-ble)
Expand Down
26 changes: 7 additions & 19 deletions examples/all-clusters-app/mbed/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ 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)

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()

Expand Down Expand Up @@ -99,29 +99,17 @@ 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)
target_link_libraries(${APP_TARGET}
wifi-ism43362
)
endif()

if("BlueNRG_MS" IN_LIST MBED_TARGET_LABELS)
target_link_libraries(${APP_TARGET}
mbed-ble-blue_nrg
)
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 mbed-emac mbed-cy_psoc6_whd
)
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-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})

Expand Down
28 changes: 8 additions & 20 deletions examples/lighting-app/mbed/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ 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)

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()

Expand Down Expand Up @@ -72,27 +72,15 @@ 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)
target_link_libraries(${APP_TARGET}
wifi-ism43362
)
endif()

if("BlueNRG_MS" IN_LIST MBED_TARGET_LABELS)
target_link_libraries(${APP_TARGET}
mbed-ble-blue_nrg
)
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 mbed-emac mbed-cy_psoc6_whd
)
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)
Expand All @@ -106,7 +94,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})

Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/mbed/mbed_app.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"CORDIO"
],
"led-active-state": 1,
"lighting-button": "USER_BUTTON",
"lighting-button": "BUTTON1",
"function-button": "NC"
},
"CY8CPROTO_062_4343W": {
Expand Down
26 changes: 7 additions & 19 deletions examples/lock-app/mbed/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ 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)

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()

Expand Down Expand Up @@ -71,26 +71,14 @@ 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)
target_link_libraries(${APP_TARGET}
wifi-ism43362
)
endif()

if("BlueNRG_MS" IN_LIST MBED_TARGET_LABELS)
target_link_libraries(${APP_TARGET}
mbed-ble-blue_nrg
)
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 mbed-emac mbed-cy_psoc6_whd
)
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)
Expand All @@ -104,7 +92,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})

Expand Down
2 changes: 1 addition & 1 deletion examples/lock-app/mbed/mbed_app.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"CORDIO"
],
"led-active-state": 1,
"lock-button": "USER_BUTTON",
"lock-button": "BUTTON1",
"function-button": "NC"
},
"CY8CPROTO_062_4343W": {
Expand Down
26 changes: 7 additions & 19 deletions examples/pigweed-app/mbed/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ 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)

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()

Expand All @@ -42,29 +42,17 @@ 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)
target_link_libraries(${APP_TARGET}
wifi-ism43362
)
endif()

if("BlueNRG_MS" IN_LIST MBED_TARGET_LABELS)
target_link_libraries(${APP_TARGET}
mbed-ble-blue_nrg
)
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 mbed-emac mbed-cy_psoc6_whd
)
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-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})

Expand Down
Loading