diff --git a/.flake8 b/.flake8 index 03d013f52334a3..eb983226f07b05 100644 --- a/.flake8 +++ b/.flake8 @@ -55,7 +55,6 @@ exclude = third_party scripts/tools/memory/memdf/__init__.py scripts/tools/memory/report_summary.py scripts/tools/silabs/FactoryDataProvider.py - scripts/tools/telink/mfg_tool.py scripts/tools/zap/generate.py scripts/tools/zap/prune_outputs.py scripts/tools/zap/version_update.py diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml index 90b925786afed8..084226e14510a0 100644 --- a/.github/workflows/examples-efr32.yaml +++ b/.github/workflows/examples-efr32.yaml @@ -39,7 +39,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-efr32:0.6.47 + image: connectedhomeip/chip-build-efr32:0.6.50 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: @@ -52,7 +52,7 @@ jobs: attempt_limit: 3 attempt_delay: 2000 - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform efr32 + run: scripts/checkout_submodules.py --shallow --platform silabs_docker # - name: Out of Tree verification # run: third_party/silabs/out_of_tree_verification.sh @@ -114,7 +114,7 @@ jobs: - name: Build example EFR32+WF200 WiFi Lock app for BRD4161A timeout-minutes: 15 run: | - scripts/examples/gn_efr32_example.sh examples/lock-app/silabs/efr32/ out/lock_app_wifi_wf200 BRD4161A is_debug=false chip_logging=false --wifi wf200 + scripts/examples/gn_efr32_example.sh examples/lock-app/silabs/efr32/ out/lock_app_wifi_wf200 BRD4161A is_debug=false chip_logging=false --wifi wf200 --docker .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py efr32 BRD4161A+wf200 lock-app \ out/lock_app_wifi_wf200/BRD4161A/chip-efr32-lock-example.out /tmp/bloat_reports/ - name: Clean out build output @@ -122,7 +122,7 @@ jobs: - name: Build example EFR32+RS9116 WiFi Lighting app for BRD4161A timeout-minutes: 15 run: | - scripts/examples/gn_efr32_example.sh examples/lighting-app/silabs/efr32/ out/lighting_app_wifi_rs9116 BRD4161A --wifi rs9116 + scripts/examples/gn_efr32_example.sh examples/lighting-app/silabs/efr32/ out/lighting_app_wifi_rs9116 BRD4161A --wifi rs9116 --docker .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py efr32 BRD4161A+rs9116 lighting-app \ out/lighting_app_wifi_rs9116/BRD4161A/chip-efr32-lighting-example.out /tmp/bloat_reports/ - name: Clean out build output diff --git a/.github/workflows/examples-telink.yaml b/.github/workflows/examples-telink.yaml index f26f0a3c7313da..df6c31813167e1 100644 --- a/.github/workflows/examples-telink.yaml +++ b/.github/workflows/examples-telink.yaml @@ -130,6 +130,21 @@ jobs: - name: clean out build output run: rm -rf ./out + - name: Build example Telink Lighting App with Factory Data + run: | + ./scripts/checkout_submodules.py --shallow --platform linux + ./scripts/build/gn_gen.sh + ./scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE chip-cert chip-tool spake2p" + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-light-factory-data' build" + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + telink tlsr9518adk80d lighting-app-factory-data \ + out/telink-tlsr9518adk80d-light-factory-data/zephyr/zephyr.elf \ + /tmp/bloat_reports/ + + - name: clean out build output + run: rm -rf ./out + - name: Build example Telink Light Switch App run: | ./scripts/run_in_build_env.sh \ diff --git a/.github/workflows/smoketest-android.yaml b/.github/workflows/smoketest-android.yaml index 769fa93f2530a8..90987df038cb79 100644 --- a/.github/workflows/smoketest-android.yaml +++ b/.github/workflows/smoketest-android.yaml @@ -82,3 +82,11 @@ jobs: run: | ./scripts/run_in_build_env.sh \ "ninja -C out/android-arm64-chip-tool build/chip/java/tests:java_build_test" + - name: Build Android arm64-tv-casting-app + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py --target android-arm64-tv-casting-app build" + - name: Build Android arm64-tv-server + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py --target android-arm64-tv-server build" diff --git a/.github/workflows/smoketest-darwin.yaml b/.github/workflows/smoketest-darwin.yaml new file mode 100644 index 00000000000000..d4b06f4f2d3c89 --- /dev/null +++ b/.github/workflows/smoketest-darwin.yaml @@ -0,0 +1,72 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Smoke Test - Darwin + +on: + push: + pull_request: + merge_group: + workflow_dispatch: + +concurrency: + group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} + cancel-in-progress: true + +jobs: + darwin: + name: Smoke Run - Darwin + timeout-minutes: 60 + + if: github.actor != 'restyled-io[bot]' + runs-on: macos-latest + + steps: + - uses: Wandalen/wretry.action@v1.0.36 + name: Checkout + with: + action: actions/checkout@v3 + with: | + token: ${{ github.token }} + attempt_limit: 3 + attempt_delay: 2000 + - name: Checkout submodules + run: scripts/checkout_submodules.py --shallow --platform darwin + - name: Setup Environment + run: brew install python@3.9 + + - name: Bootstrap cache + uses: actions/cache@v3 + timeout-minutes: 10 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni + - name: Bootstrap + timeout-minutes: 25 + run: scripts/build/gn_bootstrap.sh + - name: Uploading bootstrap logs + uses: actions/upload-artifact@v3 + if: ${{ always() && !env.ACT }} + with: + name: bootstrap-logs + path: | + .environment/gn_out/.ninja_log + .environment/pigweed-venv/*.log + - name: Build Matter TV Casting Bridge + timeout-minutes: 20 + run: | + xcodebuild -target "MatterTvCastingBridge" -sdk iphoneos + working-directory: examples/tv-casting-app/darwin/MatterTvCastingBridge diff --git a/.gitmodules b/.gitmodules index d9f332d45c1e8a..d368b904833686 100644 --- a/.gitmodules +++ b/.gitmodules @@ -58,7 +58,7 @@ path = third_party/freertos/repo url = https://github.com/FreeRTOS/FreeRTOS-Kernel.git branch = V10.3.1-kernel-only - platforms = ameba,cc13x2_26x2,bouffalolab,efr32,esp32,k32w0,infineon,qpg,cc32xx + platforms = ameba,cc13x2_26x2,bouffalolab,efr32,esp32,k32w0,infineon,qpg,cc32xx,silabs_docker [submodule "simw-top-mini"] path = third_party/simw-top-mini/repo url = https://github.com/NXP/plug-and-trust.git @@ -76,7 +76,7 @@ path = third_party/openthread/ot-efr32 url = https://github.com/SiliconLabs/ot-efr32.git branch = matter_sve - platforms = efr32 + platforms = efr32,silabs_docker [submodule "third_party/openthread/ot-ifx"] path = third_party/openthread/ot-ifx url = https://github.com/Infineon/ot-ifx-release.git @@ -238,7 +238,7 @@ path = third_party/silabs/matter_support url = https://github.com/SiliconLabs/sdk_support.git branch = main - platforms = efr32 + platforms = efr32,silabs_docker [submodule "third_party/silabs/gecko_sdk"] path = third_party/silabs/gecko_sdk url = https://github.com/SiliconLabs/gecko_sdk.git @@ -247,8 +247,8 @@ [submodule "third_party/silabs/wiseconnect-wifi-bt-sdk"] path = third_party/silabs/wiseconnect-wifi-bt-sdk url = https://github.com/SiliconLabs/wiseconnect-wifi-bt-sdk.git - branch = master - platforms = efr32 + branch = 2.7.1-Matter + platforms = efr32,silabs_docker [submodule "editline"] path = third_party/editline/repo url = https://github.com/troglobit/editline.git diff --git a/.restyled.yaml b/.restyled.yaml index 8c77704457a15d..33db552694c1f3 100644 --- a/.restyled.yaml +++ b/.restyled.yaml @@ -78,6 +78,7 @@ exclude: - "scripts/run_codegen_targets.sh" # shellharden breaks for loops over command outputs - "src/darwin/Framework/CHIP/zap-generated/*" # already clang-formatted by our zap tooling - "zzz_generated/**/*" # already clang-formatted by our zap tooling + - "src/controller/java/generated/java/**/*" # not formatted: generated files changed_paths: diff --git a/build/chip/chip_codegen.gni b/build/chip/chip_codegen.gni index 49ba661f679e38..88658bcf14eb5c 100644 --- a/build/chip/chip_codegen.gni +++ b/build/chip/chip_codegen.gni @@ -263,7 +263,7 @@ template("_chip_build_time_zapgen") { # The ".matter" file to use to start the code generation # # generator -# Name of the generator to use (e.g. java, cpp-app) +# Name of the generator to use (e.g. java-jni, java-class, cpp-app) # # outputs # Explicit names of the expected outputs. Enforced to validate that @@ -296,7 +296,7 @@ template("_chip_build_time_zapgen") { # # chip_codegen("java-jni-generate") { # input = "controller-clusters.matter" -# generator = "java" +# generator = "java-jni" # # outputs = [ # "jni/IdentifyClient-ReadImpl.cpp", @@ -358,7 +358,7 @@ template("chip_codegen") { # The ".matter" file to use to start the code generation # # generator -# Name of the generator to use (e.g. java, cpp-app) +# Name of the generator to use (e.g. java-jni, java-class, cpp-app) # # outputs # Explicit names of the expected outputs. Enforced to validate that @@ -391,7 +391,7 @@ template("chip_codegen") { # # chip_codegen("java-jni-generate") { # input = "controller-clusters.matter" -# generator = "java" +# generator = "java-jni" # # outputs = [ # "jni/IdentifyClient-ReadImpl.cpp", diff --git a/config/common/cmake/chip_gn.cmake b/config/common/cmake/chip_gn.cmake new file mode 100644 index 00000000000000..bfaa91ab28200b --- /dev/null +++ b/config/common/cmake/chip_gn.cmake @@ -0,0 +1,176 @@ +# +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# +# @file +# CMake file defining to setup and build the Matter library +# and other optional libraries like unit tests. +# Matter headers and libraries are exposed to the application +# as a specific interface target. +# Since Matter doesn't provide native CMake support, ExternalProject +# module is used to build the required artifacts with GN meta-build +# system. +# + +# ============================================================================== +# Validate paths +# ============================================================================== +if (NOT GN_ROOT_TARGET) + message(FATAL_ERROR "GN_ROOT_TARGET not defined. Please provide the path to your Matter GN project.") +endif() + +if (NOT CHIP_ROOT) + get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_LIST_DIR}/../../.. REALPATH) +endif() + +# ============================================================================== +# Find required programs +# ============================================================================== +find_package(Python3 REQUIRED) +find_program(GN_EXECUTABLE gn REQUIRED) + +# Parse the 'gn --version' output to find the installed version. +set(MIN_GN_VERSION 1851) +execute_process( + COMMAND ${GN_EXECUTABLE} --version + OUTPUT_VARIABLE GN_VERSION + COMMAND_ERROR_IS_FATAL ANY +) +if (GN_VERSION VERSION_LESS MIN_GN_VERSION) + message(FATAL_ERROR "Found unsupported version of gn: ${MIN_GN_VERSION}+ is required") +endif() + +# ============================================================================== +# Macros +# ============================================================================== +# Setup and build the Matter library and other optional libraries like unit tests. +# Expose Matter headers & libraries to the application as specific +# interface target. +# [Args]: +# target - interface target name +# Available options are: +# LIB_SHELL Build and add Matter shell library +# LIB_PW_RPC Build and add Matter PW RPC library +# LIB_TESTS Build and add Matter unit tests library +# DEVICE_INFO_EXAMPLE_PROVIDER Add example device info provider support +# +# GN_DEPENDENCIES List of targets that should be built before Matter GN project +macro(matter_build target) + set(options) + set(oneValueArgs + LIB_TESTS + LIB_SHELL + LIB_PW_RPC + DEVICE_INFO_EXAMPLE_PROVIDER + ) + set(multiValueArgs GN_DEPENDENCIES) + + cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + set(MATTER_LIB_DIR ${CMAKE_CURRENT_BINARY_DIR}/lib) + + # Prepare Matter libraries that the application should be linked with + set(MATTER_LIBRARIES -lCHIP) + + if (ARG_LIB_SHELL) + list(APPEND MATTER_LIBRARIES -lCHIPShell) + endif() + + if (ARG_LIB_PW_RPC) + list(APPEND MATTER_LIBRARIES -lPwRpc) + endif() + + if (ARG_DEVICE_INFO_EXAMPLE_PROVIDER) + list(APPEND MATTER_LIBRARIES -lMatterDeviceInfoProviderExample) + endif() + + list(TRANSFORM MATTER_LIBRARIES REPLACE + "-l(.*)" + "${MATTER_LIB_DIR}/lib\\1.a" + ) + + # ============================================================================== + # Define 'chip-gn' target that builds CHIP library(ies) with GN build system + # ============================================================================== + ExternalProject_Add( + chip-gn + PREFIX ${CMAKE_CURRENT_BINARY_DIR} + SOURCE_DIR ${CHIP_ROOT} + BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR} + CONFIGURE_COMMAND "" + CONFIGURE_HANDLED_BY_BUILD TRUE + BUILD_COMMAND ${CMAKE_COMMAND} -E echo "Starting Matter library build in ${CMAKE_CURRENT_BINARY_DIR}" + COMMAND ${Python3_EXECUTABLE} ${CHIP_ROOT}/config/common/cmake/make_gn_args.py @args.tmp > args.gn.tmp + # Replace the config only if it has changed to avoid triggering unnecessary rebuilds + COMMAND bash -c "(! diff -q args.gn.tmp args.gn && mv args.gn.tmp args.gn) || true" + # Regenerate the ninja build system + COMMAND ${GN_EXECUTABLE} + --root=${CHIP_ROOT} + --root-target=${GN_ROOT_TARGET} + --dotfile=${GN_ROOT_TARGET}/.gn + --script-executable=${Python3_EXECUTABLE} + gen --check --fail-on-unused-args ${CMAKE_CURRENT_BINARY_DIR} + COMMAND ninja + COMMAND ${CMAKE_COMMAND} -E echo "Matter library build complete" + INSTALL_COMMAND "" + # Byproducts are removed by the clean target removing config and .ninja_deps + # allows a rebuild of the external project after the clean target has been run. + BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/args.gn + ${CMAKE_CURRENT_BINARY_DIR}/build.ninja + ${CMAKE_CURRENT_BINARY_DIR}/.ninja_deps + ${CMAKE_CURRENT_BINARY_DIR}/build.ninja.stamp + ${MATTER_LIBRARIES} + BUILD_ALWAYS TRUE + USES_TERMINAL_CONFIGURE TRUE + USES_TERMINAL_BUILD TRUE + ) + + if(ARG_GN_DEPENDENCIES) + add_dependencies(chip-gn ${ARG_GN_DEPENDENCIES}) + endif() + + # ============================================================================== + # Define target that exposes Matter headers & libraries to the application + # ============================================================================== + add_library(${target} INTERFACE) + target_compile_definitions(${target} INTERFACE CHIP_HAVE_CONFIG_H) + target_include_directories(${target} INTERFACE + ${CHIP_ROOT}/src + ${CHIP_ROOT}/src/include + ${CHIP_ROOT}/third_party/nlassert/repo/include + ${CHIP_ROOT}/third_party/nlio/repo/include + ${CHIP_ROOT}/zzz_generated/app-common + ${CMAKE_CURRENT_BINARY_DIR}/gen/include + ) + + # ============================================================================== + # Link required libraries + # ============================================================================== + target_link_libraries(${target} INTERFACE -Wl,--start-group ${MATTER_LIBRARIES} -Wl,--end-group) + add_dependencies(${target} chip-gn) + + if (ARG_LIB_SHELL) + target_link_options(${target} INTERFACE -Wl,--whole-archive ${MATTER_LIB_DIR}/libCHIPShell.a -Wl,--no-whole-archive) + endif() + + if (ARG_LIB_TESTS) + target_link_options(${target} INTERFACE -Wl,--whole-archive ${MATTER_LIB_DIR}/libCHIP_tests.a -Wl,--no-whole-archive) + endif() + + if (ARG_DEVICE_INFO_EXAMPLE_PROVIDER) + target_include_directories(${target} INTERFACE ${CHIP_ROOT}/examples/providers) + endif() +endmacro() diff --git a/config/common/cmake/chip_gn_args.cmake b/config/common/cmake/chip_gn_args.cmake new file mode 100644 index 00000000000000..5c52d1f8439eb0 --- /dev/null +++ b/config/common/cmake/chip_gn_args.cmake @@ -0,0 +1,204 @@ +# +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# +# @file +# CMake file that allows collecting C/C++ compiler flags passed to +# the Matter build system. +# + +include(${CMAKE_CURRENT_LIST_DIR}/util.cmake) + +# ============================================================================== +# Configuration variables and define constants +# ============================================================================== + +# C/C++ compiler flags passed to the Matter build system +if (NOT MATTER_CFLAGS) + set(MATTER_CFLAGS PARENT_SCOPE) +endif() + +# C compiler flags passed to the Matter build system +if (NOT MATTER_CFLAGS_C) + set(MATTER_CFLAGS_C PARENT_SCOPE) +endif() + +# C++ compiler flags passed to the Matter build system +if (NOT MATTER_CFLAGS_CC) + set(MATTER_CFLAGS_CC PARENT_SCOPE) +endif() + +# GN meta-build system arguments in the form of 'key1 = value1\nkey2 = value2...' string +if (NOT MATTER_GN_ARGS) + set(MATTER_GN_ARGS PARENT_SCOPE) +endif() + +# ============================================================================== +# Macros +# ============================================================================== +# Add import GN argument +# [Args]: +# file - path to file that should be imported +macro(matter_add_gn_arg_import file) + string(APPEND MATTER_GN_ARGS "--module\n${file}\n") +endmacro() + +# Add string GN argument +# [Args]: +# key - key name +# value - string value +macro(matter_add_gn_arg_string key value) + string(APPEND MATTER_GN_ARGS "--arg-string\n${key}\n${value}\n") +endmacro() + +# Add bool GN argument +# [Args]: +# key - bool variable +macro(matter_add_gn_arg_bool key) + if (${ARGN}) + string(APPEND MATTER_GN_ARGS "--arg\n${key}\ntrue\n") + else() + string(APPEND MATTER_GN_ARGS "--arg\n${key}\nfalse\n") + endif() +endmacro() + +# Add compiler flag GN argument +# [Args]: +# key - key name +# value - compiler flag value +macro(matter_add_gn_arg_cflags key value) + string(APPEND MATTER_GN_ARGS "--arg-cflags\n${key}\n${value}\n") +endmacro() + +# Add simple variable GN argument +# [Args]: +# key - variable name +# value - variable value +macro(matter_add_gn_arg key value) + string(APPEND MATTER_GN_ARGS "--arg\n${key}\n${value}\n") +endmacro() + +# Add items to Matter common compiler flags +# [Args]: +# flags - flags to add +macro(matter_add_flags flags) + list(APPEND MATTER_CFLAGS ${flags}) +endmacro() + +# Add items to Matter C compiler flags +# [Args]: +# flags - flags to add +macro(matter_add_cflags flags) + list(APPEND MATTER_CFLAGS_C ${flags}) +endmacro() + +# Add items to Matter CXX compiler flags +# [Args]: +# flags - flags to add +macro(matter_add_cxxflags flags) + list(APPEND MATTER_CFLAGS_CC ${flags}) +endmacro() + +# Add GNU CPP standard flag to Matter CXX compiler flags +# [Args]: +# std_version - standard version number e.g. 17 for C++17 +macro(matter_add_gnu_cpp_standard std_version) + list(APPEND MATTER_CFLAGS_CC -std=gnu++${std_version}) +endmacro() + +# Get compiler flags from listed targets. +# Collect common compile flags and save them in MATTER_CFLAGS +# Collect C/CXX compile flags and save them in MATTER_CFLAGS_C/MATTER_CFLAGS_CXX +# [Args]: +# targets - list of targets +macro(matter_get_compiler_flags_from_targets targets) + foreach(target ${targets}) + get_target_common_compile_flags(EXTERNAL_TARGET_CFLAGS ${target}) + get_lang_compile_flags(EXTERNAL_TARGET_CFLAGS_C ${target} C) + get_lang_compile_flags(EXTERNAL_TARGET_CFLAGS_CXX ${target} CXX) + list(APPEND MATTER_CFLAGS ${EXTERNAL_TARGET_CFLAGS}) + list(APPEND MATTER_CFLAGS_C ${EXTERNAL_TARGET_CFLAGS_C}) + list(APPEND MATTER_CFLAGS_CC ${EXTERNAL_TARGET_CFLAGS_CXX}) + # Reset between targets + set(EXTERNAL_TARGET_CFLAGS "") + set(EXTERNAL_TARGET_CFLAGS_C "") + set(EXTERNAL_TARGET_CFLAGS_CXX "") + endforeach() +endmacro() + +# Generate the common Matter GN arguments. +# Pass all compilation flags to GN build. +# Available options are: +# DEBUG Debug build +# LIB_SHELL Add Matter shell library +# LIB_PW_RPC Add Matter PW RPC library +# LIB_TESTS Add Matter unit tests library +# DEVICE_INFO_EXAMPLE_PROVIDER Add example device info provider support +# PROJECT_CONFIG Path to the project-specific configuration file +# +macro(matter_common_gn_args) + set(options) + set(oneValueArgs + DEBUG + LIB_TESTS + LIB_SHELL + LIB_PW_RPC + DEVICE_INFO_EXAMPLE_PROVIDER + PROJECT_CONFIG + ) + set(multiValueArgs) + + cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + convert_list_of_flags_to_string_of_flags(MATTER_CFLAGS MATTER_CFLAGS) + convert_list_of_flags_to_string_of_flags(MATTER_CFLAGS_C MATTER_CFLAGS_C) + convert_list_of_flags_to_string_of_flags(MATTER_CFLAGS_CC MATTER_CFLAGS_CC) + + if (MATTER_CFLAGS) + matter_add_gn_arg_cflags ("target_cflags" ${MATTER_CFLAGS}) + endif() # MATTER_CFLAGS + if (MATTER_CFLAGS_C) + matter_add_gn_arg_cflags ("target_cflags_c" ${MATTER_CFLAGS_C}) + endif() # MATTER_CFLAGS_C + if (MATTER_CFLAGS_CC) + matter_add_gn_arg_cflags ("target_cflags_cc" ${MATTER_CFLAGS_CC}) + endif() # MATTER_CFLAGS_CC + + matter_add_gn_arg_bool ("is_debug" ${ARG_DEBUG}) + matter_add_gn_arg_bool ("chip_build_tests" ${ARG_LIB_TESTS}) + matter_add_gn_arg_bool ("chip_build_libshell" ${ARG_LIB_SHELL}) + + if (ARG_LIB_PW_RPC) + matter_add_gn_arg_bool ("chip_build_pw_rpc_lib" ${ARG_LIB_PW_RPC}) + endif() # ARG_LIB_PW_RPC + if (ARG_DEVICE_INFO_EXAMPLE_PROVIDER) + matter_add_gn_arg_bool ("chip_build_example_providers" ${ARG_DEVICE_INFO_EXAMPLE_PROVIDER}) + endif() # ARG_DEVICE_INFO_EXAMPLE_PROVIDER + if (ARG_PROJECT_CONFIG) + get_filename_component(PROJECT_CONFIG + ${ARG_PROJECT_CONFIG} + REALPATH + BASE_DIR ${CMAKE_SOURCE_DIR} + ) + matter_add_gn_arg_string("chip_project_config_include" "<${PROJECT_CONFIG}>") + matter_add_gn_arg_string("chip_system_project_config_include" "<${PROJECT_CONFIG}>") + endif() # CHIP_PROJECT_CONFIG +endmacro() + +# Generate the temporary GN arguments file from the settings +macro(matter_generate_args_tmp_file) + file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/args.tmp" CONTENT ${MATTER_GN_ARGS}) +endmacro() \ No newline at end of file diff --git a/config/openiotsdk/make_gn_args.py b/config/common/cmake/make_gn_args.py similarity index 56% rename from config/openiotsdk/make_gn_args.py rename to config/common/cmake/make_gn_args.py index 074645140deeb0..c6282bc0f8b451 100755 --- a/config/openiotsdk/make_gn_args.py +++ b/config/common/cmake/make_gn_args.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # -# Copyright (c) 2022 Project CHIP Authors +# Copyright (c) 2023 Project CHIP Authors # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,10 +18,9 @@ # import argparse -import re import sys -GN_SPECIAL_CHARACTERS = r'(["$\\])' +GN_SPECIAL_SEPARATOR = "+|+" GN_CFLAG_EXCLUDES = [ '-fno-asynchronous-unwind-tables', '-fno-common', @@ -35,10 +34,6 @@ ] -def escape_strings(gn_args): - return [[key, re.sub(GN_SPECIAL_CHARACTERS, r'\\\1', value)] for key, value in gn_args] - - def write_gn_args(args): if args.module: sys.stdout.write('import("{}")\n'.format(args.module)) @@ -47,20 +42,31 @@ def write_gn_args(args): sys.stdout.write('{} = {}\n'.format(key, value)) for key, value in args.arg_string: - sys.stdout.write('{} = "{}"\n'.format(key, value)) - - for key, value in args.arg_cflags: - # Remove empty include paths - fix generator expressions issue - filtered_value = [x for x in value.split(",") if x != '"-isystem"'] - sys.stdout.write('{} = [{}]\n'.format( - key, ",".join(filtered_value))) + # Escaped quote and dollar sign characters + filtered_value = value.replace('"', '\\"') + filtered_value = filtered_value.replace('$', '\\$') + sys.stdout.write('{} = "{}"\n'.format(key, filtered_value)) cflag_excludes = ', '.join(['"{}"'.format(exclude) for exclude in GN_CFLAG_EXCLUDES]) - for key, value in args.arg_cflags_lang: - sys.stdout.write('{} = filter_exclude(string_split("{}"), [{}])\n'.format( - key, value, cflag_excludes)) + for key, value in args.arg_cflags: + filtered_value = value.split(" -") + # Remove empty include paths and defines caused by Cmake generator expressions + filtered_value = filter(lambda v: v != "D", filtered_value) + filtered_value = filter(lambda v: v != "isystem", filtered_value) + # Escaped quote and dollar sign characters + filtered_value = map(lambda v: v.replace('"', '\\"'), filtered_value) + filtered_value = map(lambda v: v.replace('$', '\\$'), filtered_value) + # Remove white spaces around the argument and remove internal whitespace + # for correct splitting in string_split() function + filtered_value = map(lambda v: v.strip(), filtered_value) + filtered_value = map(lambda v: v.replace(' ', ''), filtered_value) + # Remove duplicates + filtered_value = list(dict.fromkeys(filtered_value)) + + sys.stdout.write('{} = filter_exclude(string_split("{}", "{}"), [{}])\n'.format( + key, "{}-".format(GN_SPECIAL_SEPARATOR).join(filtered_value), GN_SPECIAL_SEPARATOR, cflag_excludes)) def main(): @@ -69,7 +75,6 @@ def main(): parser.add_argument('--arg', action='append', nargs=2, default=[]) parser.add_argument('--arg-string', action='append', nargs=2, default=[]) parser.add_argument('--arg-cflags', action='append', nargs=2, default=[]) - parser.add_argument('--arg-cflags-lang', action='append', nargs=2, default=[]) args = parser.parse_args() write_gn_args(args) diff --git a/config/openiotsdk/util.cmake b/config/common/cmake/util.cmake similarity index 84% rename from config/openiotsdk/util.cmake rename to config/common/cmake/util.cmake index cfa34725f781fa..91988e946fc64b 100644 --- a/config/openiotsdk/util.cmake +++ b/config/common/cmake/util.cmake @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 Project CHIP Authors +# Copyright (c) 2023 Project CHIP Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -19,6 +19,10 @@ # CMake utilities for managing and retrieving build configuration # +# ============================================================================== +# Functions +# ============================================================================== + # Get compilation flags for specific lang # The flags might contains compile language generator expressions that # look like this: @@ -55,39 +59,35 @@ function(get_flags_for_lang lang input output) set(${output} ${tmp_list} PARENT_SCOPE) endfunction() + # Get include directory of target build # Get target property of includes directories # For each flag add -I prefix and put it in quotation marks # [Args]: # target - target name # output - output variable name +# Note: Includes are returned as a generator expression which must be evalued +# at build time. function(get_include_directories target output) get_property(flags TARGET ${target} PROPERTY INTERFACE_INCLUDE_DIRECTORIES) - list(APPEND CFLAG_LIST) - foreach(flag ${flags}) - list(APPEND CFLAG_LIST "\"-isystem${flag}\"") - endforeach() - set(${output} ${CFLAG_LIST} PARENT_SCOPE) + set(${output} "-isystem$, -isystem>" PARENT_SCOPE) endfunction() + # Get compile definitions of target build # Get target property of compile definitions # For each flag change format, add -D prefix and put it in quotation marks # [Args]: # target - target name # output - output variable name +# Note: Definitions are returned as a generator expression which must be evalued +# at build time. function(get_compile_definitions target output) get_property(flags TARGET ${target} PROPERTY INTERFACE_COMPILE_DEFINITIONS) - - list(APPEND CFLAG_LIST) - foreach(flag ${flags}) - # Replace each quote with a '\"' - format required for the GN arguments - string(REPLACE "\"" "\\\\\"" output_flag ${flag}) - list(APPEND CFLAG_LIST "\"-D${output_flag}\"") - endforeach() - set(${output} ${CFLAG_LIST} PARENT_SCOPE) + set(${output} "-D$, -D>" PARENT_SCOPE) endfunction() + # Get compile options of build for specific language # Get property of compile options # [Args]: @@ -111,6 +111,7 @@ function(get_target_common_compile_flags VAR TARGET) set(${VAR} ${INCLUDES} ${DEFINES} ${${VAR}} PARENT_SCOPE) endfunction() + # Retrieve target compiler flags for the specific language (C or CXX) # [Args]: # VAR - flags variable name @@ -121,16 +122,16 @@ function(get_lang_compile_flags VAR TARGET LANG) set(${VAR} ${FLAGS} ${${VAR}} PARENT_SCOPE) endfunction() + # Convert list of flags to string format # [Args]: # ptr_list_of_flags - list fo flags # string_of_flags - output string -# separator - flags separator -function(convert_list_of_flags_to_string_of_flags ptr_list_of_flags string_of_flags separator) +function(convert_list_of_flags_to_string_of_flags ptr_list_of_flags string_of_flags) # Convert the list to a string so we can do string replace # operations on it and replace the ";" list separators with a - # desirable one so the flags are spaced out - string(REPLACE ";" ${separator} locally_scoped_string_of_flags "${${ptr_list_of_flags}}") + # whitespace so the flags are spaced out + string(REPLACE ";" " " locally_scoped_string_of_flags "${${ptr_list_of_flags}}") # Removing excess spaces string(REPLACE " " " " locally_scoped_string_of_flags "${locally_scoped_string_of_flags}") diff --git a/config/mbed/CMakeLists.txt b/config/mbed/CMakeLists.txt index b50f46e0acc2f3..2a0eb84dda52b3 100644 --- a/config/mbed/CMakeLists.txt +++ b/config/mbed/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (c) 2020 Project CHIP Authors +# Copyright (c) 2020-2023 Project CHIP Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,105 +16,29 @@ # # @file -# CMake sub-project defining 'chip' target which represents CHIP library -# and other optional libraries like unit tests, built with 'mbed' -# platform. -# Since CHIP doesn't provide native CMake support, ExternalProject -# module is used to build the required artifacts with GN meta-build -# system. +# CMake sub-project to configure and build the chip library. # include(ExternalProject) -include(mbed-util.cmake) # ============================================================================== -# Declare configuration variables and define constants -# ============================================================================== -# C/C++ compiler flags passed to CHIP build system -list(APPEND CHIP_CFLAGS) - -# C compiler flags passed to CHIP build system -list(APPEND CHIP_CFLAGS_C) - -# C++ compiler flags passed to CHIP build system -list(APPEND CHIP_CFLAGS_CC) - -# CHIP libraries that the application should be linked with -list(APPEND CHIP_LIBRARIES) - -# GN meta-build system arguments in the form of 'key1 = value1\nkey2 = value2...' string -string(APPEND CHIP_GN_ARGS) - -# C/C++ compiler flags which should not be forwarded to CHIP -# build system (e.g. because CHIP configures them on its own) -set(CHIP_CFLAG_EXCLUDES - "-fno-asynchronous-unwind-tables" - "-fno-common" - "-fno-defer-pop" - "-fno-reorder-functions" - "-ffunction-sections" - "-fdata-sections" - "-g*" - "-O*" - "-W*" -) - -# ============================================================================== -# Helper macros +# Prepare CHIP configuration based on the project configuration # ============================================================================== +# Set paths +if (NOT CHIP_ROOT) + get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../.. REALPATH) +endif() +get_filename_component(GN_ROOT_TARGET ${CHIP_ROOT}/config/mbed/chip-gn REALPATH) +get_filename_component(COMMON_CMAKE_SOURCE_DIR ${CHIP_ROOT}/config/common/cmake REALPATH) -macro(chip_gn_arg_import FILE) - string(APPEND CHIP_GN_ARGS "import(\"${FILE}\")\n") -endmacro() - -macro(chip_gn_arg_string ARG STRING) - string(APPEND CHIP_GN_ARGS "${ARG} = \"${STRING}\"\n") -endmacro() +# Get common Cmake sources +include(${COMMON_CMAKE_SOURCE_DIR}/util.cmake) +include(${COMMON_CMAKE_SOURCE_DIR}/chip_gn_args.cmake) +include(${COMMON_CMAKE_SOURCE_DIR}/chip_gn.cmake) -macro(chip_gn_arg_bool ARG BOOLEAN) - if (${BOOLEAN}) - string(APPEND CHIP_GN_ARGS "${ARG} = true\n") - else() - string(APPEND CHIP_GN_ARGS "${ARG} = false\n") - endif() -endmacro() - -macro(chip_gn_arg_flags ARG CFLAGS) - list(SORT CFLAGS) - string(APPEND CHIP_GN_ARGS "${ARG} = [${CFLAGS}]\n") -endmacro() - -macro(chip_gn_arg_lang_flags ARG CFLAGS) - list(SORT CFLAGS) - list(SORT CHIP_CFLAG_EXCLUDES) - set(CFLAG_EXCLUDES "[") - foreach(cflag ${CHIP_CFLAG_EXCLUDES}) - string(APPEND CFLAG_EXCLUDES "\"${cflag}\", ") - endforeach() - string(APPEND CFLAG_EXCLUDES "]") - string(APPEND CHIP_GN_ARGS "${ARG} = filter_exclude(string_split(\"${CFLAGS}\"), ${CFLAG_EXCLUDES})\n") -endmacro() - -macro(mbed_interface_library_named name) - add_library(${name} INTERFACE) -endmacro() - -# Select gnu++ standard based on project configuration -macro(mbed_get_gnu_cpp_standard VAR) - if (CONFIG_STD_CPP11) - list(APPEND ${VAR} -std=gnu++11) - elseif (CONFIG_STD_CPP14) - list(APPEND ${VAR} -std=gnu++14) - elseif (CONFIG_STD_CPP17) - list(APPEND ${VAR} -std=gnu++17) - elseif (CONFIG_STD_CPP2A) - list(APPEND ${VAR} -std=gnu++20) - endif() -endmacro() +# Mbed targets passed to CHIP build +set(CONFIG_CHIP_EXTERNAL_TARGETS) -# ============================================================================== -# Prepare CHIP configuration based on the project configuration -# ============================================================================== # Read configuration file and parse it content to create cmake variable file(STRINGS ${CMAKE_CURRENT_BINARY_DIR}/config ConfigContents) foreach(NameAndValue ${ConfigContents}) @@ -127,202 +51,108 @@ foreach(NameAndValue ${ConfigContents}) # Set the variable set(${Name} "${Value}") endforeach() - if (CONFIG_CHIP_PW_RPC) - set(CONFIG_STD_CPP17 y) -endif() + if (${APP_TARGET} MATCHES "pigweed-app") + set(CONFIG_CHIP_PW_RPC_ECHO_PROTO "y") + elseif (${APP_TARGET} MATCHES "lighting-app") + set(CONFIG_CHIP_PW_RPC_COMMON_PROTO "y") + set(CONFIG_CHIP_PW_RPC_LIGHTING_PROTO "y") + elseif (${APP_TARGET} MATCHES "lock-app") + set(CONFIG_CHIP_PW_RPC_COMMON_PROTO "y") + set(CONFIG_CHIP_PW_RPC_LOCKING_PROTO "y") + endif() +endif(CONFIG_CHIP_PW_RPC) -if (NOT CHIP_ROOT) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../.. REALPATH) +if (${CMAKE_BUILD_TYPE} STREQUAL "Debug") + set(CONFIG_CHIP_DEBUG YES) +else() + set(CONFIG_CHIP_DEBUG NO) endif() -set(GN_ROOT_TARGET ${CHIP_ROOT}/config/mbed/chip-gn) - # Prepare compiler flags +matter_add_cflags(${CMAKE_C_FLAGS_INIT}) +matter_add_cxxflags(${CMAKE_CXX_FLAGS_INIT}) -mbed_get_target_common_compile_flags(CHIP_CFLAGS mbed-core) -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() - -# Add support for Mbed Posix Socket -mbed_get_target_common_compile_flags(CHIP_MBEDPOSIXSOCKET_CFLAGS mbed-os-posix-socket) -list(APPEND CHIP_CFLAGS ${CHIP_MBEDPOSIXSOCKET_CFLAGS}) - -# Add support for Mbed BLE -mbed_get_target_common_compile_flags(CHIP_MBEDBLE_CFLAGS mbed-ble) -list(APPEND CHIP_CFLAGS ${CHIP_MBEDBLE_CFLAGS}) +# Create a list of external targets passed to CHIP build +list(APPEND CONFIG_CHIP_EXTERNAL_TARGETS + mbed-core + mbed-cmsis-cortex-m -# Add support for Mbed event -mbed_get_target_common_compile_flags(CHIP_MBEDEVENTS_CFLAGS mbed-events) -list(APPEND CHIP_CFLAGS ${CHIP_MBEDEVENTS_CFLAGS}) + mbed-rtos + mbed-events -# Add support for Mbed rtos -mbed_get_target_common_compile_flags(CHIP_MBEDRTOS_CFLAGS mbed-rtos) -list(APPEND CHIP_CFLAGS ${CHIP_MBEDRTOS_CFLAGS}) + mbed-os-posix-socket + mbed-netsocket + mbed-ble -# Add support for Mbed storage -mbed_get_target_common_compile_flags(CHIP_MBEDSTORAGE_CFLAGS mbed-storage-kv-global-api) -list(APPEND CHIP_CFLAGS ${CHIP_MBEDSTORAGE_CFLAGS}) + mbed-mbedtls -# Add support for Mbed Socket -mbed_get_target_common_compile_flags(CHIP_MBEDNETSOCKET_CFLAGS mbed-netsocket) -list(APPEND CHIP_CFLAGS ${CHIP_MBEDNETSOCKET_CFLAGS}) - -if (CONFIG_CHIP_WITH_EXTERNAL_MBEDTLS) - mbed_get_target_common_compile_flags(CHIP_MBEDTLS_CFLAGS mbed-mbedtls) - list(APPEND CHIP_CFLAGS ${CHIP_MBEDTLS_CFLAGS}) -endif() - -mbed_get_gnu_cpp_standard(CHIP_CFLAGS_CC) - -list(APPEND CHIP_CFLAGS - \"-D__LINUX_ERRNO_EXTENSIONS__=1\" + mbed-storage-kv-global-api ) -list(APPEND CHIP_CFLAGS - \"-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=\" -) - -if (CONFIG_MBED_BSD_SOCKET_TRACE) - list(APPEND CHIP_CFLAGS - \"-DMBED_BSD_SOCKET_TRACE=1\" +if(MBED_TARGET STREQUAL "CY8CPROTO_062_4343W") + list(APPEND CONFIG_CHIP_EXTERNAL_TARGETS + mbed-cy8cproto-062-4343w + mbed-psoc6 + mbed-cat1a + mbed-cy8cproto-062-4343w-bsp-design-modus ) endif() -# CFLAGS are put in random order, sort them before converting them to a string -list(SORT CHIP_CFLAGS) -list(SORT CHIP_CFLAGS_C) -list(SORT CHIP_CFLAGS_CC) - -set(SEPARATOR ",") -convert_list_of_flags_to_string_of_flags(CHIP_CFLAGS CHIP_CFLAGS ${SEPARATOR}) -set(SEPARATOR " ") -convert_list_of_flags_to_string_of_flags(CHIP_CFLAGS_C CHIP_CFLAGS_C ${SEPARATOR}) -convert_list_of_flags_to_string_of_flags(CHIP_CFLAGS_CC CHIP_CFLAGS_CC ${SEPARATOR}) +# Get compiler flags from external targets +matter_get_compiler_flags_from_targets("${CONFIG_CHIP_EXTERNAL_TARGETS}") -# Prepare CHIP libraries that the application should be linked with - -if (NOT CHIP_LIBRARIES) - set(CHIP_LIBRARIES -lCHIP) -endif() - -if (CONFIG_CHIP_LIB_SHELL) - list(APPEND CHIP_LIBRARIES -lCHIPShell) -endif() +# Additional settings +matter_add_flags(-D__LINUX_ERRNO_EXTENSIONS__=1) +matter_add_flags(-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=) if (CONFIG_CHIP_PW_RPC) - list(APPEND CHIP_LIBRARIES -lPwRpc) - if (${APP_TARGET} MATCHES "pigweed-app") - set(CONFIG_CHIP_PW_RPC_ECHO_PROTO "y") - elseif (${APP_TARGET} MATCHES "lighting-app") - set(CONFIG_CHIP_PW_RPC_COMMON_PROTO "y") - set(CONFIG_CHIP_PW_RPC_LIGHTING_PROTO "y") - elseif (${APP_TARGET} MATCHES "lock-app") - set(CONFIG_CHIP_PW_RPC_COMMON_PROTO "y") - set(CONFIG_CHIP_PW_RPC_LOCKING_PROTO "y") - endif() -endif(CONFIG_CHIP_PW_RPC) - -# Set up CHIP project configuration file - -set(CHIP_DEFAULT_CONFIG_FILE "<${CHIP_ROOT}/config/mbed/CHIPProjectConfig.h>") -set(CHIP_PROJECT_CONFIG ${CHIP_DEFAULT_CONFIG_FILE}) - -if (CONFIG_CHIP_PROJECT_CONFIG) - get_filename_component(CHIP_PROJECT_CONFIG - ${CONFIG_CHIP_PROJECT_CONFIG} - REALPATH - BASE_DIR ${CMAKE_SOURCE_DIR} - ) - set(CHIP_PROJECT_CONFIG "<${CHIP_PROJECT_CONFIG}>") + matter_add_gnu_cpp_standard("17") endif() -if (${CMAKE_BUILD_TYPE} STREQUAL "debug") - set(CONFIG_DEBUG "y") +if (CONFIG_MBED_BSD_SOCKET_TRACE) + matter_add_flags(-DMBED_BSD_SOCKET_TRACE=1) endif() # ============================================================================== # Generate configuration for CHIP GN build system # ============================================================================== +matter_common_gn_args( + DEBUG CONFIG_CHIP_DEBUG + LIB_SHELL CONFIG_CHIP_LIB_SHELL + LIB_TESTS CONFIG_CHIP_BUILD_TESTS + LIB_PW_RPC CONFIG_CHIP_PW_RPC + PROJECT_CONFIG ${CONFIG_CHIP_PROJECT_CONFIG} +) if (CONFIG_CHIP_PW_RPC) - chip_gn_arg_import("${GN_ROOT_TARGET}/lib/pw_rpc/pw_rpc.gni") + matter_add_gn_arg_import("${GN_ROOT_TARGET}/lib/pw_rpc/pw_rpc.gni") endif() - -chip_gn_arg_flags("target_cflags" ${CHIP_CFLAGS}) -chip_gn_arg_lang_flags("target_cflags_c" ${CHIP_CFLAGS_C}) -chip_gn_arg_lang_flags("target_cflags_cc" ${CHIP_CFLAGS_CC}) -chip_gn_arg_string("mbed_ar" ${CMAKE_AR}) -chip_gn_arg_string("mbed_cc" ${CMAKE_C_COMPILER}) -chip_gn_arg_string("mbed_cxx" ${CMAKE_CXX_COMPILER}) -chip_gn_arg_string("chip_project_config_include" "${CHIP_PROJECT_CONFIG}") -chip_gn_arg_bool ("is_debug" CONFIG_DEBUG) -chip_gn_arg_bool ("chip_build_tests" CONFIG_CHIP_BUILD_TESTS) -chip_gn_arg_bool ("chip_monolithic_tests" CONFIG_CHIP_BUILD_TESTS) -chip_gn_arg_bool ("chip_build_libshell" CONFIG_CHIP_LIB_SHELL) -chip_gn_arg_bool ("chip_with_platform_mbedtls" CONFIG_CHIP_WITH_EXTERNAL_MBEDTLS) -chip_gn_arg_bool ("chip_build_pw_rpc_lib" CONFIG_CHIP_PW_RPC) -chip_gn_arg_bool ("chip_enable_data_model" CONFIG_CHIP_DATA_MODEL) +matter_add_gn_arg_string("mbed_ar" ${CMAKE_AR}) +matter_add_gn_arg_string("mbed_cc" ${CMAKE_C_COMPILER}) +matter_add_gn_arg_string("mbed_cxx" ${CMAKE_CXX_COMPILER}) +matter_add_gn_arg_bool ("chip_monolithic_tests" CONFIG_CHIP_BUILD_TESTS) +matter_add_gn_arg_bool ("chip_with_platform_mbedtls" CONFIG_CHIP_WITH_EXTERNAL_MBEDTLS) +matter_add_gn_arg_bool ("chip_enable_data_model" CONFIG_CHIP_DATA_MODEL) if (CONFIG_CHIP_PW_RPC) - chip_gn_arg_bool ("chip_build_pw_rpc_echo_proto" CONFIG_CHIP_PW_RPC_ECHO_PROTO) - chip_gn_arg_bool ("chip_build_pw_rpc_common_proto" CONFIG_CHIP_PW_RPC_COMMON_PROTO) - chip_gn_arg_bool ("chip_build_pw_rpc_lighting_proto" CONFIG_CHIP_PW_RPC_LIGHTING_PROTO) - chip_gn_arg_bool ("chip_build_pw_rpc_locking_proto" CONFIG_CHIP_PW_RPC_LOCKING_PROTO) + matter_add_gn_arg_bool ("chip_build_pw_rpc_echo_proto" CONFIG_CHIP_PW_RPC_ECHO_PROTO) + matter_add_gn_arg_bool ("chip_build_pw_rpc_common_proto" CONFIG_CHIP_PW_RPC_COMMON_PROTO) + matter_add_gn_arg_bool ("chip_build_pw_rpc_lighting_proto" CONFIG_CHIP_PW_RPC_LIGHTING_PROTO) + matter_add_gn_arg_bool ("chip_build_pw_rpc_locking_proto" CONFIG_CHIP_PW_RPC_LOCKING_PROTO) endif(CONFIG_CHIP_PW_RPC) if (CONFIG_CHIP_OTA_REQUESTOR) - chip_gn_arg_bool ("chip_enable_ota_requestor" CONFIG_CHIP_OTA_REQUESTOR) + matter_add_gn_arg_bool ("chip_enable_ota_requestor" CONFIG_CHIP_OTA_REQUESTOR) endif(CONFIG_CHIP_OTA_REQUESTOR) - -file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/args.gn CONTENT ${CHIP_GN_ARGS}) - -# ============================================================================== -# Define 'chip-gn' target that builds CHIP library(ies) with GN build system -# ============================================================================== -ExternalProject_Add( - chip-gn - PREFIX ${CMAKE_CURRENT_BINARY_DIR} - SOURCE_DIR ${CHIP_ROOT} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR} - CONFIGURE_COMMAND gn --root=${GN_ROOT_TARGET} gen --export-compile-commands --check --fail-on-unused-args ${CMAKE_CURRENT_BINARY_DIR} - BUILD_COMMAND ninja - INSTALL_COMMAND "" - BUILD_BYPRODUCTS ${CHIP_LIBRARIES} - CONFIGURE_ALWAYS TRUE - BUILD_ALWAYS TRUE - USES_TERMINAL_CONFIGURE TRUE - USES_TERMINAL_BUILD TRUE -) +matter_generate_args_tmp_file() # ============================================================================== -# Define 'chip' target that exposes CHIP headers & libraries to the application +# Build chip library # ============================================================================== -mbed_interface_library_named(chip) -target_compile_definitions(chip INTERFACE CHIP_HAVE_CONFIG_H) -target_include_directories(chip INTERFACE - ${CHIP_ROOT}/src - ${CHIP_ROOT}/src/include - ${CHIP_ROOT}/src/lib - ${CHIP_ROOT}/third_party/nlassert/repo/include - ${CMAKE_CURRENT_BINARY_DIR}/gen/include +matter_build(chip + LIB_SHELL ${CONFIG_CHIP_LIB_SHELL} + LIB_TESTS ${CONFIG_CHIP_BUILD_TESTS} + LIB_PW_RPC ${CONFIG_CHIP_PW_RPC} ) -target_link_directories(chip INTERFACE ${CMAKE_CURRENT_BINARY_DIR}/lib) -target_link_libraries(chip INTERFACE -Wl,--start-group ${CHIP_LIBRARIES} -Wl,--end-group) -add_dependencies(chip chip-gn) # ============================================================================== # Define mbed target configuration according to CHIP component usage @@ -420,14 +250,14 @@ target_include_directories(${APP_TARGET} PRIVATE ${CHIP_ROOT}/examples/common/pigweed/mbed ${MBED_COMMON}/pw_sys_io/public - ${CMAKE_CURRENT_BINARY_DIR}/protocol_buffer/gen/third_party/connectedhomeip/third_party/pigweed/repo/pw_rpc/protos.proto_library/pwpb - ${CMAKE_CURRENT_BINARY_DIR}/protocol_buffer/gen/third_party/connectedhomeip/third_party/pigweed/repo/pw_protobuf/common_protos.proto_library/nanopb + ${CMAKE_CURRENT_BINARY_DIR}/protocol_buffer/gen/third_party/pigweed/repo/pw_rpc/protos.proto_library/pwpb + ${CMAKE_CURRENT_BINARY_DIR}/protocol_buffer/gen/third_party/pigweed/repo/pw_protobuf/common_protos.proto_library/nanopb ) if (CONFIG_CHIP_PW_RPC_ECHO_PROTO) target_include_directories(${APP_TARGET} PRIVATE - ${CMAKE_CURRENT_BINARY_DIR}/protocol_buffer/gen/third_party/connectedhomeip/third_party/pigweed/repo/pw_rpc/protos.proto_library/nanopb_rpc - ${CMAKE_CURRENT_BINARY_DIR}/protocol_buffer/gen/third_party/connectedhomeip/third_party/pigweed/repo/pw_rpc/protos.proto_library/nanopb + ${CMAKE_CURRENT_BINARY_DIR}/protocol_buffer/gen/third_party/pigweed/repo/pw_rpc/protos.proto_library/nanopb_rpc + ${CMAKE_CURRENT_BINARY_DIR}/protocol_buffer/gen/third_party/pigweed/repo/pw_rpc/protos.proto_library/nanopb ) list(APPEND CHIP_DEFINES CHIP_PW_RPC_ECHO_PROTO=1 @@ -436,11 +266,11 @@ endif(CONFIG_CHIP_PW_RPC_ECHO_PROTO) if (CONFIG_CHIP_PW_RPC_COMMON_PROTO) target_include_directories(${APP_TARGET} PRIVATE - ${CMAKE_CURRENT_BINARY_DIR}/protocol_buffer/gen/third_party/connectedhomeip/examples/common/pigweed/button_service.proto_library/nanopb - ${CMAKE_CURRENT_BINARY_DIR}/protocol_buffer/gen/third_party/connectedhomeip/examples/common/pigweed/button_service.proto_library/nanopb_rpc + ${CMAKE_CURRENT_BINARY_DIR}/protocol_buffer/gen/examples/common/pigweed/button_service.proto_library/nanopb + ${CMAKE_CURRENT_BINARY_DIR}/protocol_buffer/gen/examples/common/pigweed/button_service.proto_library/nanopb_rpc - ${CMAKE_CURRENT_BINARY_DIR}/protocol_buffer/gen/third_party/connectedhomeip/examples/common/pigweed/device_service.proto_library/nanopb - ${CMAKE_CURRENT_BINARY_DIR}/protocol_buffer/gen/third_party/connectedhomeip/examples/common/pigweed/device_service.proto_library/nanopb_rpc + ${CMAKE_CURRENT_BINARY_DIR}/protocol_buffer/gen/examples/common/pigweed/device_service.proto_library/nanopb + ${CMAKE_CURRENT_BINARY_DIR}/protocol_buffer/gen/examples/common/pigweed/device_service.proto_library/nanopb_rpc ) list(APPEND CHIP_DEFINES CHIP_PW_RPC_COMMON_PROTO=1 @@ -449,8 +279,8 @@ endif(CONFIG_CHIP_PW_RPC_COMMON_PROTO) if (CONFIG_CHIP_PW_RPC_LIGHTING_PROTO) target_include_directories(${APP_TARGET} PRIVATE - ${CMAKE_CURRENT_BINARY_DIR}/protocol_buffer/gen/third_party/connectedhomeip/examples/common/pigweed/lighting_service.proto_library/nanopb - ${CMAKE_CURRENT_BINARY_DIR}/protocol_buffer/gen/third_party/connectedhomeip/examples/common/pigweed/lighting_service.proto_library/nanopb_rpc + ${CMAKE_CURRENT_BINARY_DIR}/protocol_buffer/gen/examples/common/pigweed/lighting_service.proto_library/nanopb + ${CMAKE_CURRENT_BINARY_DIR}/protocol_buffer/gen/examples/common/pigweed/lighting_service.proto_library/nanopb_rpc ) list(APPEND CHIP_DEFINES CHIP_PW_RPC_LIGHTING_PROTO=1 @@ -459,8 +289,8 @@ endif(CONFIG_CHIP_PW_RPC_LIGHTING_PROTO) if (CONFIG_CHIP_PW_RPC_LOCKING_PROTO) target_include_directories(${APP_TARGET} PRIVATE - ${CMAKE_CURRENT_BINARY_DIR}/protocol_buffer/gen/third_party/connectedhomeip/examples/common/pigweed/locking_service.proto_library/nanopb - ${CMAKE_CURRENT_BINARY_DIR}/protocol_buffer/gen/third_party/connectedhomeip/examples/common/pigweed/locking_service.proto_library/nanopb_rpc + ${CMAKE_CURRENT_BINARY_DIR}/protocol_buffer/gen/examples/common/pigweed/locking_service.proto_library/nanopb + ${CMAKE_CURRENT_BINARY_DIR}/protocol_buffer/gen/examples/common/pigweed/locking_service.proto_library/nanopb_rpc ) list(APPEND CHIP_DEFINES CHIP_PW_RPC_LOCKING_PROTO=1 diff --git a/config/mbed/chip-gn/.gn b/config/mbed/chip-gn/.gn index 751e7454035e18..47eb417b94b8f7 100644 --- a/config/mbed/chip-gn/.gn +++ b/config/mbed/chip-gn/.gn @@ -13,6 +13,7 @@ # limitations under the License. import("//build_overrides/build.gni") +import("//build_overrides/chip.gni") # The location of the build configuration file. buildconfig = "//build/config/BUILDCONFIG.gn" @@ -24,10 +25,8 @@ default_args = { target_cpu = "arm" target_os = "mbed" - default_configs_warnings = [ - "${build_root}/config/compiler:warnings_default", - "//:chip_custom_cflags_config", - ] + default_configs_warnings = + [ "${build_root}/config/compiler:warnings_default" ] - import("//args.gni") + import("${chip_root}/config/mbed/chip-gn/args.gni") } diff --git a/config/mbed/chip-gn/BUILD.gn b/config/mbed/chip-gn/BUILD.gn index 28f56889a1bf46..76d017b86039e3 100644 --- a/config/mbed/chip-gn/BUILD.gn +++ b/config/mbed/chip-gn/BUILD.gn @@ -20,11 +20,6 @@ assert(current_os == "mbed") declare_args() { chip_build_pw_rpc_lib = false - chip_custom_build_cflags = [] -} - -config("chip_custom_cflags_config") { - cflags = chip_custom_build_cflags } group("mbed") { @@ -35,7 +30,7 @@ group("mbed") { } if (chip_build_pw_rpc_lib) { - deps += [ "//lib/pw_rpc" ] + deps += [ "${chip_root}/config/mbed/chip-gn/lib/pw_rpc" ] } } diff --git a/config/mbed/chip-gn/args.gni b/config/mbed/chip-gn/args.gni index 5fd323b58eefd9..83753bc7ca8012 100644 --- a/config/mbed/chip-gn/args.gni +++ b/config/mbed/chip-gn/args.gni @@ -23,9 +23,7 @@ chip_device_project_config_include = "" chip_inet_config_enable_udp_endpoint = true chip_inet_config_enable_tcp_endpoint = true -chip_custom_build_cflags = [] - -custom_toolchain = "//toolchain:mbed" -mbedtls_target = "//mbedtls:mbedtls" +custom_toolchain = "${chip_root}/config/mbed/chip-gn/toolchain:mbed" +mbedtls_target = "${chip_root}/config/mbed/chip-gn/mbedtls:mbedtls" pw_build_PIP_CONSTRAINTS = [ "${chip_root}/scripts/setup/constraints.txt" ] diff --git a/config/mbed/mbed-util.cmake b/config/mbed/mbed-util.cmake deleted file mode 100644 index adc1a2281dc107..00000000000000 --- a/config/mbed/mbed-util.cmake +++ /dev/null @@ -1,139 +0,0 @@ -# -# Copyright (c) 2020 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# -# @file -# CMake utilities for managing and retrieving mbed build configuration -# - -# Get compilation flags for specific lang -# The flags might contains compile language generator expressions that -# look like this: -# $<$:-fno-exceptions> -# Applying a regex to extract the flag and also to find out if the language matches. -# [Args]: -# input - list of flags to parse -# output - list of flags set to specific language -function(get_flags_for_lang lang input output) - set(tmp_list "") - - list(LENGTH ${input} nb_elem) - set(index 0) - set(is_compile_lang_expression 0) - - while(${index} LESS ${nb_elem}) - list(GET ${input} ${index} value) - if(value MATCHES ":([^>]+)") - string(REGEX REPLACE "^[^:]*:" "" updated_flag ${value}) - list(APPEND tmp_list ${updated_flag}) - if(NOT value MATCHES ">$") - set(is_compile_lang_expression 1) - endif() - elseif(is_compile_lang_expression) - if(value MATCHES ">$") - set(is_compile_lang_expression 0) - endif() - string(REPLACE ">" "" updated_flag ${value}) - list(APPEND tmp_list ${updated_flag}) - endif() - math(EXPR index "${index}+1") - endwhile() - - set(${output} ${tmp_list} PARENT_SCOPE) -endfunction() - -# Get include directory of target build -# Get target property of includes directories -# For each flag add -I prefix and put it in quotation marks -# [Args]: -# target - target name -# output - output variable name -function(mbed_get_include_directories target output) - get_property(flags TARGET ${target} PROPERTY INTERFACE_INCLUDE_DIRECTORIES) - list(APPEND CFLAG_LIST) - foreach(flag ${flags}) - list(APPEND CFLAG_LIST "\"-isystem${flag}\"") - endforeach() - set(${output} ${CFLAG_LIST} PARENT_SCOPE) -endfunction() - -# Get compile definitions of target build -# Get target property of compile definitions -# For each flag change format, add -D prefix and put it in quotation marks -# [Args]: -# target - target name -# output - output variable name -function(mbed_get_compile_definitions target output) - get_property(flags TARGET ${target} PROPERTY INTERFACE_COMPILE_DEFINITIONS) - - list(APPEND CFLAG_LIST) - foreach(flag ${flags}) - # Replace each quote with a '\"' - format required for the GN arguments - string(REPLACE "\"" "\\\\\"" output_flag ${flag}) - list(APPEND CFLAG_LIST "\"-D${output_flag}\"") - endforeach() - set(${output} ${CFLAG_LIST} PARENT_SCOPE) -endfunction() - -# Get compile options of mbed build for specific language -# Get mbed-core property of compile options -# [Args]: -# lang - compilation languge (C, C++ or ASM) -# target - target name -# output - output variable name -function(mbed_get_compile_options_for_lang lang target output) - get_property(flags TARGET ${target} PROPERTY INTERFACE_COMPILE_OPTIONS) - get_flags_for_lang(${lang} flags output_list) - set(${output} ${output_list} PARENT_SCOPE) -endfunction() - - -# Retrieve common compilation flags specific for target -# [Args]: -# VAR - flags variable name -# TARGET - target name -function(mbed_get_target_common_compile_flags VAR TARGET) - mbed_get_include_directories(${TARGET} INCLUDES) - mbed_get_compile_definitions(${TARGET} DEFINES) - set(${VAR} ${INCLUDES} ${DEFINES} ${${VAR}} PARENT_SCOPE) -endfunction() - -# Retrieve target compiler flags for the specific language (C or CXX) -# [Args]: -# VAR - flags variable name -# TARGET - target name -# LANG - compilation languge (C, C++ or ASM) -function(mbed_get_lang_compile_flags VAR TARGET LANG) - mbed_get_compile_options_for_lang(${LANG} ${TARGET} FLAGS) - set(${VAR} ${FLAGS} ${${VAR}} PARENT_SCOPE) -endfunction() - -# Convert list of flags to string format -# [Args]: -# ptr_list_of_flags - list fo flags -# string_of_flags - output string -# separator - flags separator -function(convert_list_of_flags_to_string_of_flags ptr_list_of_flags string_of_flags separator) - # Convert the list to a string so we can do string replace - # operations on it and replace the ";" list separators with a - # desirable one so the flags are spaced out - string(REPLACE ";" ${separator} locally_scoped_string_of_flags "${${ptr_list_of_flags}}") - # Removing excess spaces - string(REPLACE " " " " locally_scoped_string_of_flags "${locally_scoped_string_of_flags}") - - # Set the output variable in the parent scope - set(${string_of_flags} ${locally_scoped_string_of_flags} PARENT_SCOPE) -endfunction() diff --git a/config/nrfconnect/chip-module/CMakeLists.txt b/config/nrfconnect/chip-module/CMakeLists.txt index 4ef9feb7de4c26..2511fa3094cff6 100644 --- a/config/nrfconnect/chip-module/CMakeLists.txt +++ b/config/nrfconnect/chip-module/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (c) 2020 Project CHIP Authors +# Copyright (c) 2020-2023 Project CHIP Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -32,79 +32,37 @@ include(../../zephyr/ota-image.cmake) include(../../zephyr/zephyr-util.cmake) include(generate_factory_data.cmake) -# ============================================================================== -# Declare configuration variables and define constants -# ============================================================================== - -# C/C++ compiler flags passed to CHIP build system -list(APPEND CHIP_CFLAGS) - -# C compiler flags passed to CHIP build system -list(APPEND CHIP_CFLAGS_C) - -# C++ compiler flags passed to CHIP build system -list(APPEND CHIP_CFLAGS_CC) - -# CHIP libraries that the application should be linked with -list(APPEND CHIP_LIBRARIES) - -# GN meta-build system arguments passed to the make_gn_args.py script -string(APPEND CHIP_GN_ARGS) - -# ============================================================================== -# Helper macros -# ============================================================================== - -macro(chip_gn_arg_import FILE) - string(APPEND CHIP_GN_ARGS "--module\n${FILE}\n") -endmacro() - -macro(chip_gn_arg_string ARG STRING) - string(APPEND CHIP_GN_ARGS "--arg-string\n${ARG}\n${STRING}\n") -endmacro() - -macro(chip_gn_arg_bool ARG) - if (${ARGN}) - string(APPEND CHIP_GN_ARGS "--arg\n${ARG}\ntrue\n") - else() - string(APPEND CHIP_GN_ARGS "--arg\n${ARG}\nfalse\n") - endif() -endmacro() - -macro(chip_gn_arg_cflags ARG CFLAGS) - string(APPEND CHIP_GN_ARGS "--arg-cflags\n${ARG}\n${CFLAGS}\n") -endmacro() - -macro(chip_gn_arg ARG VALUE) - string(APPEND CHIP_GN_ARGS "--arg\n${ARG}\n${VALUE}\n") -endmacro() - # ============================================================================== # Prepare CHIP configuration based on the project Kconfig configuration # ============================================================================== +# Set paths + if (NOT CHIP_ROOT) get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../.. REALPATH) endif() +get_filename_component(GN_ROOT_TARGET ${CHIP_ROOT}/config/nrfconnect/chip-gn REALPATH) +get_filename_component(COMMON_CMAKE_SOURCE_DIR ${CHIP_ROOT}/config/common/cmake REALPATH) -set(CHIP_LIB_DIR ${CMAKE_CURRENT_BINARY_DIR}/lib) -set(CHIP_GN_ROOT_TARGET ${CHIP_ROOT}/config/nrfconnect/chip-gn) +# Get common Cmake sources + +include(${COMMON_CMAKE_SOURCE_DIR}/chip_gn_args.cmake) +include(${COMMON_CMAKE_SOURCE_DIR}/chip_gn.cmake) # Prepare compiler flags +matter_add_flags(-D_DEFAULT_SOURCE) -list(APPEND CHIP_CFLAGS -D_DEFAULT_SOURCE) +if (CHIP_CFLAGS) + matter_add_flags("${CHIP_CFLAGS}") +endif() if (CONFIG_ARM) - list(APPEND CHIP_CFLAGS_C - --specs=nosys.specs - ) + matter_add_cflags(--specs=nosys.specs) endif() if (CONFIG_POSIX_API) - list(APPEND CHIP_CFLAGS - -D_SYS__PTHREADTYPES_H_ - -isystem${ZEPHYR_BASE}/include/zephyr/posix - ) + matter_add_flags(-D_SYS__PTHREADTYPES_H_) + matter_add_flags(-isystem${ZEPHYR_BASE}/include/zephyr/posix) endif() if (CONFIG_NORDIC_SECURITY_BACKEND) @@ -113,7 +71,7 @@ if (CONFIG_NORDIC_SECURITY_BACKEND) if(TARGET platform_cc3xx) zephyr_include_directories($) endif() - list(APPEND CHIP_CFLAGS -DMBEDTLS_CONFIG_FILE=) + matter_add_flags(-DMBEDTLS_CONFIG_FILE=) elseif(CONFIG_MBEDTLS) zephyr_include_directories($) zephyr_compile_definitions($) @@ -123,41 +81,12 @@ if (CONFIG_NRF_802154_RADIO_DRIVER) zephyr_include_directories($) endif() -zephyr_get_compile_flags(CHIP_CFLAGS_C C) -zephyr_get_compile_flags(CHIP_CFLAGS_CC CXX) -zephyr_get_gnu_cpp_standard(CHIP_CFLAGS_CC) - -convert_list_of_flags_to_string_of_flags(CHIP_CFLAGS CHIP_CFLAGS) -convert_list_of_flags_to_string_of_flags(CHIP_CFLAGS_C CHIP_CFLAGS_C) -convert_list_of_flags_to_string_of_flags(CHIP_CFLAGS_CC CHIP_CFLAGS_CC) - -# Prepare CHIP libraries that the application should be linked with - -if (NOT CHIP_LIBRARIES) - set(CHIP_LIBRARIES -lCHIP) -endif() - -if (CONFIG_CHIP_EXAMPLE_DEVICE_INFO_PROVIDER) - list(APPEND CHIP_LIBRARIES -lMatterDeviceInfoProviderExample) -endif() - -list(TRANSFORM CHIP_LIBRARIES REPLACE - "-l(.*)" - "${CHIP_LIB_DIR}/lib\\1.a" -) - -# Set up CHIP project configuration file - -if (CONFIG_CHIP_PROJECT_CONFIG) - get_filename_component(CHIP_PROJECT_CONFIG - ${CONFIG_CHIP_PROJECT_CONFIG} - REALPATH - BASE_DIR ${CMAKE_SOURCE_DIR} - ) - set(CHIP_PROJECT_CONFIG "<${CHIP_PROJECT_CONFIG}>") -else() - set(CHIP_PROJECT_CONFIG "") -endif() +zephyr_get_compile_flags(ZEPHYR_CFLAGS_C C) +matter_add_cflags("${ZEPHYR_CFLAGS_C}") +zephyr_get_compile_flags(ZEPHYR_CFLAGS_CC CXX) +matter_add_cxxflags("${ZEPHYR_CFLAGS_CC}") +zephyr_get_gnu_cpp_standard(ZEPHYR_GNU_CPP_STD) +matter_add_cxxflags(${ZEPHYR_GNU_CPP_STD}) # Set up custom OpenThread configuration @@ -180,162 +109,96 @@ endif() get_property(CHIP_COMPILER_LAUNCHER GLOBAL PROPERTY RULE_LAUNCH_COMPILE) -# Find required programs - -find_package(Python3 REQUIRED) -find_program(GN_EXECUTABLE gn REQUIRED) - -# Parse the 'gn --version' output to find the installed version. - -set(MIN_GN_VERSION 1851) -execute_process( - COMMAND ${GN_EXECUTABLE} --version - OUTPUT_VARIABLE GN_VERSION - COMMAND_ERROR_IS_FATAL ANY -) -if (GN_VERSION VERSION_LESS MIN_GN_VERSION) - message(FATAL_ERROR "Found unsupported version of gn: ${MIN_GN_VERSION}+ is required") -endif() - # ============================================================================== # Generate configuration for CHIP GN build system # ============================================================================== -chip_gn_arg_cflags("target_cflags" ${CHIP_CFLAGS}) -chip_gn_arg_cflags("target_cflags_c" ${CHIP_CFLAGS_C}) -chip_gn_arg_cflags("target_cflags_cc" ${CHIP_CFLAGS_CC}) -chip_gn_arg_string("zephyr_ar" ${CMAKE_AR}) -chip_gn_arg_string("zephyr_cc" ${CMAKE_C_COMPILER}) -chip_gn_arg_string("zephyr_cxx" ${CMAKE_CXX_COMPILER}) -chip_gn_arg_bool ("is_debug" CONFIG_DEBUG) -chip_gn_arg_bool ("chip_logging" CONFIG_LOG) -chip_gn_arg_bool ("chip_enable_openthread" CONFIG_NET_L2_OPENTHREAD) -chip_gn_arg_bool ("chip_openthread_ftd" CONFIG_OPENTHREAD_FTD) -chip_gn_arg_bool ("chip_config_network_layer_ble" CONFIG_BT) -chip_gn_arg_bool ("chip_inet_config_enable_ipv4" CONFIG_NET_IPV4) -chip_gn_arg_bool ("chip_enable_nfc" CONFIG_CHIP_NFC_COMMISSIONING) -chip_gn_arg_bool ("chip_enable_ota_requestor" CONFIG_CHIP_OTA_REQUESTOR) -chip_gn_arg_bool ("chip_persist_subscriptions" CONFIG_CHIP_PERSISTENT_SUBSCRIPTIONS) -chip_gn_arg_bool ("chip_build_tests" CONFIG_CHIP_BUILD_TESTS) -chip_gn_arg_bool ("chip_monolithic_tests" CONFIG_CHIP_BUILD_TESTS) -chip_gn_arg_bool ("chip_inet_config_enable_tcp_endpoint" CONFIG_CHIP_BUILD_TESTS) -chip_gn_arg_bool ("chip_build_libshell" CONFIG_CHIP_LIB_SHELL) -chip_gn_arg_bool ("chip_error_logging" CONFIG_MATTER_LOG_LEVEL GREATER_EQUAL 1) -chip_gn_arg_bool ("chip_progress_logging" CONFIG_MATTER_LOG_LEVEL GREATER_EQUAL 3) -chip_gn_arg_bool ("chip_detail_logging" CONFIG_MATTER_LOG_LEVEL GREATER_EQUAL 4) -chip_gn_arg_bool ("chip_automation_logging" FALSE) -chip_gn_arg_bool ("chip_malloc_sys_heap" CONFIG_CHIP_MALLOC_SYS_HEAP) -chip_gn_arg_bool ("chip_enable_wifi" CONFIG_WIFI_NRF700X) +matter_common_gn_args( + DEBUG CONFIG_DEBUG + LIB_SHELL CONFIG_CHIP_LIB_SHELL + LIB_TESTS CONFIG_CHIP_BUILD_TESTS + PROJECT_CONFIG ${CONFIG_CHIP_PROJECT_CONFIG} + DEVICE_INFO_EXAMPLE_PROVIDER CONFIG_CHIP_EXAMPLE_DEVICE_INFO_PROVIDER +) +matter_add_gn_arg_string("zephyr_ar" ${CMAKE_AR}) +matter_add_gn_arg_string("zephyr_cc" ${CMAKE_C_COMPILER}) +matter_add_gn_arg_string("zephyr_cxx" ${CMAKE_CXX_COMPILER}) +matter_add_gn_arg_bool ("chip_logging" CONFIG_LOG) +matter_add_gn_arg_bool ("chip_enable_openthread" CONFIG_NET_L2_OPENTHREAD) +matter_add_gn_arg_bool ("chip_openthread_ftd" CONFIG_OPENTHREAD_FTD) +matter_add_gn_arg_bool ("chip_config_network_layer_ble" CONFIG_BT) +matter_add_gn_arg_bool ("chip_inet_config_enable_ipv4" CONFIG_NET_IPV4) +matter_add_gn_arg_bool ("chip_enable_nfc" CONFIG_CHIP_NFC_COMMISSIONING) +matter_add_gn_arg_bool ("chip_enable_ota_requestor" CONFIG_CHIP_OTA_REQUESTOR) +matter_add_gn_arg_bool ("chip_persist_subscriptions" CONFIG_CHIP_PERSISTENT_SUBSCRIPTIONS) +matter_add_gn_arg_bool ("chip_monolithic_tests" CONFIG_CHIP_BUILD_TESTS) +matter_add_gn_arg_bool ("chip_inet_config_enable_tcp_endpoint" CONFIG_CHIP_BUILD_TESTS) +matter_add_gn_arg_bool ("chip_error_logging" CONFIG_MATTER_LOG_LEVEL GREATER_EQUAL 1) +matter_add_gn_arg_bool ("chip_progress_logging" CONFIG_MATTER_LOG_LEVEL GREATER_EQUAL 3) +matter_add_gn_arg_bool ("chip_detail_logging" CONFIG_MATTER_LOG_LEVEL GREATER_EQUAL 4) +matter_add_gn_arg_bool ("chip_automation_logging" FALSE) +matter_add_gn_arg_bool ("chip_malloc_sys_heap" CONFIG_CHIP_MALLOC_SYS_HEAP) +matter_add_gn_arg_bool ("chip_enable_wifi" CONFIG_WIFI_NRF700X) if (CONFIG_CHIP_FACTORY_DATA) - chip_gn_arg_bool("chip_use_transitional_commissionable_data_provider" FALSE) - chip_gn_arg_bool("chip_enable_factory_data" TRUE) + matter_add_gn_arg_bool("chip_use_transitional_commissionable_data_provider" FALSE) + matter_add_gn_arg_bool("chip_enable_factory_data" TRUE) elseif (CONFIG_CHIP_FACTORY_DATA_CUSTOM_BACKEND) - chip_gn_arg_bool("chip_use_transitional_commissionable_data_provider" FALSE) + matter_add_gn_arg_bool("chip_use_transitional_commissionable_data_provider" FALSE) endif() if (CONFIG_CHIP_ROTATING_DEVICE_ID) - chip_gn_arg_bool("chip_enable_rotating_device_id" TRUE) - chip_gn_arg_bool("chip_enable_additional_data_advertising" TRUE) + matter_add_gn_arg_bool("chip_enable_rotating_device_id" TRUE) + matter_add_gn_arg_bool("chip_enable_additional_data_advertising" TRUE) endif() if (CONFIG_NET_L2_OPENTHREAD) - chip_gn_arg_string("chip_mdns" "platform") + matter_add_gn_arg_string("chip_mdns" "platform") elseif(CONFIG_WIFI_NRF700X) - chip_gn_arg_string("chip_mdns" "minimal") + matter_add_gn_arg_string("chip_mdns" "minimal") else() - chip_gn_arg_string("chip_mdns" "none") + matter_add_gn_arg_string("chip_mdns" "none") endif() if (CONFIG_CHIP_CRYPTO_PSA) - chip_gn_arg_string("chip_crypto" "psa") -endif() - -if (CHIP_PROJECT_CONFIG) - chip_gn_arg_string("chip_project_config_include" ${CHIP_PROJECT_CONFIG}) - chip_gn_arg_string("chip_system_project_config_include" ${CHIP_PROJECT_CONFIG}) + matter_add_gn_arg_string("chip_crypto" "psa") endif() if (BOARD STREQUAL "native_posix") - chip_gn_arg_string("target_cpu" "x86") + matter_add_gn_arg_string("target_cpu" "x86") elseif (BOARD STREQUAL "native_posix_64") - chip_gn_arg_string("target_cpu" "x64") + matter_add_gn_arg_string("target_cpu" "x64") endif() if (NOT CONFIG_CHIP_DEBUG_SYMBOLS) - chip_gn_arg_string("symbol_level" "0") + matter_add_gn_arg_string("symbol_level" "0") endif() if (CHIP_COMPILER_LAUNCHER) - chip_gn_arg_string("pw_command_launcher" ${CHIP_COMPILER_LAUNCHER}) + matter_add_gn_arg_string("pw_command_launcher" ${CHIP_COMPILER_LAUNCHER}) endif() if (CONFIG_CHIP_PW_RPC) set(PIGWEED_DIR "//third_party/pigweed/repo") - chip_gn_arg_string("pw_assert_BACKEND" ${PIGWEED_DIR}/pw_assert_log:check_backend) - chip_gn_arg_string("pw_log_BACKEND" ${PIGWEED_DIR}/pw_log_basic) - chip_gn_arg("pw_build_LINK_DEPS" [\"${PIGWEED_DIR}/pw_assert:impl\",\ \"${PIGWEED_DIR}/pw_log:impl\"]) + matter_add_gn_arg_string("pw_assert_BACKEND" ${PIGWEED_DIR}/pw_assert_log:check_backend) + matter_add_gn_arg_string("pw_log_BACKEND" ${PIGWEED_DIR}/pw_log_basic) + matter_add_gn_arg("pw_build_LINK_DEPS" [\"${PIGWEED_DIR}/pw_assert:impl\",\ \"${PIGWEED_DIR}/pw_log:impl\"]) endif() -if (CONFIG_CHIP_EXAMPLE_DEVICE_INFO_PROVIDER) - chip_gn_arg_bool("chip_build_example_providers" TRUE) -endif() - -file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/args.tmp" CONTENT ${CHIP_GN_ARGS}) - -# ============================================================================== -# Define 'chip-gn' target that builds CHIP library(ies) with GN build system -# ============================================================================== -ExternalProject_Add( - chip-gn - PREFIX ${CMAKE_CURRENT_BINARY_DIR} - SOURCE_DIR ${CHIP_ROOT} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR} - CONFIGURE_COMMAND "" - BUILD_COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/make_gn_args.py - @args.tmp > args.gn && - ${GN_EXECUTABLE} - --root=${CHIP_ROOT} - --root-target=${CHIP_GN_ROOT_TARGET} - --dotfile=${CHIP_GN_ROOT_TARGET}/.gn - --script-executable=${Python3_EXECUTABLE} - --export-compile-commands - gen --check --fail-on-unused-args . && - ninja - INSTALL_COMMAND "" - BUILD_BYPRODUCTS ${CHIP_LIBRARIES} - BUILD_ALWAYS TRUE - USES_TERMINAL_BUILD TRUE -) -add_dependencies(chip-gn kernel) +matter_generate_args_tmp_file() # ============================================================================== -# Define 'chip' target that exposes CHIP headers & libraries to the application +# Build chip library # ============================================================================== -zephyr_interface_library_named(chip) -target_compile_definitions(chip INTERFACE CHIP_HAVE_CONFIG_H) -target_compile_definitions(chip INTERFACE _DEFAULT_SOURCE) -target_include_directories(chip INTERFACE - ${CHIP_ROOT}/src - ${CHIP_ROOT}/src/include - ${CHIP_ROOT}/third_party/nlassert/repo/include - ${CHIP_ROOT}/third_party/nlio/repo/include - ${CHIP_ROOT}/zzz_generated/app-common - ${CMAKE_CURRENT_BINARY_DIR}/gen/include +matter_build(chip + LIB_SHELL ${CONFIG_CHIP_LIB_SHELL} + LIB_TESTS ${CONFIG_CHIP_BUILD_TESTS} + DEVICE_INFO_EXAMPLE_PROVIDER ${CONFIG_CHIP_EXAMPLE_DEVICE_INFO_PROVIDER} + GN_DEPENDENCIES kernel ) - -if (CONFIG_CHIP_EXAMPLE_DEVICE_INFO_PROVIDER) - target_include_directories(chip INTERFACE ${CHIP_ROOT}/examples/providers) -endif() - -if (CONFIG_CHIP_LIB_SHELL) - target_link_options(chip INTERFACE -Wl,--whole-archive ${CHIP_LIB_DIR}/libCHIPShell.a -Wl,--no-whole-archive) -endif() - -if (CONFIG_CHIP_BUILD_TESTS) - target_link_options(chip INTERFACE -Wl,--whole-archive ${CHIP_LIB_DIR}/libCHIP_tests.a -Wl,--no-whole-archive) -endif() +set_property(GLOBAL APPEND PROPERTY ZEPHYR_INTERFACE_LIBS chip) +target_compile_definitions(chip INTERFACE _DEFAULT_SOURCE) if (CONFIG_CHIP_MALLOC_SYS_HEAP_OVERRIDE) target_link_options(chip INTERFACE @@ -350,10 +213,6 @@ if (CONFIG_CHIP_MALLOC_SYS_HEAP_OVERRIDE) ) endif() -target_link_libraries(chip INTERFACE -Wl,--start-group ${CHIP_LIBRARIES} -Wl,--end-group) - -add_dependencies(chip chip-gn) - # ============================================================================== # Define 'chip-ota-image' target for building CHIP OTA image # ============================================================================== diff --git a/config/nrfconnect/chip-module/generate_factory_data.cmake b/config/nrfconnect/chip-module/generate_factory_data.cmake index be0c4c0fac692c..b1df43fa59cfce 100644 --- a/config/nrfconnect/chip-module/generate_factory_data.cmake +++ b/config/nrfconnect/chip-module/generate_factory_data.cmake @@ -60,15 +60,19 @@ endif() # for development purpose user can use default certs instead of generating or providing them if(CONFIG_CHIP_FACTORY_DATA_USE_DEFAULT_CERTS) + # convert decimal VID to its hexadecimal representation to find out certification files in repository + math(EXPR LOCAL_VID "${CONFIG_CHIP_DEVICE_VENDOR_ID}" OUTPUT_FORMAT HEXADECIMAL) + string(SUBSTRING ${LOCAL_VID} 2 -1 raw_vid) + string(TOUPPER ${raw_vid} raw_vid_upper) # convert decimal PID to its hexadecimal representation to find out certification files in repository math(EXPR LOCAL_PID "${CONFIG_CHIP_DEVICE_PRODUCT_ID}" OUTPUT_FORMAT HEXADECIMAL) string(SUBSTRING ${LOCAL_PID} 2 -1 raw_pid) string(TOUPPER ${raw_pid} raw_pid_upper) # all certs are located in ${CHIP_ROOT}/credentials/development/attestation # it can be used during development without need to generate new certifications - string(APPEND script_args "--dac_cert \"${CHIP_ROOT}/credentials/development/attestation/Matter-Development-DAC-${raw_pid_upper}-Cert.der\"\n") - string(APPEND script_args "--dac_key \"${CHIP_ROOT}/credentials/development/attestation/Matter-Development-DAC-${raw_pid_upper}-Key.der\"\n") - string(APPEND script_args "--pai_cert \"${CHIP_ROOT}/credentials/development/attestation/Matter-Development-PAI-noPID-Cert.der\"\n") + string(APPEND script_args "--dac_cert \"${CHIP_ROOT}/credentials/development/attestation/Matter-Development-DAC-${raw_vid_upper}-${raw_pid_upper}-Cert.der\"\n") + string(APPEND script_args "--dac_key \"${CHIP_ROOT}/credentials/development/attestation/Matter-Development-DAC-${raw_vid_upper}-${raw_pid_upper}-Key.der\"\n") + string(APPEND script_args "--pai_cert \"${CHIP_ROOT}/credentials/development/attestation/Matter-Development-PAI-${raw_vid_upper}-noPID-Cert.der\"\n") elseif(CONFIG_CHIP_FACTORY_DATA_CERT_SOURCE_USER) string(APPEND script_args "--dac_cert \"${CONFIG_CHIP_FACTORY_DATA_USER_CERTS_DAC_CERT}\"\n") string(APPEND script_args "--dac_key \"${CONFIG_CHIP_FACTORY_DATA_USER_CERTS_DAC_KEY}\"\n") @@ -88,12 +92,7 @@ string(APPEND script_args "--include_passcode\n") string(APPEND script_args "--overwrite\n") # check if spake2 verifier should be generated using script -if(CONFIG_CHIP_FACTORY_DATA_GENERATE_SPAKE2_VERIFIER) - # request script to generate a new spake2_verifier - # by adding an argument to script_args - find_program(spake_exe NAMES spake2p REQUIRED) - string(APPEND script_args "--spake2p_path ${spake_exe}\n") -else() +if(NOT CONFIG_CHIP_FACTORY_DATA_GENERATE_SPAKE2_VERIFIER) # Spake2 verifier should be provided using kConfig string(APPEND script_args "--spake2_verifier \"${CONFIG_CHIP_DEVICE_SPAKE2_TEST_VERIFIER}\"\n") endif() diff --git a/config/nrfconnect/chip-module/make_gn_args.py b/config/nrfconnect/chip-module/make_gn_args.py deleted file mode 100755 index 3c3f611c00b437..00000000000000 --- a/config/nrfconnect/chip-module/make_gn_args.py +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/env python3 - -# -# Copyright (c) 2021 Project CHIP Authors -# All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -import argparse -import re -import sys - -GN_SPECIAL_CHARACTERS = r'(["$\\])' -GN_CFLAG_EXCLUDES = [ - '-fno-asynchronous-unwind-tables', - '-fno-common', - '-fno-defer-pop', - '-fno-reorder-functions', - '-ffunction-sections', - '-fdata-sections', - '-g', - '-g0', - '-g1', - '-g2', - '-g3', - '-O*', - '-W*', -] - - -def escape_strings(gn_args): - return [[key, re.sub(GN_SPECIAL_CHARACTERS, r'\\\1', value)] for key, value in gn_args] - - -def write_gn_args(args): - if args.module: - sys.stdout.write('import("{}")\n'.format(args.module)) - - for key, value in args.arg: - sys.stdout.write('{} = {}\n'.format(key, value)) - - for key, value in args.arg_string: - sys.stdout.write('{} = "{}"\n'.format(key, value)) - - cflag_excludes = ', '.join(['"{}"'.format(exclude) - for exclude in GN_CFLAG_EXCLUDES]) - - for key, value in args.arg_cflags: - sys.stdout.write('{} = filter_exclude(string_split("{}"), [{}])\n'.format( - key, value, cflag_excludes)) - - -def main(): - parser = argparse.ArgumentParser(fromfile_prefix_chars='@') - parser.add_argument('--module', action='store') - parser.add_argument('--arg', action='append', nargs=2, default=[]) - parser.add_argument('--arg-string', action='append', nargs=2, default=[]) - parser.add_argument('--arg-cflags', action='append', nargs=2, default=[]) - args = parser.parse_args() - args.arg_string = escape_strings(args.arg_string) - args.arg_cflags = escape_strings(args.arg_cflags) - write_gn_args(args) - - -if __name__ == "__main__": - main() diff --git a/config/openiotsdk/CMakeLists.txt b/config/openiotsdk/CMakeLists.txt index 1e7a77a0f21615..7f559587a88a66 100644 --- a/config/openiotsdk/CMakeLists.txt +++ b/config/openiotsdk/CMakeLists.txt @@ -16,75 +16,10 @@ # # @file -# CMake sub-project defining 'chip' target which represents CHIP library -# and other optional libraries like unit tests, built with 'open-iot-sdk' -# platform. -# Since CHIP doesn't provide native CMake support, ExternalProject -# module is used to build the required artifacts with GN meta-build -# system. +# CMake sub-project to configure and build the chip library. # include(ExternalProject) -include(util.cmake) - -# ============================================================================== -# Declare configuration variables and define constants -# ============================================================================== -# C/C++ compiler flags passed to CHIP build system -list(APPEND CHIP_CFLAGS \"-Wno-unused-function\") - -# C compiler flags passed to CHIP build system -list(APPEND CHIP_CFLAGS_C ${CMAKE_C_FLAGS}) - -# C++ compiler flags passed to CHIP build system -list(APPEND CHIP_CFLAGS_CC ${CMAKE_CXX_FLAGS}) - -# GN meta-build system arguments in the form of 'key1 = value1\nkey2 = value2...' string -string(APPEND CHIP_GN_ARGS) - -# ============================================================================== -# Helper macros -# ============================================================================== -macro(chip_gn_arg_import FILE) - string(APPEND CHIP_GN_ARGS "--module\n${FILE}\n") -endmacro() - -macro(chip_gn_arg_string ARG STRING) - string(APPEND CHIP_GN_ARGS "--arg-string\n${ARG}\n${STRING}\n") -endmacro() - -macro(chip_gn_arg_bool ARG) - if (${ARGN}) - string(APPEND CHIP_GN_ARGS "--arg\n${ARG}\ntrue\n") - else() - string(APPEND CHIP_GN_ARGS "--arg\n${ARG}\nfalse\n") - endif() -endmacro() - -macro(chip_gn_arg_cflags ARG CFLAGS) - string(APPEND CHIP_GN_ARGS "--arg-cflags\n${ARG}\n${CFLAGS}\n") -endmacro() - -macro(chip_gn_arg_cflags_lang ARG CFLAGS) - string(APPEND CHIP_GN_ARGS "--arg-cflags-lang\n${ARG}\n${CFLAGS}\n") -endmacro() - -macro(chip_gn_arg ARG VALUE) - string(APPEND CHIP_GN_ARGS "--arg\n${ARG}\n${VALUE}\n") -endmacro() - -# Select gnu++ standard based on project configuration -macro(get_gnu_cpp_standard VAR) - if (CONFIG_STD_CPP11) - list(APPEND ${VAR} -std=gnu++11) - elseif (CONFIG_STD_CPP14) - list(APPEND ${VAR} -std=gnu++14) - elseif (CONFIG_STD_CPP17) - list(APPEND ${VAR} -std=gnu++17) - elseif (CONFIG_STD_CPP2A) - list(APPEND ${VAR} -std=gnu++20) - endif() -endmacro() # ============================================================================== # Prepare CHIP configuration based on the project configuration @@ -93,160 +28,55 @@ endmacro() if (NOT CHIP_ROOT) get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../.. REALPATH) endif() +get_filename_component(GN_ROOT_TARGET ${CHIP_ROOT}/config/openiotsdk/chip-gn REALPATH) +get_filename_component(COMMON_CMAKE_SOURCE_DIR ${CHIP_ROOT}/config/common/cmake REALPATH) -set(GN_ROOT_TARGET ${CHIP_ROOT}/config/openiotsdk/chip-gn) +# Get common Cmake sources +include(${COMMON_CMAKE_SOURCE_DIR}/util.cmake) +include(${COMMON_CMAKE_SOURCE_DIR}/chip_gn_args.cmake) +include(${COMMON_CMAKE_SOURCE_DIR}/chip_gn.cmake) # Prepare compiler flags -# Get compiler flags from external targets -foreach(target ${EXTERNAL_TARGETS}) - get_target_common_compile_flags(EXTERNAL_TARGET_CFLAGS ${target}) - list(APPEND CHIP_CFLAGS ${EXTERNAL_TARGET_CFLAGS}) -endforeach() - -# Remove duplicated flags -list(REMOVE_DUPLICATES CHIP_CFLAGS) - -get_gnu_cpp_standard(CHIP_CFLAGS_CC) - -# CFLAGS are put in random order, sort them before converting them to a string -list(SORT CHIP_CFLAGS) -list(SORT CHIP_CFLAGS_C) -list(SORT CHIP_CFLAGS_CC) - -set(SEPARATOR ",") -convert_list_of_flags_to_string_of_flags(CHIP_CFLAGS CHIP_CFLAGS ${SEPARATOR}) -set(SEPARATOR " ") -convert_list_of_flags_to_string_of_flags(CHIP_CFLAGS_C CHIP_CFLAGS_C ${SEPARATOR}) -convert_list_of_flags_to_string_of_flags(CHIP_CFLAGS_CC CHIP_CFLAGS_CC ${SEPARATOR}) +matter_add_cflags(${CMAKE_C_FLAGS}) +matter_add_cxxflags(${CMAKE_CXX_FLAGS}) -# Prepare CHIP libraries that the application should be linked with -set(CHIP_LIBRARIES "${CMAKE_CURRENT_BINARY_DIR}/lib/libCHIP.a") - -if (CONFIG_CHIP_LIB_SHELL) - list(APPEND CHIP_LIBRARIES "${CMAKE_CURRENT_BINARY_DIR}/lib/libCHIPShell.a") -endif() - -# Set up CHIP project configuration file - -if (CONFIG_CHIP_PROJECT_CONFIG) - get_filename_component(CHIP_PROJECT_CONFIG - ${CONFIG_CHIP_PROJECT_CONFIG} - REALPATH - BASE_DIR ${CMAKE_SOURCE_DIR} - ) - set(CHIP_PROJECT_CONFIG "<${CHIP_PROJECT_CONFIG}>") -else() - set(CHIP_PROJECT_CONFIG "") -endif() - -if (${CMAKE_BUILD_TYPE} STREQUAL "Debug") - set(CONFIG_DEBUG YES) -endif() - -# Find required programs - -find_program(GN_EXECUTABLE gn) -if (${GN_EXECUTABLE} STREQUAL GN_EXECUTABLE-NOTFOUND) - message(FATAL_ERROR "The 'gn' command was not found. Make sure you have GN installed.") -else() - # Parse the 'gn --version' output to find the installed version. - set(MIN_GN_VERSION 1851) - execute_process( - COMMAND - ${GN_EXECUTABLE} --version - OUTPUT_VARIABLE gn_version_output - ERROR_VARIABLE gn_error_output - RESULT_VARIABLE gn_status - ) - - if(${gn_status} EQUAL 0) - if(gn_version_output VERSION_LESS ${MIN_GN_VERSION}) - message(FATAL_ERROR "Found unsuitable version of 'gn'. Required is at least ${MIN_GN_VERSION}") - endif() - else() - message(FATAL_ERROR "Could NOT find working gn: Found gn (${GN_EXECUTABLE}), but failed to load with:\n ${gn_error_output}") - endif() -endif() - -find_package(Python3 REQUIRED) +matter_get_compiler_flags_from_targets("${CONFIG_CHIP_EXTERNAL_TARGETS}") # ============================================================================== # Generate configuration for CHIP GN build system # ============================================================================== -chip_gn_arg_string("target_cpu" "${CMAKE_SYSTEM_PROCESSOR}") -chip_gn_arg_cflags("target_cflags" ${CHIP_CFLAGS}) -chip_gn_arg_cflags_lang("target_cflags_c" ${CHIP_CFLAGS_C}) -chip_gn_arg_cflags_lang("target_cflags_cc" ${CHIP_CFLAGS_CC}) -chip_gn_arg_string("openiotsdk_ar" ${CMAKE_AR}) -chip_gn_arg_string("openiotsdk_cc" ${CMAKE_C_COMPILER}) -chip_gn_arg_string("openiotsdk_cxx" ${CMAKE_CXX_COMPILER}) -chip_gn_arg_string("chip_project_config_include" "${CHIP_PROJECT_CONFIG}") -chip_gn_arg_string("chip_system_project_config_include" "${CHIP_PROJECT_CONFIG}") -chip_gn_arg_bool ("is_debug" CONFIG_DEBUG) -chip_gn_arg_bool ("chip_build_tests" CONFIG_CHIP_LIB_TESTS) -chip_gn_arg_bool ("chip_monolithic_tests" CONFIG_CHIP_LIB_TESTS) -chip_gn_arg_bool ("chip_build_libshell" CONFIG_CHIP_LIB_SHELL) -chip_gn_arg_bool ("chip_detail_logging" CONFIG_CHIP_DETAIL_LOGGING) -chip_gn_arg_bool ("chip_progress_logging" CONFIG_CHIP_PROGRESS_LOGGING) -chip_gn_arg_bool ("chip_automation_logging" CONFIG_CHIP_AUTOMATION_LOGGING) -chip_gn_arg_bool ("chip_error_logging" CONFIG_CHIP_ERROR_LOGGING) -chip_gn_arg_bool ("chip_openiotsdk_use_tfm" TFM_SUPPORT) -chip_gn_arg_bool ("chip_openiotsdk_use_psa_ps" CONFIG_CHIP_OPEN_IOT_SDK_USE_PSA_PS) +matter_common_gn_args( + DEBUG CONFIG_CHIP_DEBUG + LIB_SHELL CONFIG_CHIP_LIB_SHELL + LIB_TESTS CONFIG_CHIP_LIB_TESTS + PROJECT_CONFIG ${CONFIG_CHIP_PROJECT_CONFIG} +) +matter_add_gn_arg_string("target_cpu" "${CMAKE_SYSTEM_PROCESSOR}") +matter_add_gn_arg_string("openiotsdk_ar" ${CMAKE_AR}) +matter_add_gn_arg_string("openiotsdk_cc" ${CMAKE_C_COMPILER}) +matter_add_gn_arg_string("openiotsdk_cxx" ${CMAKE_CXX_COMPILER}) +matter_add_gn_arg_bool ("chip_monolithic_tests" CONFIG_CHIP_LIB_TESTS) +matter_add_gn_arg_bool ("chip_detail_logging" CONFIG_CHIP_DETAIL_LOGGING) +matter_add_gn_arg_bool ("chip_progress_logging" CONFIG_CHIP_PROGRESS_LOGGING) +matter_add_gn_arg_bool ("chip_automation_logging" CONFIG_CHIP_AUTOMATION_LOGGING) +matter_add_gn_arg_bool ("chip_error_logging" CONFIG_CHIP_ERROR_LOGGING) +matter_add_gn_arg_bool ("chip_openiotsdk_use_tfm" TFM_SUPPORT) +matter_add_gn_arg_bool ("chip_openiotsdk_use_psa_ps" CONFIG_CHIP_OPEN_IOT_SDK_USE_PSA_PS) if (TARGET cmsis-rtos-api) - chip_gn_arg_string("target_os" "cmsis-rtos") + matter_add_gn_arg_string("target_os" "cmsis-rtos") endif() -chip_gn_arg_string("optimize_debug_level" "s") +matter_add_gn_arg_string("optimize_debug_level" "s") -file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/args.tmp" CONTENT ${CHIP_GN_ARGS}) +matter_generate_args_tmp_file() # ============================================================================== -# Define 'chip-gn' target that builds CHIP library(ies) with GN build system +# Build chip library # ============================================================================== -ExternalProject_Add( - chip-gn - PREFIX ${CMAKE_CURRENT_BINARY_DIR} - SOURCE_DIR ${CHIP_ROOT} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR} - CONFIGURE_COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/make_gn_args.py - @args.tmp > args.gn && - ${GN_EXECUTABLE} - --root=${CHIP_ROOT} - --root-target=${GN_ROOT_TARGET} - --dotfile=${GN_ROOT_TARGET}/.gn - --script-executable=${Python3_EXECUTABLE} - gen --check --fail-on-unused-args ${CMAKE_CURRENT_BINARY_DIR} - BUILD_COMMAND ninja - INSTALL_COMMAND "" - BUILD_BYPRODUCTS ${CHIP_LIBRARIES} - BUILD_ALWAYS TRUE - USES_TERMINAL_CONFIGURE TRUE - USES_TERMINAL_BUILD TRUE +matter_build(chip + LIB_SHELL ${CONFIG_CHIP_LIB_SHELL} + LIB_TESTS ${CONFIG_CHIP_LIB_TESTS} ) -# ============================================================================== -# Define 'openiotsdk-chip' target that exposes CHIP and Open IoT SDK -# headers & libraries to the application -# ============================================================================== -add_library(openiotsdk-chip INTERFACE) -target_compile_definitions(openiotsdk-chip INTERFACE CHIP_HAVE_CONFIG_H) -target_include_directories(openiotsdk-chip INTERFACE - ${CHIP_ROOT}/src - ${CHIP_ROOT}/src/include - ${CHIP_ROOT}/src/lib - ${CHIP_ROOT}/third_party/nlassert/repo/include - ${CHIP_ROOT}/third_party/nlio/repo/include - ${CHIP_ROOT}/zzz_generated/app-common - ${CMAKE_CURRENT_BINARY_DIR}/gen/include -) -target_link_directories(openiotsdk-chip INTERFACE ${CMAKE_CURRENT_BINARY_DIR}/lib) -target_link_libraries(openiotsdk-chip INTERFACE -Wl,--start-group ${CHIP_LIBRARIES} -Wl,--end-group) -target_link_libraries(openiotsdk-chip INTERFACE - ${EXTERNAL_TARGETS} +target_link_libraries(chip INTERFACE + ${CONFIG_CHIP_EXTERNAL_TARGETS} ) -add_dependencies(openiotsdk-chip chip-gn) - -if (NOT ${CMAKE_BUILD_TYPE} STREQUAL "Debug") - target_compile_definitions(openiotsdk-chip INTERFACE - NDEBUG - ) -endif() diff --git a/config/openiotsdk/chip-gn/args.gni b/config/openiotsdk/chip-gn/args.gni index a468c14510aad9..fd9edf986f8ee7 100644 --- a/config/openiotsdk/chip-gn/args.gni +++ b/config/openiotsdk/chip-gn/args.gni @@ -19,6 +19,7 @@ import("${chip_root}/src/crypto/crypto.gni") chip_device_platform = "openiotsdk" chip_build_tests = false +chip_build_libshell = false chip_project_config_include = "" chip_system_project_config_include = "" diff --git a/config/openiotsdk/cmake/chip.cmake b/config/openiotsdk/cmake/chip.cmake index 9a7dcf629e3a06..bdef5870433d23 100644 --- a/config/openiotsdk/cmake/chip.cmake +++ b/config/openiotsdk/cmake/chip.cmake @@ -37,10 +37,16 @@ if(CONFIG_CHIP_OPEN_IOT_SDK_USE_PSA_PS AND NOT TFM_SUPPORT) message( FATAL_ERROR "You can not use PSA Protected Storage without TF-M support" ) endif() +if (${CMAKE_BUILD_TYPE} STREQUAL "Debug") + set(CONFIG_CHIP_DEBUG YES) +else() + set(CONFIG_CHIP_DEBUG NO) +endif() + # Add CHIP sources add_subdirectory(${OPEN_IOT_SDK_CONFIG} ./chip_build) -# Additional openiotsdk-chip target configuration +# Additional chip target configuration # TF-M support requires the right order of generating targets if(TFM_SUPPORT) diff --git a/config/openiotsdk/cmake/sdk.cmake b/config/openiotsdk/cmake/sdk.cmake index 52055cacdfc49a..25851c2d7ded2f 100644 --- a/config/openiotsdk/cmake/sdk.cmake +++ b/config/openiotsdk/cmake/sdk.cmake @@ -25,7 +25,7 @@ get_filename_component(OPEN_IOT_SDK_SOURCE ${CHIP_ROOT}/third_party/open-iot-sdk get_filename_component(OPEN_IOT_SDK_STORAGE_SOURCE ${CHIP_ROOT}/third_party/open-iot-sdk/storage REALPATH) # Open IoT SDK targets passed to CHIP build -list(APPEND EXTERNAL_TARGETS) +list(APPEND CONFIG_CHIP_EXTERNAL_TARGETS) # Additional Open IoT SDK build configuration set(TFM_SUPPORT NO CACHE BOOL "Add Trusted Firmware-M (TF-M) support to application") @@ -193,7 +193,7 @@ if(TARGET mbedtls-config) endif() if("mcu-driver-reference-platforms-for-arm" IN_LIST IOTSDK_FETCH_LIST) - list(APPEND EXTERNAL_TARGETS + list(APPEND CONFIG_CHIP_EXTERNAL_TARGETS mcu-driver-bootstrap mcu-driver-hal mdh-arm-corstone-300-common @@ -202,7 +202,7 @@ if("mcu-driver-reference-platforms-for-arm" IN_LIST IOTSDK_FETCH_LIST) endif() if("cmsis-5" IN_LIST IOTSDK_FETCH_LIST) - list(APPEND EXTERNAL_TARGETS + list(APPEND CONFIG_CHIP_EXTERNAL_TARGETS cmsis-core cmsis-rtos-api iotsdk-ip-network-api @@ -210,13 +210,13 @@ if("cmsis-5" IN_LIST IOTSDK_FETCH_LIST) endif() if("cmsis-freertos" IN_LIST IOTSDK_FETCH_LIST) - list(APPEND EXTERNAL_TARGETS + list(APPEND CONFIG_CHIP_EXTERNAL_TARGETS freertos-cmsis-rtos ) endif() if("mbedtls" IN_LIST IOTSDK_FETCH_LIST) - list(APPEND EXTERNAL_TARGETS + list(APPEND CONFIG_CHIP_EXTERNAL_TARGETS mbedtls mbedtls-config mbedtls-threading-cmsis-rtos @@ -224,7 +224,7 @@ if("mbedtls" IN_LIST IOTSDK_FETCH_LIST) endif() if("lwip" IN_LIST IOTSDK_FETCH_LIST) - list(APPEND EXTERNAL_TARGETS + list(APPEND CONFIG_CHIP_EXTERNAL_TARGETS lwipcore lwip-cmsis-port lwip-cmsis-sys @@ -234,14 +234,14 @@ if("lwip" IN_LIST IOTSDK_FETCH_LIST) endif() if("cmsis-sockets-api" IN_LIST IOTSDK_FETCH_LIST) - list(APPEND EXTERNAL_TARGETS + list(APPEND CONFIG_CHIP_EXTERNAL_TARGETS cmsis-sockets-api lwip-sockets ) endif() if("trusted-firmware-m" IN_LIST IOTSDK_FETCH_LIST) - list(APPEND EXTERNAL_TARGETS + list(APPEND CONFIG_CHIP_EXTERNAL_TARGETS tfm-ns-interface tfm-ns-interface-cmsis-rtos ) @@ -251,14 +251,14 @@ endif() # Add Open IoT SDK storage source add_subdirectory(${OPEN_IOT_SDK_STORAGE_SOURCE} ./sdk_storage_build) -list(APPEND EXTERNAL_TARGETS +list(APPEND CONFIG_CHIP_EXTERNAL_TARGETS iotsdk-blockdevice iotsdk-tdbstore ) # Add custom storage library add_subdirectory(${OPEN_IOT_SDK_CONFIG}/storage storage_build) -list(APPEND EXTERNAL_TARGETS +list(APPEND CONFIG_CHIP_EXTERNAL_TARGETS openiotsdk-storage ) diff --git a/config/telink/chip-module/CMakeLists.txt b/config/telink/chip-module/CMakeLists.txt index 91d108153bc68f..e1953b324d3c07 100644 --- a/config/telink/chip-module/CMakeLists.txt +++ b/config/telink/chip-module/CMakeLists.txt @@ -30,68 +30,6 @@ include(../../zephyr/ota-image.cmake) include(../../zephyr/zephyr-util.cmake) include(generate_factory_data.cmake) -# ============================================================================== -# Declare configuration variables and define constants -# ============================================================================== - -# C/C++ compiler flags passed to CHIP build system -list(APPEND CHIP_CFLAGS) - -# C compiler flags passed to CHIP build system -list(APPEND CHIP_CFLAGS_C) - -# C++ compiler flags passed to CHIP build system -list(APPEND CHIP_CFLAGS_CC) - -# CHIP libraries that the application should be linked with -list(APPEND CHIP_LIBRARIES) - -# GN meta-build system arguments passed to the make_gn_args.py script -string(APPEND CHIP_GN_ARGS) - -# C/C++ compiler flags which should not be forwarded to CHIP -# build system (e.g. because CHIP configures them on its own) -set(CHIP_CFLAG_EXCLUDES - "-fno-asynchronous-unwind-tables" - "-fno-common" - "-fno-defer-pop" - "-fno-reorder-functions" - "-ffunction-sections" - "-fdata-sections" - "-g*" - "-O*" - "-W*" -) - -# ============================================================================== -# Helper macros -# ============================================================================== - -macro(chip_gn_arg_import FILE) - string(APPEND CHIP_GN_ARGS "--module\n${FILE}\n") -endmacro() - -macro(chip_gn_arg_string ARG STRING) - string(APPEND CHIP_GN_ARGS "--arg-string\n${ARG}\n${STRING}\n") -endmacro() - -macro(chip_gn_arg_bool ARG) - if (${ARGN}) - string(APPEND CHIP_GN_ARGS "--arg\n${ARG}\ntrue\n") - else() - string(APPEND CHIP_GN_ARGS "--arg\n${ARG}\nfalse\n") - endif() -endmacro() - -macro(chip_gn_arg_cflags ARG CFLAGS) - string(APPEND CHIP_GN_ARGS "--arg-cflags\n${ARG}\n${CFLAGS}\n") -endmacro() - -macro(chip_gn_arg ARG VALUE) - string(APPEND CHIP_GN_ARGS "--arg\n${ARG}\n${VALUE}\n") -endmacro() - - # ============================================================================== # Prepare CHIP configuration based on the project Kconfig configuration # ============================================================================== @@ -99,48 +37,29 @@ endmacro() if (NOT CHIP_ROOT) get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../.. REALPATH) endif() +get_filename_component(GN_ROOT_TARGET ${CHIP_ROOT}/config/telink/chip-gn REALPATH) +get_filename_component(COMMON_CMAKE_SOURCE_DIR ${CHIP_ROOT}/config/common/cmake REALPATH) -set(GN_ROOT_TARGET ${CHIP_ROOT}/config/telink/chip-gn) - -if (CONFIG_POSIX_API) - list(APPEND CHIP_CFLAGS - -D_SYS__PTHREADTYPES_H_ - -isystem${ZEPHYR_BASE}/include/zephyr/posix - ) -endif() - -zephyr_include_directories(${CHIP_ROOT}/src/platform/telink/) - -zephyr_get_compile_flags(CHIP_CFLAGS_C C) -zephyr_get_compile_flags(CHIP_CFLAGS_CC CXX) -zephyr_get_gnu_cpp_standard(CHIP_CFLAGS_CC) +# Get common Cmake sources -convert_list_of_flags_to_string_of_flags(CHIP_CFLAGS CHIP_CFLAGS) -convert_list_of_flags_to_string_of_flags(CHIP_CFLAGS_C CHIP_CFLAGS_C) -convert_list_of_flags_to_string_of_flags(CHIP_CFLAGS_CC CHIP_CFLAGS_CC) +include(${COMMON_CMAKE_SOURCE_DIR}/chip_gn_args.cmake) +include(${COMMON_CMAKE_SOURCE_DIR}/chip_gn.cmake) -# Prepare CHIP libraries that the application should be linked with +# Prepare compiler flags -if (NOT CHIP_LIBRARIES) - set(CHIP_LIBRARIES -lCHIP) -endif() - -if (CONFIG_CHIP_LIB_SHELL) - list(APPEND CHIP_LIBRARIES -lCHIPShell) +if (CONFIG_POSIX_API) + matter_add_flags(-D_SYS__PTHREADTYPES_H_) + matter_add_flags(-isystem${ZEPHYR_BASE}/include/zephyr/posix) endif() -# Set up CHIP project configuration file +zephyr_include_directories(${CHIP_ROOT}/src/platform/telink/) -if (CONFIG_CHIP_PROJECT_CONFIG) - get_filename_component(CHIP_PROJECT_CONFIG - ${CONFIG_CHIP_PROJECT_CONFIG} - REALPATH - BASE_DIR ${CMAKE_SOURCE_DIR} - ) - set(CHIP_PROJECT_CONFIG "<${CHIP_PROJECT_CONFIG}>") -else() - set(CHIP_PROJECT_CONFIG "") -endif() +zephyr_get_compile_flags(ZEPHYR_CFLAGS_C C) +matter_add_cflags("${ZEPHYR_CFLAGS_C}") +zephyr_get_compile_flags(ZEPHYR_CFLAGS_CC CXX) +matter_add_cxxflags("${ZEPHYR_CFLAGS_CC}") +zephyr_get_gnu_cpp_standard(ZEPHYR_GNU_CPP_STD) +matter_add_cxxflags(${ZEPHYR_GNU_CPP_STD}) # Set up custom OpenThread configuration @@ -153,147 +72,66 @@ if (CONFIG_CHIP_OPENTHREAD_CONFIG) zephyr_set_openthread_config(${CHIP_OPENTHREAD_CONFIG}) endif() -# Find required programs - -find_program(GN_EXECUTABLE gn) -if (${GN_EXECUTABLE} STREQUAL GN_EXECUTABLE-NOTFOUND) - message(FATAL_ERROR "The 'gn' command was not found. Make sure you have GN installed.") -else() - # Parse the 'gn --version' output to find the installed version. - set(MIN_GN_VERSION 1851) - execute_process( - COMMAND - ${GN_EXECUTABLE} --version - OUTPUT_VARIABLE gn_version_output - ERROR_VARIABLE gn_error_output - RESULT_VARIABLE gn_status - ) - - if(${gn_status} EQUAL 0) - if(gn_version_output VERSION_LESS ${MIN_GN_VERSION}) - message(FATAL_ERROR "Found unsuitable version of 'gn'. Required is at least ${MIN_GN_VERSION}") - endif() - else() - message(FATAL_ERROR "Could NOT find working gn: Found gn (${GN_EXECUTABLE}), but failed to load with:\n ${gn_error_output}") - endif() -endif() - -find_package(Python3 REQUIRED) - # ============================================================================== # Generate configuration for CHIP GN build system # ============================================================================== -chip_gn_arg_cflags("target_cflags" ${CHIP_CFLAGS}) -chip_gn_arg_cflags("target_cflags_c" ${CHIP_CFLAGS_C}) -chip_gn_arg_cflags("target_cflags_cc" ${CHIP_CFLAGS_CC}) -chip_gn_arg_string("zephyr_ar" ${CMAKE_AR}) -chip_gn_arg_string("zephyr_cc" ${CMAKE_C_COMPILER}) -chip_gn_arg_string("zephyr_cxx" ${CMAKE_CXX_COMPILER}) -chip_gn_arg_bool ("is_debug" CONFIG_DEBUG) -chip_gn_arg_bool ("chip_logging" CONFIG_LOG) -chip_gn_arg_bool ("chip_enable_openthread" CONFIG_NET_L2_OPENTHREAD) -chip_gn_arg_bool ("chip_openthread_ftd" CONFIG_OPENTHREAD_FTD) -chip_gn_arg_bool ("chip_config_network_layer_ble" CONFIG_BT) -chip_gn_arg_bool ("chip_inet_config_enable_ipv4" CONFIG_NET_IPV4) -chip_gn_arg_bool ("chip_enable_ota_requestor" CONFIG_CHIP_OTA_REQUESTOR) -chip_gn_arg_bool ("chip_build_tests" CONFIG_CHIP_BUILD_TESTS) -chip_gn_arg_bool ("chip_inet_config_enable_tcp_endpoint" CONFIG_CHIP_BUILD_TESTS) -chip_gn_arg_bool ("chip_build_libshell" CONFIG_CHIP_LIB_SHELL) -chip_gn_arg_bool ("chip_error_logging" CONFIG_MATTER_LOG_LEVEL GREATER_EQUAL 1) -chip_gn_arg_bool ("chip_progress_logging" CONFIG_MATTER_LOG_LEVEL GREATER_EQUAL 3) -chip_gn_arg_bool ("chip_detail_logging" CONFIG_MATTER_LOG_LEVEL GREATER_EQUAL 4) -chip_gn_arg_bool ("chip_automation_logging" FALSE) +matter_common_gn_args( + DEBUG CONFIG_DEBUG + LIB_SHELL CONFIG_CHIP_LIB_SHELL + LIB_TESTS CONFIG_CHIP_BUILD_TESTS + PROJECT_CONFIG ${CONFIG_CHIP_PROJECT_CONFIG} + DEVICE_INFO_EXAMPLE_PROVIDER CONFIG_CHIP_EXAMPLE_DEVICE_INFO_PROVIDER +) +matter_add_gn_arg_string("zephyr_ar" ${CMAKE_AR}) +matter_add_gn_arg_string("zephyr_cc" ${CMAKE_C_COMPILER}) +matter_add_gn_arg_string("zephyr_cxx" ${CMAKE_CXX_COMPILER}) +matter_add_gn_arg_bool ("chip_logging" CONFIG_LOG) +matter_add_gn_arg_bool ("chip_enable_openthread" CONFIG_NET_L2_OPENTHREAD) +matter_add_gn_arg_bool ("chip_openthread_ftd" CONFIG_OPENTHREAD_FTD) +matter_add_gn_arg_bool ("chip_config_network_layer_ble" CONFIG_BT) +matter_add_gn_arg_bool ("chip_inet_config_enable_ipv4" CONFIG_NET_IPV4) +matter_add_gn_arg_bool ("chip_enable_ota_requestor" CONFIG_CHIP_OTA_REQUESTOR) +matter_add_gn_arg_bool ("chip_inet_config_enable_tcp_endpoint" CONFIG_CHIP_BUILD_TESTS) +matter_add_gn_arg_bool ("chip_error_logging" CONFIG_MATTER_LOG_LEVEL GREATER_EQUAL 1) +matter_add_gn_arg_bool ("chip_progress_logging" CONFIG_MATTER_LOG_LEVEL GREATER_EQUAL 3) +matter_add_gn_arg_bool ("chip_detail_logging" CONFIG_MATTER_LOG_LEVEL GREATER_EQUAL 4) +matter_add_gn_arg_bool ("chip_automation_logging" FALSE) if (CONFIG_CHIP_FACTORY_DATA) - chip_gn_arg_bool ("chip_use_transitional_commissionable_data_provider" "false") - chip_gn_arg_bool ("chip_enable_factory_data" "true") + matter_add_gn_arg_bool ("chip_use_transitional_commissionable_data_provider" "false") + matter_add_gn_arg_bool ("chip_enable_factory_data" "true") elseif (CONFIG_CHIP_FACTORY_DATA_CUSTOM_BACKEND) - chip_gn_arg_bool ("chip_use_transitional_commissionable_data_provider" "false") + matter_add_gn_arg_bool ("chip_use_transitional_commissionable_data_provider" "false") endif() if (CONFIG_CHIP_ROTATING_DEVICE_ID) - chip_gn_arg_bool("chip_enable_rotating_device_id" "true") - chip_gn_arg_bool("chip_enable_additional_data_advertising" "true") + matter_add_gn_arg_bool("chip_enable_rotating_device_id" "true") + matter_add_gn_arg_bool("chip_enable_additional_data_advertising" "true") endif() if (CONFIG_CHIP_ENABLE_DNSSD_SRP) - chip_gn_arg_string("chip_mdns" "platform") -endif() - -if (CHIP_PROJECT_CONFIG) - chip_gn_arg_string("chip_project_config_include" ${CHIP_PROJECT_CONFIG}) - chip_gn_arg_string("chip_system_project_config_include" ${CHIP_PROJECT_CONFIG}) + matter_add_gn_arg_string("chip_mdns" "platform") endif() if (CONFIG_CHIP_PW_RPC) set(PIGWEED_DIR "//third_party/pigweed/repo") - chip_gn_arg_string("pw_assert_BACKEND" ${PIGWEED_DIR}/pw_assert_log:check_backend) - chip_gn_arg_string("pw_log_BACKEND" ${PIGWEED_DIR}/pw_log_basic) - chip_gn_arg("pw_build_LINK_DEPS" [\"${PIGWEED_DIR}/pw_assert:impl\",\ \"${PIGWEED_DIR}/pw_log:impl\"]) -endif() - -if (CONFIG_CHIP_EXAMPLE_DEVICE_INFO_PROVIDER) - chip_gn_arg_bool("chip_build_example_providers" "true") - list(APPEND CHIP_LIBRARIES -lMatterDeviceInfoProviderExample) + matter_add_gn_arg_string("pw_assert_BACKEND" ${PIGWEED_DIR}/pw_assert_log:check_backend) + matter_add_gn_arg_string("pw_log_BACKEND" ${PIGWEED_DIR}/pw_log_basic) + matter_add_gn_arg("pw_build_LINK_DEPS" [\"${PIGWEED_DIR}/pw_assert:impl\",\ \"${PIGWEED_DIR}/pw_log:impl\"]) endif() -file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/args.tmp" CONTENT ${CHIP_GN_ARGS}) - -# ============================================================================== -# Define 'chip-gn' target that builds CHIP library(ies) with GN build system -# ============================================================================== -ExternalProject_Add( - chip-gn - PREFIX ${CMAKE_CURRENT_BINARY_DIR} - SOURCE_DIR ${CHIP_ROOT} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR} - CONFIGURE_COMMAND "" - BUILD_COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/make_gn_args.py - @args.tmp > args.gn && - ${GN_EXECUTABLE} - --root=${CHIP_ROOT} - --root-target=${GN_ROOT_TARGET} - --dotfile=${GN_ROOT_TARGET}/.gn - --script-executable=${Python3_EXECUTABLE} - --export-compile-commands - gen --check --fail-on-unused-args . && - ninja - INSTALL_COMMAND "" - BUILD_BYPRODUCTS ${CHIP_LIBRARIES} - BUILD_ALWAYS TRUE - USES_TERMINAL_CONFIGURE TRUE - USES_TERMINAL_BUILD TRUE -) -add_dependencies(chip-gn kernel) +matter_generate_args_tmp_file() # ============================================================================== -# Define 'chip' target that exposes CHIP headers & libraries to the application +# Build chip library # ============================================================================== - -zephyr_interface_library_named(chip) -target_compile_definitions(chip INTERFACE CHIP_HAVE_CONFIG_H) -target_include_directories(chip INTERFACE - ${CHIP_ROOT}/src - ${CHIP_ROOT}/src/include - ${CHIP_ROOT}/src/lib - ${CHIP_ROOT}/third_party/nlassert/repo/include - ${CHIP_ROOT}/third_party/nlio/repo/include - ${CHIP_ROOT}/zzz_generated/app-common - ${CMAKE_CURRENT_BINARY_DIR}/gen/include +matter_build(chip + LIB_SHELL ${CONFIG_CHIP_LIB_SHELL} + DEVICE_INFO_EXAMPLE_PROVIDER ${CONFIG_CHIP_EXAMPLE_DEVICE_INFO_PROVIDER} + GN_DEPENDENCIES kernel ) -target_link_directories(chip INTERFACE ${CMAKE_CURRENT_BINARY_DIR}/lib) -if (CONFIG_CHIP_LIB_SHELL) - target_link_options(chip INTERFACE -Wl,--whole-archive -lCHIPShell -Wl,--no-whole-archive) -endif() - -if (CONFIG_CHIP_EXAMPLE_DEVICE_INFO_PROVIDER) - target_include_directories(chip INTERFACE ${CHIP_ROOT}/examples/providers) -endif() - -target_link_libraries(chip INTERFACE -Wl,--start-group ${CHIP_LIBRARIES} -Wl,--end-group) - -add_dependencies(chip chip-gn) +set_property(GLOBAL APPEND PROPERTY ZEPHYR_INTERFACE_LIBS chip) # ============================================================================== # Define 'chip-ota-image' target for building CHIP OTA image diff --git a/config/telink/chip-module/Kconfig b/config/telink/chip-module/Kconfig index 80d8770e8ed7e3..f047a9cace7526 100644 --- a/config/telink/chip-module/Kconfig +++ b/config/telink/chip-module/Kconfig @@ -162,3 +162,9 @@ config CHIP_ENABLE_APPLICATION_STATUS_LED default y help Enable application status LED. + +config CHIP_ENABLE_PM_DURING_BLE + bool "Enable PM during BLE operation" + default y + help + Enable PM during BLE operation. diff --git a/config/telink/chip-module/generate_factory_data.cmake b/config/telink/chip-module/generate_factory_data.cmake index 6b7681defc8224..7798f101982787 100644 --- a/config/telink/chip-module/generate_factory_data.cmake +++ b/config/telink/chip-module/generate_factory_data.cmake @@ -69,21 +69,25 @@ else() endif() # find chip cert tool -find_program(chip_cert_exe NAMES chip-cert REQUIRED) +find_program(chip_cert_exe NAMES chip-cert PATHS ${CHIP_ROOT}/out/telink REQUIRED) string(APPEND script_args "--chip-cert-path ${chip_cert_exe}\n") # for development purpose user can use default certs instead of generating or providing them if(CONFIG_CHIP_FACTORY_DATA_USE_DEFAULT_CERTS) + # convert decimal VID to its hexadecimal representation to find out certification files in repository + math(EXPR LOCAL_VID "${CONFIG_CHIP_DEVICE_VENDOR_ID}" OUTPUT_FORMAT HEXADECIMAL) + string(SUBSTRING ${LOCAL_VID} 2 -1 raw_vid) + string(TOUPPER ${raw_vid} raw_vid_upper) # convert decimal PID to its hexadecimal representation to find out certification files in repository math(EXPR LOCAL_PID "${CONFIG_CHIP_DEVICE_PRODUCT_ID}" OUTPUT_FORMAT HEXADECIMAL) string(SUBSTRING ${LOCAL_PID} 2 -1 raw_pid) string(TOUPPER ${raw_pid} raw_pid_upper) # all certs are located in ${CHIP_ROOT}/credentials/development/attestation # it can be used during development without need to generate new certifications - string(APPEND script_args "--dac-cert \"${CHIP_ROOT}/credentials/development/attestation/Matter-Development-DAC-${raw_pid_upper}-Cert.pem\"\n") - string(APPEND script_args "--dac-key \"${CHIP_ROOT}/credentials/development/attestation/Matter-Development-DAC-${raw_pid_upper}-Key.pem\"\n") - string(APPEND script_args "--cert \"${CHIP_ROOT}/credentials/development/attestation/Matter-Development-PAI-noPID-Cert.pem\"\n") - string(APPEND script_args "--key \"${CHIP_ROOT}/credentials/development/attestation/Matter-Development-PAI-noPID-Key.pem\"\n") + string(APPEND script_args "--dac-cert \"${CHIP_ROOT}/credentials/development/attestation/Matter-Development-DAC-${raw_vid_upper}-${raw_pid_upper}-Cert.pem\"\n") + string(APPEND script_args "--dac-key \"${CHIP_ROOT}/credentials/development/attestation/Matter-Development-DAC-${raw_vid_upper}-${raw_pid_upper}-Key.pem\"\n") + string(APPEND script_args "--cert \"${CHIP_ROOT}/credentials/development/attestation/Matter-Development-PAI-${raw_vid_upper}-noPID-Cert.pem\"\n") + string(APPEND script_args "--key \"${CHIP_ROOT}/credentials/development/attestation/Matter-Development-PAI-${raw_vid_upper}-noPID-Key.pem\"\n") string(APPEND script_args "-cd \"${CHIP_ROOT}/credentials/development/cd-certs/Chip-Test-CD-Cert.der\"\n") string(APPEND script_args "--pai\n") else() @@ -95,7 +99,7 @@ else() endif() # find chip tool requied for generating QRCode -find_program(chip_tool_exe NAMES chip-tool REQUIRED) +find_program(chip_tool_exe NAMES chip-tool PATHS ${CHIP_ROOT}/out/telink REQUIRED) string(APPEND script_args "--chip-tool-path ${chip_tool_exe}\n") # add Password-Authenticated Key Exchange parameters @@ -104,7 +108,7 @@ string(APPEND script_args "--discriminator ${CONFIG_CHIP_DEVICE_DISCRIMINATOR}\n string(APPEND script_args "--passcode ${CONFIG_CHIP_DEVICE_SPAKE2_PASSCODE}\n") # request spake2p to generate a new spake2_verifier -find_program(spake_exe NAMES spake2p REQUIRED) +find_program(spake_exe NAMES spake2p PATHS ${CHIP_ROOT}/out/telink REQUIRED) string(APPEND script_args "--spake2-path ${spake_exe}\n") if(CONFIG_CHIP_DEVICE_ENABLE_KEY) diff --git a/config/telink/chip-module/make_gn_args.py b/config/telink/chip-module/make_gn_args.py deleted file mode 100755 index f30cd459a6e7d4..00000000000000 --- a/config/telink/chip-module/make_gn_args.py +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env python3 - -# -# Copyright (c) 2021 Project CHIP Authors -# All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -import argparse -import re -import sys - -GN_SPECIAL_CHARACTERS = r'(["$\\])' -GN_CFLAG_EXCLUDES = [ - '-fno-asynchronous-unwind-tables', - '-fno-common', - '-fno-defer-pop', - '-fno-reorder-functions', - '-ffunction-sections', - '-fdata-sections', - '-g*', - '-O*', - '-W*', -] - - -def escape_strings(gn_args): - return [[key, re.sub(GN_SPECIAL_CHARACTERS, r'\\\1', value)] for key, value in gn_args] - - -def write_gn_args(args): - if args.module: - sys.stdout.write('import("{}")\n'.format(args.module)) - - for key, value in args.arg: - sys.stdout.write('{} = {}\n'.format(key, value)) - - for key, value in args.arg_string: - sys.stdout.write('{} = "{}"\n'.format(key, value)) - - cflag_excludes = ', '.join(['"{}"'.format(exclude) - for exclude in GN_CFLAG_EXCLUDES]) - - for key, value in args.arg_cflags: - sys.stdout.write('{} = filter_exclude(string_split("{}"), [{}])\n'.format( - key, value, cflag_excludes)) - - -def main(): - parser = argparse.ArgumentParser(fromfile_prefix_chars='@') - parser.add_argument('--module', action='store') - parser.add_argument('--arg', action='append', nargs=2, default=[]) - parser.add_argument('--arg-string', action='append', nargs=2, default=[]) - parser.add_argument('--arg-cflags', action='append', nargs=2, default=[]) - args = parser.parse_args() - args.arg_string = escape_strings(args.arg_string) - args.arg_cflags = escape_strings(args.arg_cflags) - write_gn_args(args) - - -if __name__ == "__main__": - main() diff --git a/config/zephyr/chip-module/CMakeLists.txt b/config/zephyr/chip-module/CMakeLists.txt index ba25a316f57a2e..6d84a962a69cc0 100644 --- a/config/zephyr/chip-module/CMakeLists.txt +++ b/config/zephyr/chip-module/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 Project CHIP Authors +# Copyright (c) 2022-2023 Project CHIP Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -28,123 +28,41 @@ if (CONFIG_CHIP) include(ExternalProject) include(../zephyr-util.cmake) -# ============================================================================== -# Declare configuration variables and define constants -# ============================================================================== - -# C/C++ compiler flags passed to CHIP build system -list(APPEND CHIP_CFLAGS) - -# C compiler flags passed to CHIP build system -list(APPEND CHIP_CFLAGS_C) - -# C++ compiler flags passed to CHIP build system -list(APPEND CHIP_CFLAGS_CC) - -# CHIP libraries that the application should be linked with -list(APPEND CHIP_LIBRARIES) - -# GN meta-build system arguments in the form of 'key1 = value1\nkey2 = value2...' string -string(APPEND CHIP_GN_ARGS) - -# C/C++ compiler flags which should not be forwarded to CHIP -# build system (e.g. because CHIP configures them on its own) -set(CHIP_CFLAG_EXCLUDES - "-fno-asynchronous-unwind-tables" - "-fno-common" - "-fno-defer-pop" - "-fno-reorder-functions" - "-ffunction-sections" - "-fdata-sections" - "-g*" - "-O*" - "-W*" -) - -# ============================================================================== -# Helper macros -# ============================================================================== - -macro(chip_gn_arg_import FILE) - string(APPEND CHIP_GN_ARGS "import(\"${FILE}\")\n") -endmacro() - -macro(chip_gn_arg_string ARG STRING) - string(APPEND CHIP_GN_ARGS "${ARG} = \"${STRING}\"\n") -endmacro() - -macro(chip_gn_arg_bool ARG BOOLEAN) - if (${BOOLEAN}) - string(APPEND CHIP_GN_ARGS "${ARG} = true\n") - else() - string(APPEND CHIP_GN_ARGS "${ARG} = false\n") - endif() -endmacro() - -macro(chip_gn_arg_cflags ARG CFLAGS) - set(CFLAG_EXCLUDES "[") - foreach(cflag ${CHIP_CFLAG_EXCLUDES}) - string(APPEND CFLAG_EXCLUDES "\"${cflag}\", ") - endforeach() - string(APPEND CFLAG_EXCLUDES "]") - string(APPEND CHIP_GN_ARGS "${ARG} = filter_exclude(string_split(\"${CFLAGS}\"), ${CFLAG_EXCLUDES})\n") -endmacro() - +# # ============================================================================== # Prepare CHIP configuration based on the project Kconfig configuration # ============================================================================== - +# Set paths if (NOT CHIP_ROOT) get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../.. REALPATH) endif() +get_filename_component(GN_ROOT_TARGET ${CHIP_ROOT}/config/zephyr/chip-gn REALPATH) +get_filename_component(COMMON_CMAKE_SOURCE_DIR ${CHIP_ROOT}/config/common/cmake REALPATH) -set(GN_ROOT_TARGET ${CHIP_ROOT}/config/zephyr/chip-gn) - -if (CONFIG_POSIX_API) - list(APPEND CHIP_CFLAGS - -D_SYS__PTHREADTYPES_H_ - -isystem${ZEPHYR_BASE}/include/zephyr/posix - ) -endif() - -list(APPEND CHIP_CFLAGS -isystem${ZEPHYR_BASE}/../modules/crypto/mbedtls/include/) - -zephyr_get_compile_flags(CHIP_CFLAGS_C C) -zephyr_get_compile_flags(CHIP_CFLAGS_CC CXX) -zephyr_get_gnu_cpp_standard(CHIP_CFLAGS_CC) - -convert_list_of_flags_to_string_of_flags(CHIP_CFLAGS CHIP_CFLAGS) -convert_list_of_flags_to_string_of_flags(CHIP_CFLAGS_C CHIP_CFLAGS_C) -convert_list_of_flags_to_string_of_flags(CHIP_CFLAGS_CC CHIP_CFLAGS_CC) - -# Prepare CHIP libraries that the application should be linked with - -if (NOT CHIP_LIBRARIES) - set(CHIP_LIBRARIES -lCHIP) -endif() - -if (CONFIG_CHIP_LIB_SHELL) - list(APPEND CHIP_LIBRARIES -lCHIPShell) -endif() - +# Additional configuration if (CONFIG_CHIP_PW_RPC) - list(APPEND CHIP_LIBRARIES -lPwRpc) + set(CONFIG_CHIP_LIB_PW_RPC YES) endif() +# Get common Cmake sources +include(${COMMON_CMAKE_SOURCE_DIR}/chip_gn_args.cmake) +include(${COMMON_CMAKE_SOURCE_DIR}/chip_gn.cmake) -# Set up CHIP project configuration file +# Prepare compiler flags +matter_add_flags(-isystem${ZEPHYR_BASE}/../modules/crypto/mbedtls/include/) -if (CONFIG_CHIP_PROJECT_CONFIG) - get_filename_component(CHIP_PROJECT_CONFIG - ${CONFIG_CHIP_PROJECT_CONFIG} - REALPATH - BASE_DIR ${CMAKE_SOURCE_DIR} - ) - set(CHIP_PROJECT_CONFIG "<${CHIP_PROJECT_CONFIG}>") -else() - set(CHIP_PROJECT_CONFIG "") +if (CONFIG_POSIX_API) + matter_add_flags(-D_SYS__PTHREADTYPES_H_) + matter_add_flags(-isystem${ZEPHYR_BASE}/include/zephyr/posix) endif() +zephyr_get_compile_flags(ZEPHYR_CFLAGS_C C) +matter_add_cflags(${ZEPHYR_CFLAGS_C}) +zephyr_get_compile_flags(ZEPHYR_CFLAGS_CC CXX) +matter_add_cxxflags(${ZEPHYR_CFLAGS_CC}) +zephyr_get_gnu_cpp_standard(ZEPHYR_GNU_CPP_STD) +matter_add_cxxflags(${ZEPHYR_GNU_CPP_STD}) + # Set up custom OpenThread configuration if (CONFIG_CHIP_OPENTHREAD_CONFIG) @@ -156,102 +74,39 @@ if (CONFIG_CHIP_OPENTHREAD_CONFIG) zephyr_set_openthread_config(${CHIP_OPENTHREAD_CONFIG}) endif() -# Find required programs - -find_program(GN_EXECUTABLE gn) -if (${GN_EXECUTABLE} STREQUAL GN_EXECUTABLE-NOTFOUND) - message(FATAL_ERROR "The 'gn' command was not found. Make sure you have GN installed.") -else() - # Parse the 'gn --version' output to find the installed version. - set(MIN_GN_VERSION 1000) - execute_process( - COMMAND - ${GN_EXECUTABLE} --version - OUTPUT_VARIABLE gn_version_output - ERROR_VARIABLE gn_error_output - RESULT_VARIABLE gn_status - ) - - if(${gn_status} EQUAL 0) - if(gn_version_output VERSION_LESS ${MIN_GN_VERSION}) - message(FATAL_ERROR "Found unsuitable version of 'gn'. Required is at least ${MIN_GN_VERSION}") - endif() - else() - message(FATAL_ERROR "Could NOT find working gn: Found gn (${GN_EXECUTABLE}), but failed to load with:\n ${gn_error_output}") - endif() -endif() - -find_package(Python3 REQUIRED) - # ============================================================================== # Generate configuration for CHIP GN build system # ============================================================================== -chip_gn_arg_cflags("target_cflags" ${CHIP_CFLAGS}) -chip_gn_arg_cflags("target_cflags_c" ${CHIP_CFLAGS_C}) -chip_gn_arg_cflags("target_cflags_cc" ${CHIP_CFLAGS_CC}) -chip_gn_arg_string("zephyr_ar" ${CMAKE_AR}) -chip_gn_arg_string("zephyr_cc" ${CMAKE_C_COMPILER}) -chip_gn_arg_string("zephyr_cxx" ${CMAKE_CXX_COMPILER}) -chip_gn_arg_string("chip_project_config_include" "${CHIP_PROJECT_CONFIG}") -chip_gn_arg_string("chip_system_project_config_include" "${CHIP_PROJECT_CONFIG}") -chip_gn_arg_bool ("is_debug" CONFIG_DEBUG) -chip_gn_arg_bool ("chip_enable_openthread" CONFIG_NET_L2_OPENTHREAD) -chip_gn_arg_bool ("chip_openthread_ftd" CONFIG_OPENTHREAD_FTD) -chip_gn_arg_bool ("chip_inet_config_enable_ipv4" CONFIG_NET_IPV4) -chip_gn_arg_bool ("chip_build_tests" CONFIG_CHIP_BUILD_TESTS) -chip_gn_arg_bool ("chip_inet_config_enable_tcp_endpoint" CONFIG_CHIP_BUILD_TESTS) -chip_gn_arg_bool ("chip_build_libshell" CONFIG_CHIP_LIB_SHELL) +matter_common_gn_args( + DEBUG CONFIG_DEBUG + LIB_SHELL CONFIG_CHIP_LIB_SHELL + LIB_TESTS CONFIG_CHIP_BUILD_TESTS + LIB_PW_RPC CONFIG_CHIP_PW_RPC + PROJECT_CONFIG ${CONFIG_CHIP_PROJECT_CONFIG} +) +matter_add_gn_arg_string("zephyr_ar" ${CMAKE_AR}) +matter_add_gn_arg_string("zephyr_cc" ${CMAKE_C_COMPILER}) +matter_add_gn_arg_string("zephyr_cxx" ${CMAKE_CXX_COMPILER}) +matter_add_gn_arg_bool ("chip_enable_openthread" CONFIG_NET_L2_OPENTHREAD) +matter_add_gn_arg_bool ("chip_openthread_ftd" CONFIG_OPENTHREAD_FTD) +matter_add_gn_arg_bool ("chip_inet_config_enable_ipv4" CONFIG_NET_IPV4) +matter_add_gn_arg_bool ("chip_inet_config_enable_tcp_endpoint" CONFIG_CHIP_BUILD_TESTS) if (CONFIG_CHIP_ENABLE_DNSSD_SRP) - chip_gn_arg_string("chip_mdns" "platform") + matter_add_gn_arg_string("chip_mdns" "platform") endif() -file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/args.gn CONTENT ${CHIP_GN_ARGS}) +matter_generate_args_tmp_file() # ============================================================================== -# Define 'chip-gn' target that builds CHIP library(ies) with GN build system +# Build chip library # ============================================================================== - -ExternalProject_Add( - chip-gn - PREFIX ${CMAKE_CURRENT_BINARY_DIR} - SOURCE_DIR ${CHIP_ROOT} - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR} - CONFIGURE_COMMAND ${GN_EXECUTABLE} - --root=${CHIP_ROOT} - --root-target=${GN_ROOT_TARGET} - --dotfile=${GN_ROOT_TARGET}/.gn - --script-executable=${Python3_EXECUTABLE} - gen --check --fail-on-unused-args ${CMAKE_CURRENT_BINARY_DIR} - BUILD_COMMAND ninja - INSTALL_COMMAND "" - BUILD_BYPRODUCTS ${CHIP_LIBRARIES} - BUILD_ALWAYS TRUE - USES_TERMINAL_CONFIGURE TRUE - USES_TERMINAL_BUILD TRUE +matter_build(chip + LIB_SHELL ${CONFIG_CHIP_LIB_SHELL} + LIB_PW_RPC ${CONFIG_CHIP_PW_RPC} + LIB_TESTS ${CONFIG_CHIP_BUILD_TESTS} + GN_DEPENDENCIES kernel ) -add_dependencies(chip-gn kernel) - -# ============================================================================== -# Define 'chip' target that exposes CHIP headers & libraries to the application -# ============================================================================== - -zephyr_interface_library_named(chip) -target_compile_definitions(chip INTERFACE CHIP_HAVE_CONFIG_H) -target_include_directories(chip INTERFACE - ${CHIP_ROOT}/src - ${CHIP_ROOT}/src/include - ${CHIP_ROOT}/src/lib - ${CHIP_ROOT}/third_party/nlassert/repo/include - ${CMAKE_CURRENT_BINARY_DIR}/gen/include -) -target_link_directories(chip INTERFACE ${CMAKE_CURRENT_BINARY_DIR}/lib) - -if (CONFIG_CHIP_LIB_SHELL) - target_link_options(chip INTERFACE -Wl,--whole-archive -lCHIPShell -Wl,--no-whole-archive) -endif() - -target_link_libraries(chip INTERFACE -Wl,--start-group ${CHIP_LIBRARIES} -Wl,--end-group) -add_dependencies(chip chip-gn) +set_property(GLOBAL APPEND PROPERTY ZEPHYR_INTERFACE_LIBS chip) endif() # CONFIG_CHIP \ No newline at end of file diff --git a/config/zephyr/chip-module/make_gn_args.py b/config/zephyr/chip-module/make_gn_args.py deleted file mode 100644 index f30cd459a6e7d4..00000000000000 --- a/config/zephyr/chip-module/make_gn_args.py +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env python3 - -# -# Copyright (c) 2021 Project CHIP Authors -# All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -import argparse -import re -import sys - -GN_SPECIAL_CHARACTERS = r'(["$\\])' -GN_CFLAG_EXCLUDES = [ - '-fno-asynchronous-unwind-tables', - '-fno-common', - '-fno-defer-pop', - '-fno-reorder-functions', - '-ffunction-sections', - '-fdata-sections', - '-g*', - '-O*', - '-W*', -] - - -def escape_strings(gn_args): - return [[key, re.sub(GN_SPECIAL_CHARACTERS, r'\\\1', value)] for key, value in gn_args] - - -def write_gn_args(args): - if args.module: - sys.stdout.write('import("{}")\n'.format(args.module)) - - for key, value in args.arg: - sys.stdout.write('{} = {}\n'.format(key, value)) - - for key, value in args.arg_string: - sys.stdout.write('{} = "{}"\n'.format(key, value)) - - cflag_excludes = ', '.join(['"{}"'.format(exclude) - for exclude in GN_CFLAG_EXCLUDES]) - - for key, value in args.arg_cflags: - sys.stdout.write('{} = filter_exclude(string_split("{}"), [{}])\n'.format( - key, value, cflag_excludes)) - - -def main(): - parser = argparse.ArgumentParser(fromfile_prefix_chars='@') - parser.add_argument('--module', action='store') - parser.add_argument('--arg', action='append', nargs=2, default=[]) - parser.add_argument('--arg-string', action='append', nargs=2, default=[]) - parser.add_argument('--arg-cflags', action='append', nargs=2, default=[]) - args = parser.parse_args() - args.arg_string = escape_strings(args.arg_string) - args.arg_cflags = escape_strings(args.arg_cflags) - write_gn_args(args) - - -if __name__ == "__main__": - main() diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8000-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-8000-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8000-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8000-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8000-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-8000-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8000-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8000-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8000-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-8000-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8000-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8000-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8000-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-8000-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8000-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8000-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8001-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-8001-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8001-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8001-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8001-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-8001-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8001-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8001-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8001-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-8001-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8001-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8001-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8001-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-8001-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8001-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8001-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8002-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-8002-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8002-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8002-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8002-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-8002-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8002-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8002-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8002-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-8002-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8002-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8002-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8002-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-8002-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8002-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8002-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8003-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-8003-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8003-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8003-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8003-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-8003-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8003-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8003-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8003-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-8003-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8003-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8003-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8003-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-8003-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8003-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8003-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8004-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-8004-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8004-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8004-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8004-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-8004-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8004-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8004-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8004-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-8004-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8004-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8004-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8004-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-8004-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8004-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8004-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8005-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-8005-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8005-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8005-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8005-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-8005-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8005-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8005-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8005-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-8005-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8005-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8005-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8005-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-8005-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8005-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8005-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8006-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-8006-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8006-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8006-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8006-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-8006-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8006-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8006-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8006-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-8006-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8006-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8006-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8006-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-8006-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8006-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8006-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8007-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-8007-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8007-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8007-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8007-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-8007-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8007-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8007-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8007-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-8007-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8007-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8007-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8007-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-8007-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8007-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8007-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8008-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-8008-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8008-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8008-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8008-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-8008-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8008-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8008-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8008-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-8008-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8008-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8008-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8008-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-8008-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8008-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8008-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8009-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-8009-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8009-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8009-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8009-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-8009-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8009-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8009-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8009-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-8009-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8009-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8009-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8009-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-8009-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8009-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8009-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-800A-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-800A-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-800A-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-800A-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-800A-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-800A-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-800A-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-800A-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-800A-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-800A-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-800A-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-800A-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-800A-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-800A-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-800A-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-800A-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-800B-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-800B-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-800B-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-800B-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-800B-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-800B-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-800B-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-800B-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-800B-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-800B-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-800B-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-800B-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-800B-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-800B-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-800B-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-800B-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-800C-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-800C-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-800C-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-800C-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-800C-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-800C-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-800C-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-800C-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-800C-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-800C-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-800C-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-800C-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-800C-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-800C-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-800C-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-800C-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-800D-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-800D-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-800D-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-800D-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-800D-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-800D-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-800D-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-800D-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-800D-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-800D-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-800D-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-800D-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-800D-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-800D-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-800D-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-800D-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-800E-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-800E-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-800E-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-800E-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-800E-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-800E-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-800E-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-800E-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-800E-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-800E-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-800E-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-800E-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-800E-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-800E-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-800E-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-800E-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-800F-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-800F-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-800F-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-800F-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-800F-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-800F-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-800F-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-800F-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-800F-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-800F-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-800F-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-800F-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-800F-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-800F-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-800F-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-800F-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8010-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-8010-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8010-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8010-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8010-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-8010-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8010-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8010-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8010-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-8010-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8010-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8010-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8010-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-8010-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8010-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8010-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8011-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-8011-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8011-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8011-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8011-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-8011-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8011-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8011-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8011-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-8011-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8011-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8011-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8011-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-8011-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8011-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8011-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8012-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-8012-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8012-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8012-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8012-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-8012-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8012-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8012-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8012-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-8012-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8012-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8012-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8012-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-8012-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8012-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8012-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8013-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-8013-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8013-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8013-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8013-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-8013-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8013-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8013-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8013-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-8013-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8013-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8013-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8013-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-8013-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8013-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8013-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8014-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-8014-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8014-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8014-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8014-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-8014-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8014-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8014-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8014-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-8014-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8014-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8014-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8014-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-8014-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8014-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8014-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8015-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-8015-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8015-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8015-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8015-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-8015-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8015-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8015-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8015-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-8015-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8015-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8015-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8015-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-8015-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8015-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8015-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8016-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-8016-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8016-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8016-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8016-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-8016-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8016-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8016-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8016-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-8016-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8016-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8016-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8016-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-8016-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8016-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8016-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8017-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-8017-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8017-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8017-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8017-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-8017-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8017-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8017-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8017-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-8017-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8017-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8017-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8017-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-8017-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8017-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8017-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8018-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-8018-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8018-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8018-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8018-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-8018-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8018-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8018-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8018-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-8018-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8018-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8018-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8018-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-8018-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8018-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8018-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8019-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-8019-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8019-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8019-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8019-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-8019-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8019-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8019-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8019-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-8019-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8019-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8019-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-8019-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-8019-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-8019-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-8019-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-801A-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-801A-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-801A-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-801A-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-801A-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-801A-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-801A-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-801A-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-801A-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-801A-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-801A-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-801A-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-801A-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-801A-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-801A-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-801A-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-801B-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-801B-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-801B-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-801B-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-801B-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-801B-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-801B-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-801B-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-801B-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-801B-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-801B-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-801B-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-801B-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-801B-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-801B-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-801B-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-801C-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-801C-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-801C-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-801C-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-801C-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-801C-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-801C-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-801C-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-801C-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-801C-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-801C-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-801C-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-801C-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-801C-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-801C-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-801C-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-801D-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-801D-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-801D-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-801D-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-801D-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-801D-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-801D-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-801D-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-801D-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-801D-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-801D-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-801D-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-801D-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-801D-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-801D-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-801D-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-801E-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-801E-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-801E-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-801E-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-801E-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-801E-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-801E-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-801E-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-801E-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-801E-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-801E-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-801E-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-801E-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-801E-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-801E-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-801E-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-801F-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-801F-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-801F-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-801F-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-801F-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-801F-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-801F-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-801F-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-801F-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF2-801F-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-801F-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF2-801F-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF2-801F-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF2-801F-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF2-801F-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF2-801F-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8000-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-8000-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8000-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8000-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8000-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-8000-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8000-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8000-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8000-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-8000-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8000-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8000-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8000-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-8000-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8000-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8000-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8001-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-8001-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8001-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8001-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8001-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-8001-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8001-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8001-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8001-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-8001-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8001-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8001-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8001-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-8001-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8001-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8001-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8002-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-8002-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8002-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8002-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8002-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-8002-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8002-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8002-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8002-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-8002-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8002-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8002-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8002-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-8002-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8002-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8002-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8003-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-8003-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8003-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8003-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8003-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-8003-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8003-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8003-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8003-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-8003-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8003-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8003-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8003-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-8003-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8003-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8003-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8004-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-8004-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8004-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8004-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8004-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-8004-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8004-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8004-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8004-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-8004-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8004-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8004-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8004-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-8004-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8004-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8004-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8005-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-8005-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8005-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8005-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8005-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-8005-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8005-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8005-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8005-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-8005-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8005-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8005-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8005-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-8005-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8005-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8005-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8006-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-8006-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8006-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8006-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8006-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-8006-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8006-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8006-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8006-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-8006-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8006-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8006-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8006-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-8006-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8006-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8006-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8007-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-8007-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8007-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8007-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8007-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-8007-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8007-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8007-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8007-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-8007-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8007-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8007-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8007-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-8007-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8007-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8007-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8008-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-8008-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8008-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8008-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8008-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-8008-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8008-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8008-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8008-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-8008-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8008-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8008-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8008-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-8008-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8008-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8008-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8009-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-8009-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8009-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8009-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8009-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-8009-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8009-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8009-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8009-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-8009-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8009-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8009-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8009-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-8009-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8009-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8009-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-800A-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-800A-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-800A-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-800A-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-800A-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-800A-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-800A-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-800A-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-800A-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-800A-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-800A-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-800A-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-800A-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-800A-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-800A-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-800A-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-800B-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-800B-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-800B-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-800B-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-800B-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-800B-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-800B-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-800B-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-800B-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-800B-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-800B-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-800B-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-800B-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-800B-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-800B-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-800B-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-800C-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-800C-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-800C-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-800C-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-800C-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-800C-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-800C-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-800C-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-800C-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-800C-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-800C-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-800C-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-800C-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-800C-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-800C-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-800C-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-800D-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-800D-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-800D-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-800D-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-800D-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-800D-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-800D-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-800D-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-800D-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-800D-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-800D-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-800D-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-800D-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-800D-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-800D-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-800D-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-800E-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-800E-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-800E-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-800E-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-800E-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-800E-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-800E-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-800E-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-800E-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-800E-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-800E-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-800E-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-800E-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-800E-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-800E-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-800E-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-800F-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-800F-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-800F-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-800F-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-800F-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-800F-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-800F-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-800F-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-800F-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-800F-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-800F-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-800F-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-800F-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-800F-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-800F-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-800F-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8010-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-8010-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8010-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8010-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8010-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-8010-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8010-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8010-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8010-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-8010-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8010-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8010-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8010-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-8010-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8010-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8010-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8011-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-8011-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8011-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8011-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8011-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-8011-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8011-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8011-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8011-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-8011-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8011-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8011-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8011-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-8011-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8011-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8011-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8012-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-8012-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8012-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8012-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8012-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-8012-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8012-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8012-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8012-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-8012-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8012-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8012-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8012-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-8012-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8012-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8012-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8013-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-8013-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8013-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8013-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8013-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-8013-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8013-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8013-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8013-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-8013-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8013-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8013-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8013-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-8013-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8013-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8013-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8014-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-8014-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8014-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8014-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8014-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-8014-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8014-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8014-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8014-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-8014-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8014-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8014-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8014-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-8014-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8014-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8014-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8015-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-8015-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8015-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8015-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8015-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-8015-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8015-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8015-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8015-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-8015-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8015-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8015-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8015-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-8015-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8015-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8015-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8016-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-8016-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8016-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8016-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8016-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-8016-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8016-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8016-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8016-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-8016-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8016-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8016-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8016-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-8016-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8016-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8016-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8017-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-8017-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8017-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8017-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8017-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-8017-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8017-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8017-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8017-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-8017-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8017-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8017-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8017-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-8017-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8017-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8017-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8018-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-8018-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8018-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8018-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8018-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-8018-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8018-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8018-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8018-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-8018-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8018-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8018-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8018-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-8018-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8018-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8018-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8019-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-8019-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8019-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8019-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8019-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-8019-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8019-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8019-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8019-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-8019-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8019-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8019-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-8019-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-8019-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-8019-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-8019-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-801A-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-801A-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-801A-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-801A-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-801A-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-801A-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-801A-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-801A-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-801A-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-801A-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-801A-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-801A-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-801A-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-801A-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-801A-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-801A-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-801B-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-801B-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-801B-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-801B-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-801B-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-801B-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-801B-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-801B-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-801B-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-801B-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-801B-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-801B-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-801B-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-801B-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-801B-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-801B-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-801C-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-801C-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-801C-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-801C-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-801C-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-801C-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-801C-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-801C-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-801C-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-801C-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-801C-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-801C-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-801C-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-801C-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-801C-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-801C-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-801D-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-801D-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-801D-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-801D-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-801D-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-801D-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-801D-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-801D-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-801D-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-801D-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-801D-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-801D-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-801D-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-801D-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-801D-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-801D-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-801E-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-801E-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-801E-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-801E-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-801E-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-801E-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-801E-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-801E-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-801E-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-801E-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-801E-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-801E-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-801E-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-801E-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-801E-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-801E-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-801F-Cert.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-801F-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-801F-Cert.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-801F-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-801F-Cert.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-801F-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-801F-Cert.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-801F-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-801F-Key.der b/credentials/development/attestation/Matter-Development-DAC-FFF3-801F-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-801F-Key.der rename to credentials/development/attestation/Matter-Development-DAC-FFF3-801F-Key.der diff --git a/Credentials/development/attestation/Matter-Development-DAC-FFF3-801F-Key.pem b/credentials/development/attestation/Matter-Development-DAC-FFF3-801F-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-DAC-FFF3-801F-Key.pem rename to credentials/development/attestation/Matter-Development-DAC-FFF3-801F-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-PAI-FFF1-noPID-Cert.der b/credentials/development/attestation/Matter-Development-PAI-FFF1-noPID-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-PAI-FFF1-noPID-Cert.der rename to credentials/development/attestation/Matter-Development-PAI-FFF1-noPID-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-PAI-FFF1-noPID-Key.der b/credentials/development/attestation/Matter-Development-PAI-FFF1-noPID-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-PAI-FFF1-noPID-Key.der rename to credentials/development/attestation/Matter-Development-PAI-FFF1-noPID-Key.der diff --git a/Credentials/development/attestation/Matter-Development-PAI-FFF2-noPID-Cert.der b/credentials/development/attestation/Matter-Development-PAI-FFF2-noPID-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-PAI-FFF2-noPID-Cert.der rename to credentials/development/attestation/Matter-Development-PAI-FFF2-noPID-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-PAI-FFF2-noPID-Cert.pem b/credentials/development/attestation/Matter-Development-PAI-FFF2-noPID-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-PAI-FFF2-noPID-Cert.pem rename to credentials/development/attestation/Matter-Development-PAI-FFF2-noPID-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-PAI-FFF2-noPID-Key.der b/credentials/development/attestation/Matter-Development-PAI-FFF2-noPID-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-PAI-FFF2-noPID-Key.der rename to credentials/development/attestation/Matter-Development-PAI-FFF2-noPID-Key.der diff --git a/Credentials/development/attestation/Matter-Development-PAI-FFF2-noPID-Key.pem b/credentials/development/attestation/Matter-Development-PAI-FFF2-noPID-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-PAI-FFF2-noPID-Key.pem rename to credentials/development/attestation/Matter-Development-PAI-FFF2-noPID-Key.pem diff --git a/Credentials/development/attestation/Matter-Development-PAI-FFF3-noPID-Cert.der b/credentials/development/attestation/Matter-Development-PAI-FFF3-noPID-Cert.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-PAI-FFF3-noPID-Cert.der rename to credentials/development/attestation/Matter-Development-PAI-FFF3-noPID-Cert.der diff --git a/Credentials/development/attestation/Matter-Development-PAI-FFF3-noPID-Cert.pem b/credentials/development/attestation/Matter-Development-PAI-FFF3-noPID-Cert.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-PAI-FFF3-noPID-Cert.pem rename to credentials/development/attestation/Matter-Development-PAI-FFF3-noPID-Cert.pem diff --git a/Credentials/development/attestation/Matter-Development-PAI-FFF3-noPID-Key.der b/credentials/development/attestation/Matter-Development-PAI-FFF3-noPID-Key.der similarity index 100% rename from Credentials/development/attestation/Matter-Development-PAI-FFF3-noPID-Key.der rename to credentials/development/attestation/Matter-Development-PAI-FFF3-noPID-Key.der diff --git a/Credentials/development/attestation/Matter-Development-PAI-FFF3-noPID-Key.pem b/credentials/development/attestation/Matter-Development-PAI-FFF3-noPID-Key.pem similarity index 100% rename from Credentials/development/attestation/Matter-Development-PAI-FFF3-noPID-Key.pem rename to credentials/development/attestation/Matter-Development-PAI-FFF3-noPID-Key.pem diff --git a/docs/guides/BUILDING.md b/docs/guides/BUILDING.md index 662ccebdf4c763..78ad0ecd0d6e0a 100644 --- a/docs/guides/BUILDING.md +++ b/docs/guides/BUILDING.md @@ -4,16 +4,20 @@ Matter supports configuring the build with [GN](https://gn.googlesource.com/gn/), a fast and scalable meta-build system that generates inputs to [ninja](https://ninja-build.org/). -Tested on: +## Tested Operating Systems + +The build system has been tested on the following Operating Systems: - macOS 10.15 - Debian 11 (64 bit required) - Ubuntu 22.04 LTS -Build system features: +## Build system features + +The Matter build system has the following features: - Very fast and small footprint -- Cross-platform handling: (Linux, Darwin, embedded arm, etc.) +- Cross-platform handling: Linux, Darwin, Embedded Arm, among others - Multiple toolchains & cross toolchain dependencies - Integrates automated testing framework: `ninja check` - Introspection: `gn desc` @@ -21,13 +25,16 @@ Build system features: ## Checking out the Matter code -To check out the Matter repository: +To check out the Matter repository, run the following command: ``` git clone --recurse-submodules git@github.com:project-chip/connectedhomeip.git ``` -If you already have a checkout, run the following command to sync submodules: +## Synchronizing submodules + +If you already have the Matter code checked out, run the following command to +synchronize submodules: ``` git submodule update --init @@ -35,12 +42,12 @@ git submodule update --init ## Prerequisites -Before building, you'll need to install a few OS specific dependencies. +Before building, you must install a few OS specific dependencies. ### Installing prerequisites on Linux On Debian-based Linux distributions such as Ubuntu, these dependencies can be -satisfied with the following: +satisfied with the following command: ``` sudo apt-get install git gcc g++ pkg-config libssl-dev libdbus-1-dev \ @@ -54,58 +61,63 @@ On macOS, install Xcode from the Mac App Store. ### Installing prerequisites on Raspberry Pi 4 -Using `rpi-imager`, install the Ubuntu _22.04_ 64-bit _server_ OS for arm64 -architectures on a micro SD card. +Complete the following steps: -Boot the SD card, login with the default user account "ubuntu" and password -"ubuntu", then proceed with -[Installing prerequisites on Linux](#installing-prerequisites-on-linux). +1. Using `rpi-imager`, install the Ubuntu _22.04_ 64-bit _server_ OS for arm64 + architectures on a micro SD card. +1. Boot the SD card. +1. Log in with the default user account "ubuntu" and password "ubuntu" +1. Proceed with + [Installing prerequisites on Linux](#installing-prerequisites-on-linux). +1. Install some Raspberry Pi specific dependencies: -Finally, install some Raspberry Pi specific dependencies: + ``` + sudo apt-get install pi-bluetooth avahi-utils + ``` -``` -sudo apt-get install pi-bluetooth avahi-utils -``` +1. Reboot your Raspberry Pi after installing `pi-bluetooth`. -You need to reboot your RPi after install `pi-bluetooth`. +#### Configuring wpa_supplicant for storing permanent changes -By default, wpa_supplicant is not allowed to update (overwrite) configuration, -if you want the Matter app to be able to store the configuration changes -permanently, we need to make the following changes. +By default, wpa_supplicant is not allowed to update (overwrite) configuration. +If you want the Matter application to be able to store the configuration changes +permanently, you need to make the following changes: -1. Edit the dbus-fi.w1.wpa_supplicant1.service file to use configuration file - instead. +1. Edit the `dbus-fi.w1.wpa_supplicant1.service` file to use configuration file + instead by running the following command: -``` -sudo nano /etc/systemd/system/dbus-fi.w1.wpa_supplicant1.service -``` + ``` + sudo nano /etc/systemd/system/dbus-fi.w1.wpa_supplicant1.service + ``` -Change the wpa_supplicant start parameters to: +1. Run the following command to change the wpa_supplicant start parameters to + the provided values: -``` -ExecStart=/sbin/wpa_supplicant -u -s -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf -``` + ``` + ExecStart=/sbin/wpa_supplicant -u -s -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf + ``` -2. Add the wpa-supplicant configuration file +1. Add the `wpa-supplicant` configuration file by running the following command: -``` -sudo nano /etc/wpa_supplicant/wpa_supplicant.conf -``` + ``` + sudo nano /etc/wpa_supplicant/wpa_supplicant.conf + ``` -And add the following content to the file: +1. Add the following content to the `wpa-supplicant` file: -``` -ctrl_interface=DIR=/run/wpa_supplicant -update_config=1 -``` + ``` + ctrl_interface=DIR=/run/wpa_supplicant + update_config=1 + ``` -Finally, reboot your RPi. +1. Reboot your Raspberry Pi. -## Installing ZAP +## Installing ZAP tool -`bootstrap.sh` will download a compatible zap version and set it up in `$PATH`. -If you want to install/use a different version, you may download one from the -zap project [Releases](https://github.com/project-chip/zap/releases) +`bootstrap.sh` will download a compatible ZAP tool version and set it up in +`$PATH`. If you want to install or use a different version of the tool, you may +download one from the ZAP project's +[Releases](https://github.com/project-chip/zap/releases) page. ### Linux ARM @@ -134,15 +146,20 @@ ENV ZAP_DEVELOPMENT_PATH=/opt/zap-${ZAP_VERSION} ### Which ZAP to use -ZAP scripting uses the following detection, in order: +The ZAP tool scripting uses the following detection, in order of importance: + +- `$ZAP_DEVELOPMENT_PATH` to point to a ZAP checkout. -- `$ZAP_DEVELOPMENT_PATH` to point to a zap checkout. Use this if you are - developing zap locally and would like to run zap with your changes + - Use this if you are developing ZAP locally and would like to run ZAP + with your changes. -- `$ZAP_INSTALL_PATH` to point to where `zap-linux.zip`/`zap-mac.zip` was - unpacked. This allows you to not need to place zap/zap-cli in `$PATH` +- `$ZAP_INSTALL_PATH` to point to where `zap-linux.zip` or `zap-mac.zip` was + unpacked. -- Otherwise scripts assume `zap-cli` or `zap` is available in `$PATH` + - This allows you to not need to place `zap` or `zap-cli` (or both) in + `$PATH`. + +- Otherwise, the scripts assume `zap-cli` or `zap` is available in `$PATH`. ## Prepare for building @@ -151,12 +168,16 @@ setup script should be sourced at the top level. This script takes care of downloading GN, ninja, and setting up a Python environment with libraries used to build and test. +Run the following command: + ``` source scripts/activate.sh ``` -If this script says the environment is out of date, it can be updated by -running: +### Updating the environment + +If the script says the environment is out of date, you can update it by running +the following command: ``` source scripts/bootstrap.sh @@ -167,7 +188,8 @@ is expensive, so avoid running it unless the environment is out of date. ## Build for the host OS (Linux or macOS) -This will build all sources, libraries, and tests for the host platform: +Run the following commands to build all sources, libraries, and tests for the +host platform: ``` source scripts/activate.sh @@ -177,8 +199,8 @@ gn gen out/host ninja -C out/host ``` -This generates a configuration suitable for debugging. To configure an optimized -build, specify `is_debug=false`: +These commands generate a configuration suitable for debugging. To configure an +optimized build, specify `is_debug=false`: ``` gn gen out/host --args='is_debug=false' @@ -186,38 +208,44 @@ gn gen out/host --args='is_debug=false' ninja -C out/host ``` -The directory name `out/host` can be any directory, although it's conventional -to build within the `out` directory. This example uses `host` to emphasize that -we're building for the host system. Different build directories can be used for -different configurations, or a single directory can be used and reconfigured as -necessary via `gn args`. +> **Note:** The directory name `out/host` can be any directory, although it's +> conventional to build within the `out` directory. This example uses `host` to +> emphasize building for the host system. Different build directories can be +> used for different configurations, or a single directory can be used and +> reconfigured as necessary via `gn args`. -To run all tests, run: +To run all tests, run the following command: ``` ninja -C out/host check ``` -To run only the tests in `src/inet/tests`, you can run: +To run only the tests in `src/inet/tests`, you can run the following command: ``` ninja -C out/host src/inet/tests:tests_run ``` -Note that the build system caches passing tests, so if you see +> **Note:** The build system caches passing tests, so you may see the following +> message: +> +> ``` +> ninja: no work to do +> ``` +> +> This means that the tests passed in a previous build. -``` -ninja: no work to do -``` +## Build custom configuration -that means that the tests passed in a previous build. +The build is configured by setting build arguments. These you can set in one of +the following manners: -## Build custom configuration +- Passing the `--args` option to `gn gen`. +- Running `gn args` on the output directory. +- Editing `args.gn` in the output directory. -The build is configured by setting build arguments. These are set by passing the -`--args` option to `gn gen`, by running `gn args` on the output directory, or by -hand editing `args.gn` in the output directory. To configure a new build or edit -the arguments to existing build, run: +To configure a new build or edit the arguments to existing build, run the +following command: ``` source scripts/activate.sh @@ -227,10 +255,10 @@ gn args out/custom ninja -C out/custom ``` -Two key builtin build arguments are `target_os` and `target_cpu`, which control -the OS & CPU of the build. +Two key built-in build arguments are `target_os` and `target_cpu`, which control +the OS and CPU of the build, respectively. -To see help for all available build arguments: +To see help for all available build arguments, run the following command: ``` gn gen out/custom @@ -239,10 +267,13 @@ gn args --list out/custom ## Build examples -Examples can be built in two ways, as separate projects that add Matter in the -third_party directory, or in the top level Matter project. +You can build examples in two ways. + +### Build examples as separate projects -To build the `chip-shell` example as a separate project: +To build examples as separate projects that add Matter in the +`third_party directory`, run the following command with the correct path to the +example (here, `chip-shell`): ``` cd examples/shell @@ -250,11 +281,15 @@ gn gen out/debug ninja -C out/debug ``` -To build it at the top level, see below under "Unified Builds". +### Build examples at the top level + +You can build examples at the top level of the Matter project. See the following +"Unified builds" section for details. ## Unified builds -To build a unified configuration that approximates the set of continuous builds: +To build a unified configuration that approximates the set of continuous builds, +run the following commands: ``` source scripts/activate.sh @@ -264,11 +299,12 @@ gn gen out/unified --args='is_debug=true target_os="all"' ninja -C out/unified all ``` -This can be used prior to change submission to configure, build, and test the -gcc, clang, mbedtls, & examples configurations all together in one parallel -build. Each configuration has a separate subdirectory in the output dir. +You can use this set of commands before changing a submission to configure, +build, and test the GCC, Clang, MbedTLS, and examples configurations all +together in one parallel build. Each configuration has a separate subdirectory +in the output directory. -This unified build can be used for day to day development, although it's more +This unified build can be used for day-to-day development, although it's more expensive to build everything for every edit. To save time, you can name the configuration to build: @@ -280,7 +316,7 @@ ninja -C out/unified check_host_gcc Replace `host_gcc` with the name of the configuration, which is found in the root `BUILD.gn`. -You can also fine tune the configurations generated via arguments such as: +You can also fine tune the configurations generated with arguments. For example: ``` gn gen out/unified --args='is_debug=true target_os="all" enable_host_clang_build=false' @@ -288,7 +324,7 @@ gn gen out/unified --args='is_debug=true target_os="all" enable_host_clang_build For a full list, see the root `BUILD.gn`. -Note that in the unified build, targets have multiple instances and need to be +In the unified build, targets have multiple instances and need to be disambiguated by adding a `(toolchain)` suffix. Use `gn ls out/debug` to list all of the target instances. For example: @@ -296,26 +332,22 @@ all of the target instances. For example: gn desc out/unified '//src/controller(//build/toolchain/host:linux_x64_clang)' ``` -Note: Some platforms that can be built as part of the unified build require -downloading additional tools. To add these to the build, the location must be -provided as a build argument. For example, to add the Simplelink cc13x2_26x2 -examples to the unified build, install -[SysConfig](https://www.ti.com/tool/SYSCONFIG) and add the following build -arguments: - -``` -gn gen out/unified --args="target_os=\"all\" enable_ti_simplelink_builds=true ti_sysconfig_root=\"/path/to/sysconfig\"" -``` +> **Note:** Some platforms that can be built as part of the unified build +> require downloading additional tools. To add these to the build, the location +> must be provided as a build argument. For example, to add the Simplelink +> cc13x2_26x2 examples to the unified build, install +> [SysConfig](https://www.ti.com/tool/SYSCONFIG) and add the following build +> arguments: +> +> ``` +> gn gen out/unified --args="target_os=\"all\" enable_ti_simplelink_builds=true > ti_sysconfig_root=\"/path/to/sysconfig\"" +> ``` ## Getting help -GN has builtin help via +GN has integrated help that you can access with the `gn help` command. -``` -gn help -``` - -Recommended topics: +Make sure to check the following recommended topics: ``` gn help execution @@ -328,70 +360,73 @@ Also see the ## Introspection -GN has various introspection tools to help examine the build configuration. +GN has various introspection tools to help you examine the build configuration. +The following examples use the `out/host` output directory as example: -To show all of the targets in an output directory: +- Show all of the targets in an output directory: -``` -gn ls out/host -``` + ``` + gn ls out/host + ``` -To show all of the files that will be built: +- Show all of the files that will be built: -``` -gn outputs out/host '*' -``` + ``` + gn outputs out/host '*' + ``` -To show the GN representation of a configured target: +- Show the GN representation of a configured target: -``` -gn desc out/host //src/inet --all -``` + ``` + gn desc out/host //src/inet --all + ``` -To dump the GN representation of the entire build as JSON: +- Dump the GN representation of the entire build as JSON: -``` -gn desc out/host/ '*' --all --format=json -``` + ``` + gn desc out/host/ '*' --all --format=json + ``` -To show the dependency tree: +- Show the dependency tree: -``` -gn desc out/host //:all deps --tree --all -``` + ``` + gn desc out/host //:all deps --tree --all + ``` -To find dependency paths: +- Find dependency paths: -``` -gn path out/host //src/transport/tests:tests //src/system -``` + ``` + gn path out/host //src/transport/tests:tests //src/system + ``` -To list useful information for linking against libCHIP: +- List useful information for linking against `libCHIP`: -``` -gn desc out/host //src/lib include_dirs -gn desc out/host //src/lib defines -gn desc out/host //src/lib outputs + ``` + gn desc out/host //src/lib include_dirs + gn desc out/host //src/lib defines + gn desc out/host //src/lib outputs -# everything as JSON -gn desc out/host //src/lib --format=json -``` + # everything as JSON + gn desc out/host //src/lib --format=json + ``` ## Coverage -Code coverage scripts generate a report that details how much of the Matter SDK -source code has been executed, it also gives information on how often the Matter -SDK executes segments of code and produces a copy of the source file, annotated -with execution frequencies. +The code coverage script generates a report that details how much of the Matter +SDK source code has been executed. It also provides information on how often the +Matter SDK executes segments of the code and produces a copy of the source file, +annotated with execution frequencies. + +Run the following command to initiate the script: ``` ./scripts/build_coverage.sh ``` -By default, Code coverage is performed at the unit testing level. Unit tests are -created by developers, thus giving them the best vantage from which to decide -what tests to include in unit testing. But you can extend the coverage test by -scope and ways of execution with the following parameters: +By default, the code coverage script is performed at the unit testing level. +Unit tests are created by developers, thus giving them the best overview of what +tests to include in unit testing. You can extend the coverage test by scope and +ways of execution with the following parameters: ``` -c, --code Specify which scope to collect coverage data. @@ -404,7 +439,7 @@ scope and ways of execution with the following parameters: 'all': Run unit & yaml test to drive the coverage check. ``` -Also see the up-to-date unit testing coverage report of the Matter SDK +Also, see the up-to-date unit testing coverage report of the Matter SDK (collected daily) at: [matter coverage](https://matter-build-automation.ue.r.appspot.com). diff --git a/docs/guides/access-control-guide.md b/docs/guides/access-control-guide.md index d82ec309b8b8b9..6aa20e032825d5 100644 --- a/docs/guides/access-control-guide.md +++ b/docs/guides/access-control-guide.md @@ -1,8 +1,21 @@ # Access Control Guide -All Interaction Model operations (read attribute, write attribute, invoke -command, read event) are governed by access control, and will be denied (status -0x7E Access Denied) if sufficient privilege for the operation is not obtained. +All Interaction Model operations in Matter must be verified by the the Access +Control mechanism. + +Whenever a client device and a server device want to interact with one another +by reading (or subscribing) attributes or events, writing attributes, or +invoking commands, the Access Control mechanism must verify that the client has +sufficient privileges to perform the operation on the server device. + +If no sufficient privilege is obtained, the operation cannot take place and it +is denied (status `0x7E Access Denied`). + +This guide describes how the Access Control mechanism works and how it is +implemented, and provides examples of Access Control Lists (ACLs) for different +use cases. + +
## Overview @@ -24,61 +37,67 @@ node. It is these ACLs that govern which Interaction Model operations are allowed or denied on that server node, for subjects on the fabric, via CASE and group messaging. -## ACLs +
-ACLs are fabric-scoped data structures with the following fields: +## Access Control Lists -- Privilege -- AuthMode -- Subjects -- Targets +Access Control Lists (ACLs) are fabric-scoped data structures with the following +fields: -### Privilege +- `Privilege` +- `AuthMode` +- `Subjects` +- `Targets` -Privileges are: +### Privilege field + +The `Privilege` can be of the following types: - View - Operate - Manage - Administer -An additional `ProxyView` privilege is not yet supported in the Matter SDK. +> **Note:** An additional `ProxyView` privilege is not yet supported in the +> Matter SDK. By default, the `View` privilege is required to read attributes or events, and the `Operate` privilege is required to write attributes or invoke commands. -However, clusters may require stricter privileges for certain operations on -certain endpoints. For example, the Access Control Cluster requires the -`Administer` privilege for all its operations. +Clusters may also require stricter privileges for certain operations on certain +endpoints. For example, the Access Control Cluster requires the `Administer` +privilege for all its operations. If applicable, the ACL grants the privilege, and all less strict privileges subsumed by it. Therefore an ACL for `Manage` privilege will work for operations which require `Operate` or `View` privilege (but not `Administer` privilege). -### AuthMode +### AuthMode field -Authentication modes are: +The `AuthMode`, that is authentication modes, can be as follow: - CASE - Group The ACL applies only to subjects using that authentication mode. -### Subjects +### Subjects field -Subjects is a list containing zero, one, or more subject identifiers, which are: +The `Subjects` field is a list containing zero, one, or more subject +identifiers, which are: -- Node ID for CASE auth mode -- Group ID for Group auth mode +- Node ID for CASE `AuthMode` +- Group ID for Group `AuthMode` A CASE subject may be a CAT, which has its own tag and version mechanism. The ACL applies only to the listed subjects; if no subjects are listed, the ACL applies to any subjects using the authentication mode. -### Targets +### Targets field -Targets is a list containing zero, one, or more structured entries with fields: +The `Targets` field is a list containing zero, one, or more structured entries +with fields: - Cluster - Endpoint @@ -86,20 +105,21 @@ Targets is a list containing zero, one, or more structured entries with fields: All fields are nullable, but at least one must be present, and the endpoint and device type fields are mutually exclusive (only one of those two may be -present). - -If cluster is present, the ACL is targeted to just that cluster. - -If endpoint is present, the ACL is targeted to just that endpoint. +present): -If device type is present, the ACL is targeted to just endpoints which contain -that device type (as reported by the Descriptor Cluster). +- If cluster is present, the ACL is targeted to just that cluster. +- If endpoint is present, the ACL is targeted to just that endpoint. +- If device type is present, the ACL is targeted to just endpoints which + contain that device type (as reported by the Descriptor Cluster). -Specifying device type in targets is not yet supported in the Matter SDK. +> **Note:** Specifying device type in targets is not yet supported in the Matter +> SDK. The ACL applies only to the listed targets; if no targets are listed, the ACL applies to any targets on the server node. +
+ ## Limitations and Restrictions The Matter Specification states that a Matter implementation must support at @@ -120,8 +140,12 @@ can be configured globally in `CHIPConfig.h` or per-app in - CHIP_CONFIG_EXAMPLE_ACCESS_CONTROL_MAX_SUBJECTS_PER_ENTRY - CHIP_CONFIG_EXAMPLE_ACCESS_CONTROL_MAX_TARGETS_PER_ENTRY +
+ ## Case Studies +This section provides use case examples for different ACL scenarios. + ### Single Administrator A single controller commissions a server node, providing its own CASE node ID @@ -174,17 +198,22 @@ Members of groups 123 and 456 are granted `Operate` privilege for the on/off cluster on any endpoint, any cluster on endpoint 1, and the level control cluster on endpoint 2. -## Managing ACLs Using Chip-Tool +
+ +## Managing ACLs using CHIP-Tool ### Usage +The following sections describe the requirements for managing ACLs using the +CHIP-Tool. + #### Entire List The Access Control Cluster's `ACL` attribute is a list. -Currently, list operations for single entries (append, update, delete) are not -yet supported in the Matter SDK, so the entire list must be written to the -attribute to change any ACL. +> **Note:** Currently, list operations for single entries (append, update, +> delete) are not yet supported in the Matter SDK, so the entire list must be +> written to the attribute to change any ACL. The write operation may employ multiple messages, making it unreliable. In any case, ACLs are updated as they are processed, and take effect immediately. @@ -215,38 +244,45 @@ When reading ACLs, the proper fabric index is shown. The tool requires numerical values for enums and identifiers. -The privileges are: +- Privilege values: -- View: 1 -- Operate: 3 -- Manage: 4 -- Administer: 5 + - View: 1 + - Operate: 3 + - Manage: 4 + - Administer: 5 -The authentication modes are: +- AuthMode values: -- CASE: 2 -- Group: 3 + - CASE: 2 + - Group: 3 -Some typical clusters: +- Values for some typical clusters: -- On/Off: 6 -- Level Control: 8 -- Descriptor: 29 -- Binding: 30 -- Access Control: 31 -- Basic: 40 + - On/Off: 6 + - Level Control: 8 + - Descriptor: 29 + - Binding: 30 + - Access Control: 31 + - Basic: 40 ### Examples -#### Automatically Installed ACL +This section provides examples of commands and ACL output for different +operations with the CHIP-Tool. -After commissioning with chip-tool, assuming `CaseAdminNode` is 112233, the -automatically installed ACL is: +#### Verification of the Automatically Installed ACL + +During commissioning with the CHIP-Tool, an ACL that assigns Administer rights +to the commissioner is automatically installed on the commissionee. This can be +verified using the following command: ``` out/debug/standalone/chip-tool accesscontrol read acl 1 0 ``` +Assuming the `CaseAdminNode` value is `112233`, the ACL command output for this +case is the following: + ``` Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0000 DataVersion: 2578401031 ACL: 1 entries @@ -262,10 +298,15 @@ Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0000 DataVersion: 2578401031 #### Installing a CASE ACL +The following command example requests the installation of a CASE ACL through a +write interaction: + ``` out/debug/standalone/chip-tool accesscontrol write acl '[{"fabricIndex": 0, "privilege": 5, "authMode": 2, "subjects": [112233], "targets": null}, {"fabricIndex": 0, "privilege": 1, "authMode": 2, "subjects": [4444, 5555, 6666], "targets": null}]' 1 0 ``` +The resulting ACL command output for this case can look like the following one: + ``` Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0000 DataVersion: 2578401034 ACL: 2 entries @@ -291,10 +332,15 @@ Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0000 DataVersion: 2578401034 #### Installing a Group ACL +The following command example requests the installation of a Group ACL through a +write interaction: + ``` out/debug/standalone/chip-tool accesscontrol write acl '[{"fabricIndex": 0, "privilege": 5, "authMode": 2, "subjects": [112233], "targets": null}, {"fabricIndex": 0, "privilege": 1, "authMode": 2, "subjects": [4444, 5555, 6666], "targets": null}, {"fabricIndex": 0, "privilege": 3, "authMode": 3, "subjects": [123, 456], "targets": [{"cluster": 6, "endpoint": null, "deviceType": null}, {"cluster": null, "endpoint": 1, "deviceType": null}, {"cluster": 8, "endpoint": 2, "deviceType": null}]}]' 1 0 ``` +The resulting ACL command output for this case can look like the following one: + ``` Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0000DataVersion: 2578401041 ACL: 3 entries @@ -342,22 +388,28 @@ Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0000DataVersion: 2578401041 } ``` -## Managing ACLs Using Chip-Repl +
+ +## Managing ACLs Using Chip-repl ### Usage +This section provides examples of commands and ACL output for different +operations with the CHIP-repl. + #### Entire List -See the important notes in the chip-tool section, as they also apply to -chip-repl. +See the important notes in the +[Managing ACLs using CHIP-Tool](#managing-acls-using-chip-tool) section, as they +also apply to the CHIP-repl. ### Null Fields Null fields may be omitted. -OK: `Target(cluster=6, endpoint=Null, deviceType=Null)` - -Also OK: `Target(cluster=6)` +This means that the following entry is acceptable: +`Target(cluster=6, endpoint=Null, deviceType=Null)`. Just as the following one: +`Target(cluster=6)`. The above assumes Target and Null are defined at global scope, which is not normally the case. @@ -366,15 +418,15 @@ normally the case. The `ACL` attribute is fabric-scoped, so each ACL has a fabric index. -The REPL ignores it when performing the actual write. Because null fields can be -omitted, simply do not provide it when writing ACLs. +The CHIP-repl ignores it when performing the actual write. Because null fields +can be omitted, simply do not provide it when writing ACLs. When reading ACLs, the proper fabric index is shown. #### Enums and Identifiers -The REPL accepts numerical values for enums and identifiers, but it also accepts -strongly typed values: +The CHIP-repl accepts numerical values for enums and identifiers, but it also +accepts strongly typed values: The privileges are: @@ -399,6 +451,9 @@ Some typical clusters: ### Examples +This section provides examples of commands and ACL output for different +operations with the CHIP-repl. + #### Automatically Installed ACL After commissioning with chip-repl, assuming `CaseAdminNode` is 1, the diff --git a/docs/guides/android_building.md b/docs/guides/android_building.md index d225d5e036129a..6f693e38efa5e3 100644 --- a/docs/guides/android_building.md +++ b/docs/guides/android_building.md @@ -103,9 +103,16 @@ JDK version on MacOS for Apple Silicon is 'openjdk 17.0.1' or above. Using JDK bundled with Android Studio will help with that. +Android Studio Dolphin and below: + ```shell export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jre/Contents/Home/ ``` +Android Studio Electric Eel 2022.1.1 and above: + +```shell +export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jbr/Contents/Home/ +```
diff --git a/docs/guides/chip_tool_guide.md b/docs/guides/chip_tool_guide.md index 220c850e90bb40..2bc999d9ecc5ac 100644 --- a/docs/guides/chip_tool_guide.md +++ b/docs/guides/chip_tool_guide.md @@ -3,18 +3,12 @@ The CHIP Tool (`chip-tool`) is a Matter controller implementation that allows to commission a Matter device into the network and to communicate with it using Matter messages, which may encode Data Model actions, such as cluster commands. + The tool also provides other utilities specific to Matter, such as parsing of the setup payload or performing discovery actions.
-- [Source files](#source-files) -- [Building and running the CHIP Tool](#building-and-running-the-chip-tool) -- [Using the CHIP Tool for Matter device testing](#using-chip-tool-for-matter-device-testing) -- [Supported commands and options](#supported-commands-and-options) - -
- ## Source files You can find source files of the CHIP Tool in the `examples/chip-tool` @@ -72,11 +66,10 @@ cases are described in the ## Using CHIP Tool for Matter device testing -This section describes how to use CHIP Tool to test the Matter device. The -following steps depend on the application clusters that you implemented on the -device. +The following steps depend on the application clusters that you implemented on +the device. -This tutorial is using the +The steps are using the [Matter Lighting Application Example](https://github.com/project-chip/connectedhomeip/tree/master/examples/lighting-app) with the Bluetooth LE commissioning method support. You can use other Matter examples and still follow this procedure. If you use a different example, the @@ -93,10 +86,10 @@ documentation. Some examples are configured to advertise automatically on boot. Other examples require physical trigger, for example pushing a button. Follow the documentation -of the Matter device example to learn how Bluetooth LE advertising is enabled -for the given example. +of the Matter device example for the chosen platform to learn how Bluetooth LE +advertising is enabled for the given example. -### Step 3: Make sure the IP network is set up +### Step 3: Set up the IP network To follow the next steps, the IP network must be up and running. For instance, the Thread network can be established using @@ -110,9 +103,9 @@ such as Thread or Wi-Fi. The Matter specification does not define the preferred way of how the network credentials are to be obtained by controller. In this guide, we are going to -obtain Thread network credentials. +provide steps for obtaining Thread and Wi-Fi network credentials. -#### Thread network credentials +#### Obtaining Thread network credentials Fetch and store the current Active Operational Dataset from the Thread Border Router. This step may vary depending on the Thread Border Router implementation. @@ -140,10 +133,10 @@ If you are using For Thread, you might also use a different out-of-band method to fetch the network credentials. -#### Wi-Fi network credentials +#### Obtaining Wi-Fi network credentials You must get the following Wi-Fi network credentials to commission the Matter -device to the Wi-Fi network in the following steps: +device to the Wi-Fi network: - Wi-Fi SSID - Wi-Fi password @@ -154,10 +147,14 @@ administrator. ### Step 5: Determine Matter device's discriminator and setup PIN code -Matter uses a 12-bit value called _discriminator_ to discern between multiple -commissionable device advertisements and a 27-bit _setup PIN code_ to -authenticate the device. You can find these values in the logging terminal of -the device (for instance, UART) when the device boots up. For example: +Matter uses the following values: + +- Discriminator - A 12-bit value used to discern between multiple + commissionable device advertisements. +- Setup PIN code - A 27-bit value used to authenticate the device. + +You can find these values in the logging terminal of the device (for instance +UART) when the device boots up. For example: ``` I: 254 [DL]Device Configuration: @@ -171,36 +168,40 @@ I: 278 [DL] Manufacturing Date: (not set) I: 281 [DL] Device Type: 65535 (0xFFFF) ``` -In above printout, the _discriminator_ is `3840 (0xF00)` and the _setup PIN -code_ is equal to `20202021`. +In this printout, the discriminator is `3840 (0xF00)` and the setup PIN code is +`20202021`. -### Step 6: Commission Matter device into existing IP network +### Step 6: Commission Matter device into an existing IP network Before communicating with the Matter device, first it must join an existing IP network. -Matter devices may use different commissioning channel. Typically, devices which -are not yet connected to the target IP network use Bluetooth LE as the -commissioning channel. However, if the device has already joined an IP network, -the only thing needed is to commission it to the Matter network over the IP -protocol. +Matter devices can use different commissioning channels: + +- Devices that are not yet connected to the target IP network use Bluetooth LE + as the commissioning channel. +- Devices that have already joined an IP network only need to use the IP + protocol for commissioning to the Matter network. #### Commissioning over Bluetooth LE -This section describes how your device can join the existing IP network over -Bluetooth LE and then be commissioned into a Matter network. +In this case, your device can join the existing IP network over Bluetooth LE and +then be commissioned into a Matter network. + +Different scenarios are available for Thread and Wi-Fi networks, as described in +the following subsections. -After connecting the device over Bluetooth LE, the controller will print the +After connecting the device over Bluetooth LE, the controller prints the following log: ``` Secure Session to Device Established ``` -This log will mean that the PASE (Password-Authenticated Session Establishment) -session using SPAKE2+ protocol has been established. +This log message means that the PASE (Password-Authenticated Session +Establishment) session using SPAKE2+ protocol has been established. -##### Commissioning into Thread network over Bluetooth LE +##### Commissioning into a Thread network over Bluetooth LE To commission the device to the existing Thread network, use the following command pattern: @@ -218,7 +219,7 @@ In this command: the [step 5](#step-5-determine-matter-devices-discriminator-and-setup-pin-code). -##### Commissioning into Wi-Fi network over Bluetooth LE +##### Commissioning into a Wi-Fi network over Bluetooth LE To commission the device to the existing Wi-Fi network, use the following command pattern: @@ -250,13 +251,14 @@ This option is available when the Matter device is already present in an IP network, but it has not been commissioned to a Matter network yet. To commission the device, you can use either the setup PIN code or the setup PIN -code and the discriminator, both of which you obtained in the step 5. +code and the discriminator, both of which you obtained in the +[step 5](#step-5-determine-matter-devices-discriminator-and-setup-pin-code). Alternatively, you can also use a QR code payload. ##### Commissioning with setup PIN code -Use the following command pattern to discover devices and try to pair with the -first discovered one using the provided setup code: +To discover devices and try to pair with the first discovered device using the +provided setup code, use the following command pattern: ``` $ ./chip-tool pairing onnetwork @@ -271,8 +273,8 @@ In this command: ##### Commissioning with long discriminator -Use the following command pattern to discover devices with a long discriminator -and try to pair with the first discovered one using the provided setup code. +To discover devices with a long discriminator and try to pair with the first +discovered one using the provided setup code, use the following command pattern: ``` $ ./chip-tool pairing onnetwork-long @@ -289,8 +291,9 @@ In this command: Matter devices log the QR code payload and manual pairing code when they boot. -Use the following command pattern to discover devices based on the given QR code -payload or manual pairing code and try to pair with the first discovered one: +To discover devices based on the given QR code payload or manual pairing code +and try to pair with the first discovered one, use the following command +pattern: ``` $ ./chip-tool pairing code @@ -305,8 +308,8 @@ In this command: #### Forgetting the already-commissioned device -The following command removes the device with the given node ID from the list of -commissioned Matter devices: +In case commissioning needs to be retested, the following command removes the +device with the given node ID from the list of commissioned Matter devices: ``` $ ./chip-tool pairing unpair @@ -321,39 +324,43 @@ Having completed all previous steps, you have the Matter device successfully commissioned to the network. You can now test the device by interacting with Data Model clusters. -For instance, in case of the lighting application, the application has the -On/Off and Level Control clusters implemented. This means that you can test it -by toggling the bulb (using the `onoff` cluster commands) or manipulating its -brightness (using the `levelcontrol` cluster commands). +#### Example: Matter Lighting Application Example -Use the following command pattern to toggle the LED state: +In case of the Matter Lighting Application Example we referenced in step 1, the +application implements the On/Off and Level Control clusters. This means that +you can test it by toggling the bulb (using the `onoff` cluster commands) or by +manipulating its brightness (using the `levelcontrol` cluster commands): -``` -$ ./chip-tool onoff toggle -``` +- Use the following command pattern to toggle the OnOff attribute state (e.g. + visualized by the LED state): -In this command: + ``` + $ ./chip-tool onoff toggle + ``` -- __ is the user-defined ID of the commissioned node. -- __ is the ID of the endpoint with OnOff cluster implemented. + In this command: -Alternatively, use the following command pattern to change the brightness of the -LED: + - __ is the user-defined ID of the commissioned node. + - __ is the ID of the endpoint with OnOff cluster + implemented. -``` -$ ./chip-tool levelcontrol move-to-level -``` +- Use the following command pattern to change the value of the CurrentLevel + attribute (e.g. visualized by the LED brightness): -In this command: + ``` + $ ./chip-tool levelcontrol move-to-level + ``` -- __ is the brightness level encoded between `0` and `254`, unless a - custom range is configured in the cluster. -- __ is the transition time. -- __ is the option mask. -- __ is the option override. -- __ is the user-defined ID of the commissioned node. -- __ is the ID of the endpoint with LevelControl cluster - implemented. + In this command: + + - __ is the brightness level encoded between `0` and `254`, unless + a custom range is configured in the cluster. + - __ is the transition time. + - __ is the option mask. + - __ is the option override. + - __ is the user-defined ID of the commissioned node. + - __ is the ID of the endpoint with LevelControl cluster + implemented. ### Step 8: Read basic information from the Matter device @@ -389,34 +396,44 @@ $ ./chip-tool basic This section contains a general list of various CHIP Tool commands and options, not limited to commissioning procedure and cluster interaction. -### Interactive mode versus single command mode +### Interactive mode versus single-command mode -By default, chip-tool runs in single command mode where if any single command -does not complete within a certain timeout period, chip-tool will exit with a -timeout error. +The CHIP Tool can run in one of the following modes: -Example of error: +- Single-command mode (default) - In this mode, the CHIP Tool will exit with a + timeout error if any single command does not complete within a certain + timeout period. -``` -[1650992689511] [32397:1415601] CHIP: [TOO] Run command failure: ../../../examples/chip-tool/commands/common/CHIPCommand.cpp:392: CHIP Error 0x00000032: Timeout -``` + The timeout error will look similar to the following one: + + ``` + [1650992689511] [32397:1415601] CHIP: [TOO] Run command failure: ../../../examples/chip-tool/commands/common/CHIPCommand.cpp:392: CHIP Error 0x00000032: Timeout + ``` + +- Interactive mode - In this mode, a command will terminate with an error if + it does not complete within the timeout period. However, the CHIP Tool will + not be terminated and it will not terminate processes that previous commands + have started. + +#### Modifying timeout duration in single-command mode This timeout can be modified for any command execution by supplying the optional `--timeout` parameter, which takes a value in seconds, with the maximum being 65535 seconds. -Example of command: +**Example of command:** ``` $ ./chip-tool otasoftwareupdaterequestor subscribe-event state-transition 5 10 0x1234567890 0 --timeout 65535 ``` +#### Starting the interactive mode + For commands such as event subscriptions that need to run for an extended period -of time, chip-tool can be started in interactive mode first before running the -command. In interactive mode, there will be no timeout and multiple commands can -be issued. +of time, the CHIP Tool can be started in interactive mode first before running +the command. -Example of command: +**Example of command:** ``` $ ./chip-tool interactive start @@ -606,10 +623,11 @@ $ ./chip-tool pairing ble-thread 1 hex:0e080000000000010000000300001335060004001 ##### Using message tracing -Message tracing allows to capture CHIP Tool secure messages that can be used for -test automation. +Message tracing allows capturing CHIP Tool secure messages that can be used for +test automation. The tracing uses several types of flags that control where the +traces should go. -The following flags that control where the traces should go are available: +The following flags are available: - Trace file flag: @@ -638,43 +656,25 @@ The following flags that control where the traces should go are available: The CHIP Tool allows to run a set of tests, already compiled in the tool, against a paired Matter device. -To get the list of available tests, run the following command: - -``` -$ ./chip-tool tests -``` - -To execute a particular test against the paired device, use the following -command pattern: - -``` -$ ./chip-tool tests -``` - -In this command: - -- __ is the name of the particular test. +- To get the list of available tests, run the following command: -#### Example: running `TestClusters` test + ``` + $ ./chip-tool tests + ``` -As an example of running one test suite test: +- To execute a particular test against the paired device, use the following + command pattern: -``` -# Clean initialization of state. -rm -fr /tmp/chip_* + ``` + $ ./chip-tool tests + ``` -# In a shell window, start the DUT device. -./out/debug/standalone/chip-all-clusters-app + In this command: -# In a second shell window, pair the DUT with chip-tool. -./out/debug/standalone/chip-tool pairing onnetwork 333221 20202021 + - __ is the name of the particular test. -# Now run the test -./out/debug/standalone/chip-tool tests TestCluster --nodeId 333221 -``` - -Developer details on how the test suite is structured can be found -[here](../../src/app/tests/suites/README.md). +See the [Examples](#running-testclusters-test) section for an example of how to +run a test from the test suite. ### Parsing the setup payload @@ -695,15 +695,15 @@ Here, __ is the ID of the payload to be parsed. - Setup QR code payload: - ``` - $ ./chip-tool payload parse-setup-payload MT:6FCJ142C00KA0648G00 - ``` + ``` + $ ./chip-tool payload parse-setup-payload MT:6FCJ142C00KA0648G00 + ``` - Manual pairing code: - ``` - $ ./chip-tool payload parse-setup-payload 34970112332 - ``` + ``` + $ ./chip-tool payload parse-setup-payload 34970112332 + ``` ### Parsing additional data payload @@ -868,19 +868,50 @@ In this command: - __ is the ID of the endpoint on which the `binding` cluster is implemented. +##### Running `TestClusters` test + +Complete the following steps to +[run one test from the test suite](#running-a-test-suite-against-a-paired-peer-device): + +1. Clean the initialization of state using the following command: + ``` + rm -fr /tmp/chip_* + ``` +1. In a shell window, start the DUT device: + ``` + ./out/debug/standalone/chip-all-clusters-app + ``` +1. In a second shell window, pair the DUT with the CHIP Tool: + ``` + ./out/debug/standalone/chip-tool pairing onnetwork 333221 20202021 + ``` +1. Run the test with the following command: + ``` + ./out/debug/standalone/chip-tool tests TestCluster --nodeId 333221 + ``` + +Read the [CHIP Test Suits](../../src/app/tests/suites/README.md) page for more +information about how the test suite is structured. + ### Multi-admin scenario Multi-admin feature allows you to join Matter device to several Matter fabrics -and administer it by several different Matter administrators. First you need to -commission the Matter device to first fabric following the +and have several different Matter administrators administer it. + +Complete the steps mentioned in the following sections. + +#### Step 1: Commission to fabric + +Commission the Matter device to first fabric following the [Using CHIP Tool for Matter device testing](#using-chip-tool-for-matter-device-testing) section. -Before it is possible to commission a Matter device to a new fabric, the -administrator from first fabric must open the commissioning window for a new -administrator from another fabric. +#### Step 2: Open the commissioning window + +Make sure the administrator from the first fabric opens the commissioning window +for a new administrator from another fabric. -To open the commissioning window on the paired Matter device, use the following +Open the commissioning window on the paired Matter device by using the following command pattern: ``` @@ -889,15 +920,15 @@ $ ./chip-tool pairing open-commissioning-window