diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index dc47f2772e8b55..7e63af38cb99c8 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -17,7 +17,7 @@ "build": { "dockerfile": "Dockerfile", "args": { - "BUILD_VERSION": "0.6.47" + "BUILD_VERSION": "0.7.0" } }, "remoteUser": "vscode", diff --git a/.flake8 b/.flake8 index 03d013f52334a3..9ea57bd941d574 100644 --- a/.flake8 +++ b/.flake8 @@ -9,7 +9,6 @@ exclude = third_party # TODO: Remove the paths below when all bugs are fixed src/tools/chip-cert/* src/test_driver/mbed/* - src/test_driver/linux-cirque/* build/chip/java/tests/* build/chip/linux/* build/config/linux/* @@ -55,7 +54,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 @@ -91,6 +89,7 @@ exclude = third_party src/controller/python/chip/yaml/__init__.py src/controller/python/chip/yaml/format_converter.py src/controller/python/chip/yaml/runner.py + src/controller/python/py_matter_yamltest_repl_adapter/matter_yamltest_repl_adapter/runner.py src/lib/asn1/gen_asn1oid.py src/pybindings/pycontroller/build-chip-wheel.py src/pybindings/pycontroller/pychip/__init__.py diff --git a/.github/.wordlist.txt b/.github/.wordlist.txt index 2d43504f1cd83d..2e809977c1dc1a 100644 --- a/.github/.wordlist.txt +++ b/.github/.wordlist.txt @@ -434,6 +434,7 @@ Dnsmasq dnsmasqd DNSSD DNSStubListener +docbuild Dockerfile Dockerfiles Don'ts @@ -984,6 +985,7 @@ otatesting otaURL OTBR otcli +outform outgoingCommands OxygenConcentrationMeasurement OzoneConcentrationMeasurement @@ -1023,6 +1025,7 @@ Pigweed PinCode pinrequest pkgconfig +PKI plaintext PlatformManager PlatformManagerImpl @@ -1179,6 +1182,7 @@ sdkconfig SDKs SDKTARGETSYSROOT sdl +SecureCertDACProvider SED SEGGER semver @@ -1235,6 +1239,7 @@ softwareVersionStr SoftwareVersionString softwareVersionValid sphinxcontrib +SparkFun SPI spiflash spinel diff --git a/.github/workflows/bloat_check.yaml b/.github/workflows/bloat_check.yaml index b5de443569d2e6..17b890acb8d618 100644 --- a/.github/workflows/bloat_check.yaml +++ b/.github/workflows/bloat_check.yaml @@ -33,7 +33,7 @@ jobs: runs-on: ubuntu-latest container: - image: connectedhomeip/chip-build:0.6.47 + image: connectedhomeip/chip-build:0.7.0 steps: - uses: Wandalen/wretry.action@v1.0.36 diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d0daa83fc2fd35..7b3ef0fa68bbf2 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build:0.6.47 + image: connectedhomeip/chip-build:0.7.0 volumes: - "/tmp/log_output:/tmp/test_logs" options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 @@ -60,7 +60,7 @@ jobs: attempt_limit: 3 attempt_delay: 2000 - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform linux + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform linux - name: Try to ensure the directories for core dumping exist and we can write them. run: | @@ -77,7 +77,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Uploading bootstrap logs uses: actions/upload-artifact@v3 if: ${{ always() && !env.ACT }} @@ -148,7 +148,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build:0.6.47 + image: connectedhomeip/chip-build:0.7.0 volumes: - "/tmp/log_output:/tmp/test_logs" options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 @@ -177,7 +177,7 @@ jobs: # with: # languages: "cpp" - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform linux + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform linux - name: Try to ensure the directories for core dumping exist and we can write them. run: | @@ -194,7 +194,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Uploading bootstrap logs uses: actions/upload-artifact@v3 if: ${{ always() && !env.ACT }} @@ -261,6 +261,8 @@ jobs: run: | ./scripts/run_in_build_env.sh "./scripts/codepregen.py ./zzz_pregenerated" mv scripts/codegen.py scripts/codegen.py.renamed + - name: Clean output + run: rm -rf ./out - name: Build using build_examples.py (pregen) timeout-minutes: 60 run: | @@ -273,10 +275,10 @@ jobs: " - name: Check no code generation in output run: | - CNT=$(find -name "CHIPClusters.h" out | wc -l) + CNT=$(find out -name "CHIPClusters.h" | wc -l) if [ "${CNT}" != "0" ]; then echo "ERROR: found unexpected generated files:" - find -name "CHIPClusters.h" out + find out -name "CHIPClusters.h" exit 1 fi - name: Undo code pre-generation changes (make compile time codegen work again) @@ -318,7 +320,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build:0.6.47 + image: connectedhomeip/chip-build:0.7.0 volumes: - "/tmp/log_output:/tmp/test_logs" options: --sysctl "net.ipv6.conf.all.disable_ipv6=0 @@ -342,7 +344,7 @@ jobs: attempt_limit: 3 attempt_delay: 2000 - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform linux + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform linux - name: Bootstrap cache uses: actions/cache@v3 @@ -354,7 +356,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Setup Build, Run Build and Run Tests timeout-minutes: 50 @@ -398,7 +400,7 @@ jobs: # with: # languages: "cpp" - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform darwin + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform darwin - name: Try to ensure the directory for diagnostic log collection exists run: | mkdir -p ~/Library/Logs/DiagnosticReports || true @@ -413,7 +415,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 25 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Uploading bootstrap logs uses: actions/upload-artifact@v3 if: ${{ always() && !env.ACT }} @@ -485,7 +487,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build:0.6.47 + image: connectedhomeip/chip-build:0.7.0 volumes: - "/tmp/log_output:/tmp/test_logs" options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 @@ -501,7 +503,7 @@ jobs: attempt_limit: 3 attempt_delay: 2000 - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform linux + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform linux - name: Bootstrap cache uses: actions/cache@v3 @@ -513,7 +515,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Uploading bootstrap logs uses: actions/upload-artifact@v3 if: ${{ always() && !env.ACT }} diff --git a/.github/workflows/chef.yaml b/.github/workflows/chef.yaml index ab8622f64be6c4..ccad5e54903d51 100644 --- a/.github/workflows/chef.yaml +++ b/.github/workflows/chef.yaml @@ -30,7 +30,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build:0.6.47 + image: connectedhomeip/chip-build:0.7.0 options: --user root steps: @@ -43,7 +43,7 @@ jobs: attempt_limit: 3 attempt_delay: 2000 - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform linux + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform linux - name: Bootstrap cache uses: actions/cache@v3 timeout-minutes: 10 @@ -54,7 +54,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: CI Examples Linux shell: bash run: | @@ -66,7 +66,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-esp32:0.6.47 + image: connectedhomeip/chip-build-esp32:0.7.0 options: --user root steps: @@ -79,7 +79,7 @@ jobs: attempt_limit: 3 attempt_delay: 2000 - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform esp32 + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform esp32 - name: Bootstrap cache uses: actions/cache@v3 timeout-minutes: 10 @@ -90,7 +90,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: CI Examples ESP32 shell: bash run: | @@ -102,7 +102,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-nrf-platform:0.6.47 + image: connectedhomeip/chip-build-nrf-platform:0.7.0 options: --user root steps: @@ -115,7 +115,7 @@ jobs: attempt_limit: 3 attempt_delay: 2000 - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform nrfconnect + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform nrfconnect - name: Bootstrap cache uses: actions/cache@v3 timeout-minutes: 10 @@ -126,7 +126,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: CI Examples NRFConnect shell: bash run: | diff --git a/.github/workflows/cirque.yaml b/.github/workflows/cirque.yaml index ea5d4c3755c56d..ba63170544e724 100644 --- a/.github/workflows/cirque.yaml +++ b/.github/workflows/cirque.yaml @@ -30,7 +30,7 @@ jobs: timeout-minutes: 90 env: - DOCKER_RUN_VERSION: 0.6.47 + DOCKER_RUN_VERSION: 0.7.0 GITHUB_CACHE_PATH: /tmp/cirque-cache runs-on: ubuntu-latest @@ -39,7 +39,7 @@ jobs: # need to run with privilege, which isn't supported by job.XXX.contaner # https://github.com/actions/container-action/issues/2 # container: - # image: connectedhomeip/chip-build-cirque:0.6.47 + # image: connectedhomeip/chip-build-cirque:0.7.0 # volumes: # - "/tmp:/tmp" # - "/dev/pts:/dev/pts" @@ -58,7 +58,7 @@ jobs: attempt_limit: 3 attempt_delay: 2000 - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform linux + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform linux - name: Bootstrap cache uses: actions/cache@v3 @@ -75,7 +75,7 @@ jobs: integrations/docker/images/chip-build-cirque/run.sh \ -- sh -c " \ git config --global --add safe.directory '*' \ - && scripts/build/gn_bootstrap.sh \ + && bash scripts/bootstrap.sh \ && chown -R $(id -u):$(id -g) .environment \ " diff --git a/.github/workflows/darwin-tests.yaml b/.github/workflows/darwin-tests.yaml index a0c8642d557d04..face48a25e88e0 100644 --- a/.github/workflows/darwin-tests.yaml +++ b/.github/workflows/darwin-tests.yaml @@ -54,7 +54,7 @@ jobs: attempt_limit: 3 attempt_delay: 2000 - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform darwin + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform darwin - name: Setup Environment # coreutils for stdbuf run: brew install coreutils @@ -76,7 +76,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 25 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Uploading bootstrap logs uses: actions/upload-artifact@v3 if: ${{ always() && !env.ACT }} @@ -121,6 +121,19 @@ jobs: --tv-app ./out/darwin-x64-tv-app-${BUILD_VARIANT}/chip-tv-app \ --bridge-app ./out/darwin-x64-bridge-${BUILD_VARIANT}/chip-bridge-app \ " + - name: Run OTA Test + timeout-minutes: 5 + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/tests/run_darwin_framework_ota_test.py \ + run \ + --darwin-framework-tool ./out/darwin-x64-darwin-framework-tool-${BUILD_VARIANT}/darwin-framework-tool \ + --ota-requestor-app ./out/darwin-x64-ota-requestor-${BUILD_VARIANT}/chip-ota-requestor-app \ + --ota-data-file /tmp/rawImage \ + --ota-image-file /tmp/otaImage \ + --ota-destination-file /tmp/downloadedImage \ + --ota-candidate-file /tmp/otaCandidateJSON \ + " - name: Uploading core files uses: actions/upload-artifact@v3 if: ${{ failure() && !env.ACT }} diff --git a/.github/workflows/darwin.yaml b/.github/workflows/darwin.yaml index 5f054d177001bb..169606644a9e19 100644 --- a/.github/workflows/darwin.yaml +++ b/.github/workflows/darwin.yaml @@ -42,7 +42,7 @@ jobs: attempt_limit: 3 attempt_delay: 2000 - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform darwin + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform darwin - name: Setup Environment run: brew install python@3.9 @@ -56,7 +56,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 25 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Uploading bootstrap logs uses: actions/upload-artifact@v3 if: ${{ always() && !env.ACT }} @@ -68,7 +68,7 @@ jobs: - name: Block zap-cli from being used # xcodebuild is NOT expected to require zap-cli - run: scripts/run_in_build_env.sh 'mv $PW_ENVIRONMENT_ROOT/cipd/packages/zap/zap-cli $PW_ENVIRONMENT_ROOT/cipd/packages/zap/zap-cli.moved' + run: scripts/run_in_build_env.sh 'D=$(dirname $(which zap-cli)) && mv $D/zap-cli $D/zap-cli.moved' - name: Validate zap-cli is NOT available # run_in_build_env.sh is used to ensure PATH is set to something that would otherwise find zap-cli run: scripts/run_in_build_env.sh '(zap-cli --version && exit 1) || exit 0' @@ -112,7 +112,7 @@ jobs: run: xcodebuild clean working-directory: src/darwin/Framework - name: Make zap-cli work again - run: scripts/run_in_build_env.sh 'mv $PW_ENVIRONMENT_ROOT/cipd/packages/zap/zap-cli.moved $PW_ENVIRONMENT_ROOT/cipd/packages/zap/zap-cli' + run: scripts/run_in_build_env.sh 'D=$(dirname $(which zap-cli.moved)) && mv $D/zap-cli.moved $D/zap-cli' - name: Validate zap-cli is again available run: scripts/run_in_build_env.sh 'zap-cli --version' - name: Build example All Clusters Server @@ -126,7 +126,7 @@ jobs: - name: Build example OTA Requestor timeout-minutes: 10 run: | - scripts/examples/gn_build_example.sh examples/ota-requestor-app/linux out/debug chip_config_network_layer_ble=false + scripts/examples/gn_build_example.sh examples/ota-requestor-app/linux out/debug chip_config_network_layer_ble=false non_spec_compliant_ota_action_delay_floor=0 - name: Delete Defaults run: defaults delete com.apple.dt.xctest.tool continue-on-error: true @@ -139,6 +139,12 @@ jobs: run: | mkdir -p /tmp/darwin/framework-tests ../../../out/debug/chip-all-clusters-app --interface-id -1 > >(tee /tmp/darwin/framework-tests/all-cluster-app.log) 2> >(tee /tmp/darwin/framework-tests/all-cluster-app-err.log >&2) & + # Make each ota-requestor is using a different port, discriminator, and KVS from + # all-clusters-app and from other requestors. + # + # And a different port from the test harness too; the test harness uses port 5541. + ../../../out/debug/chip-ota-requestor-app --interface-id -1 --secured-device-port 5542 --discriminator 1111 --KVS /tmp/chip-ota-requestor-kvs1 --otaDownloadPath /tmp/chip-ota-requestor-downloaded-image1 --autoApplyImage > >(tee /tmp/darwin/framework-tests/ota-requestor-app-1.log) 2> >(tee /tmp/darwin/framework-tests/ota-requestor-app-err-1.log >&2) & + ../../../out/debug/chip-ota-requestor-app --interface-id -1 --secured-device-port 5543 --discriminator 1112 --KVS /tmp/chip-ota-requestor-kvs2 --otaDownloadPath /tmp/chip-ota-requestor-downloaded-image2 --autoApplyImage > >(tee /tmp/darwin/framework-tests/ota-requestor-app-2.log) 2> >(tee /tmp/darwin/framework-tests/ota-requestor-app-err-2.log >&2) & xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx OTHER_CFLAGS='${inherited} -Werror -Wconversion -Wno-incomplete-umbrella -Wno-unguarded-availability-new' > >(tee /tmp/darwin/framework-tests/darwin-tests.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-err.log >&2) working-directory: src/darwin/Framework - name: Uploading log files diff --git a/.github/workflows/doxygen.yaml b/.github/workflows/doxygen.yaml index 692ab763340db7..7c24e5fb5c776f 100644 --- a/.github/workflows/doxygen.yaml +++ b/.github/workflows/doxygen.yaml @@ -82,7 +82,7 @@ jobs: runs-on: ubuntu-latest container: - image: connectedhomeip/chip-build-doxygen:0.6.47 + image: connectedhomeip/chip-build-doxygen:0.7.0 if: github.actor != 'restyled-io[bot]' diff --git a/.github/workflows/examples-ameba.yaml b/.github/workflows/examples-ameba.yaml index 3ed0d5a866bc15..edfbeab2211cdb 100644 --- a/.github/workflows/examples-ameba.yaml +++ b/.github/workflows/examples-ameba.yaml @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-ameba:0.6.47 + image: connectedhomeip/chip-build-ameba:0.7.0 options: --user root steps: @@ -49,7 +49,7 @@ jobs: attempt_limit: 3 attempt_delay: 2000 - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform ameba + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform ameba - name: Bootstrap cache uses: actions/cache@v3 timeout-minutes: 10 @@ -59,7 +59,7 @@ jobs: .environment build_overrides/pigweed_environment.gni - name: Bootstrap - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Build example Ameba All Clusters App run: | ./scripts/run_in_build_env.sh \ diff --git a/.github/workflows/examples-bouffalolab.yaml b/.github/workflows/examples-bouffalolab.yaml index 1760458c2b03ab..f16e063e699414 100644 --- a/.github/workflows/examples-bouffalolab.yaml +++ b/.github/workflows/examples-bouffalolab.yaml @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-bouffalolab:0.6.47 + image: connectedhomeip/chip-build-bouffalolab:0.7.0 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: @@ -49,7 +49,7 @@ jobs: attempt_limit: 3 attempt_delay: 2000 - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform bouffalolab --recursive + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform bouffalolab --recursive - name: Set up environment for size reports if: ${{ !env.ACT }} @@ -67,7 +67,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 25 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Uploading bootstrap logs uses: actions/upload-artifact@v3 if: ${{ always() && !env.ACT }} diff --git a/.github/workflows/examples-cc13x2x7_26x2x7.yaml b/.github/workflows/examples-cc13x2x7_26x2x7.yaml index 254c4a041c8ccf..1011e900e30729 100644 --- a/.github/workflows/examples-cc13x2x7_26x2x7.yaml +++ b/.github/workflows/examples-cc13x2x7_26x2x7.yaml @@ -38,7 +38,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-ti:0.6.47 + image: connectedhomeip/chip-build-ti:0.7.0 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: @@ -51,7 +51,7 @@ jobs: attempt_limit: 3 attempt_delay: 2000 - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform cc13x2_26x2 + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform cc13x2_26x2 - name: Set up environment for size reports if: ${{ !env.ACT }} env: @@ -68,7 +68,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 25 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Uploading bootstrap logs uses: actions/upload-artifact@v3 if: ${{ always() && !env.ACT }} diff --git a/.github/workflows/examples-cc32xx.yaml b/.github/workflows/examples-cc32xx.yaml index fed502b34d7530..e542294194dbc7 100644 --- a/.github/workflows/examples-cc32xx.yaml +++ b/.github/workflows/examples-cc32xx.yaml @@ -35,7 +35,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-ti:0.6.47 + image: connectedhomeip/chip-build-ti:0.7.0 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: @@ -48,7 +48,7 @@ jobs: attempt_limit: 3 attempt_delay: 2000 - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform cc32xx + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform cc32xx - name: Set up environment for size reports if: ${{ !env.ACT }} env: @@ -65,7 +65,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 25 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Uploading bootstrap logs uses: actions/upload-artifact@v3 if: ${{ always() && !env.ACT }} diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml index 90b925786afed8..5974ce33ab5f3d 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.7.0 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 --allow-changing-global-git-config --shallow --platform silabs_docker # - name: Out of Tree verification # run: third_party/silabs/out_of_tree_verification.sh @@ -73,7 +73,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 25 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Uploading bootstrap logs uses: actions/upload-artifact@v3 if: ${{ always() && !env.ACT }} @@ -82,7 +82,11 @@ jobs: path: | .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log - + - name: Test SLC gen + timeout-minutes: 30 + run: | + scripts/examples/gn_efr32_example.sh examples/lighting-app/silabs/efr32 ./out/light-app BRD4187C --slc_generate --docker + rm -rf ./out/ - name: Build some BRD4187C variants timeout-minutes: 90 run: | @@ -114,7 +118,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 +126,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-esp32.yaml b/.github/workflows/examples-esp32.yaml index 74dee213b71be8..afaa375cc501c5 100644 --- a/.github/workflows/examples-esp32.yaml +++ b/.github/workflows/examples-esp32.yaml @@ -35,7 +35,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-esp32:0.6.47 + image: connectedhomeip/chip-build-esp32:0.7.0 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" @@ -49,7 +49,7 @@ jobs: attempt_limit: 3 attempt_delay: 2000 - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform esp32 + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform esp32 - name: Set up environment for size reports if: ${{ !env.ACT }} @@ -67,7 +67,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Uploading bootstrap logs uses: actions/upload-artifact@v3 if: ${{ always() && !env.ACT }} @@ -87,10 +87,18 @@ jobs: build \ --copy-artifacts-to out/artifacts \ " + - name: Prepare bloat report + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + esp32 m5stack all-clusters-app \ + out/esp32-m5stack-all-clusters/chip-all-clusters-app.elf \ + /tmp/bloat_reports/ - name: Prepare code pregen and ensure compile time pregen not possible run: | ./scripts/run_in_build_env.sh "./scripts/codepregen.py ./zzz_pregenerated" mv scripts/codegen.py scripts/codegen.py.renamed + - name: Clean output + run: rm -rf ./out - name: Build some M5Stack variations with pregen timeout-minutes: 60 run: | @@ -105,22 +113,16 @@ jobs: " - name: Check no code generation in output run: | - CNT=$(find -name "CHIPClusters.h" out | wc -l) + CNT=$(find out -name "CHIPClusters.h" | wc -l) if [ "${CNT}" != "0" ]; then echo "ERROR: found unexpected generated files:" - find -name "CHIPClusters.h" out + find out -name "CHIPClusters.h" exit 1 fi - name: Undo code pregeneration changes run: | rm -rf ./zzz_pregenerated mv scripts/codegen.py.renamed scripts/codegen.py - - name: Prepare bloat report - run: | - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - esp32 m5stack all-clusters-app \ - out/esp32-m5stack-all-clusters/chip-all-clusters-app.elf \ - /tmp/bloat_reports/ - name: Build example All Clusters App C3 timeout-minutes: 15 run: scripts/examples/esp_example.sh all-clusters-app sdkconfig_c3devkit.defaults @@ -158,7 +160,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-esp32:0.6.47 + image: connectedhomeip/chip-build-esp32:0.7.0 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" @@ -172,7 +174,7 @@ jobs: attempt_limit: 3 attempt_delay: 2000 - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform esp32 + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform esp32 - name: Bootstrap cache uses: actions/cache@v3 @@ -184,7 +186,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Uploading bootstrap logs uses: actions/upload-artifact@v3 if: ${{ always() && !env.ACT }} diff --git a/.github/workflows/examples-infineon.yaml b/.github/workflows/examples-infineon.yaml index 46db43bca68fa7..42678cd5e64589 100644 --- a/.github/workflows/examples-infineon.yaml +++ b/.github/workflows/examples-infineon.yaml @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-infineon:0.6.47 + image: connectedhomeip/chip-build-infineon:0.7.0 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: @@ -49,7 +49,7 @@ jobs: attempt_limit: 3 attempt_delay: 2000 - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform infineon + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform infineon - name: Set up environment for size reports if: ${{ !env.ACT }} @@ -67,7 +67,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 25 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Uploading bootstrap logs uses: actions/upload-artifact@v3 if: ${{ always() && !env.ACT }} @@ -141,7 +141,8 @@ jobs: "./scripts/build/build_examples.py \ --target cyw30739-cyw930739m2evb_01-light \ --target cyw30739-cyw930739m2evb_01-lock \ - --target cyw30739-cyw930739m2evb_01-ota-requestor-no-progress-logging \ + --target cyw30739-cyw930739m2evb_01-ota-requestor \ + --target cyw30739-cyw930739m2evb_01-switch \ build \ --copy-artifacts-to out/artifacts \ " @@ -163,8 +164,15 @@ jobs: timeout-minutes: 5 run: | .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - cyw30739 cyw930739m2evb_01 ota-requestor-no-progress-logging \ - out/artifacts/cyw30739-cyw930739m2evb_01-ota-requestor-no-progress-logging/chip-cyw30739-ota-requestor-example.elf \ + cyw30739 cyw930739m2evb_01 ota-requestor \ + out/artifacts/cyw30739-cyw930739m2evb_01-ota-requestor/chip-cyw30739-ota-requestor-example.elf \ + /tmp/bloat_reports/ + - name: Get switch size stats + timeout-minutes: 5 + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + cyw30739 cyw930739m2evb_01 switch \ + out/artifacts/cyw30739-cyw930739m2evb_01-switch/chip-cyw30739-light-switch-example.elf \ /tmp/bloat_reports/ - name: Uploading Size Reports uses: actions/upload-artifact@v3 diff --git a/.github/workflows/examples-k32w.yaml b/.github/workflows/examples-k32w.yaml index 77b9826f6f8231..047d6cd68d2a50 100644 --- a/.github/workflows/examples-k32w.yaml +++ b/.github/workflows/examples-k32w.yaml @@ -38,7 +38,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-k32w:0.6.47 + image: connectedhomeip/chip-build-k32w:0.7.0 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: @@ -51,7 +51,7 @@ jobs: attempt_limit: 3 attempt_delay: 2000 - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform k32w0 + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform k32w0 - name: Set up environment for size reports if: ${{ !env.ACT }} @@ -69,7 +69,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 25 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Uploading bootstrap logs uses: actions/upload-artifact@v3 if: ${{ always() && !env.ACT }} diff --git a/.github/workflows/examples-linux-arm.yaml b/.github/workflows/examples-linux-arm.yaml index f0b78a5b46b383..0eb21a41ec0778 100644 --- a/.github/workflows/examples-linux-arm.yaml +++ b/.github/workflows/examples-linux-arm.yaml @@ -35,7 +35,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-crosscompile:0.6.47 + image: connectedhomeip/chip-build-crosscompile:0.7.0 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" @@ -49,7 +49,7 @@ jobs: attempt_limit: 3 attempt_delay: 2000 - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform linux + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform linux - name: Set up environment for size reports if: ${{ !env.ACT }} @@ -67,7 +67,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Uploading bootstrap logs uses: actions/upload-artifact@v3 if: ${{ always() && !env.ACT }} diff --git a/.github/workflows/examples-linux-imx.yaml b/.github/workflows/examples-linux-imx.yaml index ded33cb5756ae9..9530b4ca343053 100644 --- a/.github/workflows/examples-linux-imx.yaml +++ b/.github/workflows/examples-linux-imx.yaml @@ -35,7 +35,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-imx:0.6.47 + image: connectedhomeip/chip-build-imx:0.7.0 steps: - uses: Wandalen/wretry.action@v1.0.36 @@ -47,7 +47,7 @@ jobs: attempt_limit: 3 attempt_delay: 2000 - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform linux + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform linux - name: Bootstrap cache uses: actions/cache@v3 @@ -58,7 +58,7 @@ jobs: .environment build_overrides/pigweed_environment.gni - name: Bootstrap - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Build lighting-app timeout-minutes: 30 diff --git a/.github/workflows/examples-linux-standalone.yaml b/.github/workflows/examples-linux-standalone.yaml index 8d2d87f067b916..2664f9f9896b09 100644 --- a/.github/workflows/examples-linux-standalone.yaml +++ b/.github/workflows/examples-linux-standalone.yaml @@ -35,7 +35,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build:0.6.47 + image: connectedhomeip/chip-build:0.7.0 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" @@ -49,7 +49,7 @@ jobs: attempt_limit: 3 attempt_delay: 2000 - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform linux + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform linux - name: Set up environment for size reports if: ${{ !env.ACT }} @@ -67,7 +67,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Uploading bootstrap logs uses: actions/upload-artifact@v3 if: ${{ always() && !env.ACT }} @@ -179,6 +179,17 @@ jobs: linux debug bridge-app \ out/linux-x64-bridge/chip-bridge-app \ /tmp/bloat_reports/ + - name: Build example Dynamic Bridge + timeout-minutes: 10 + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-x64-dynamic-bridge-ipv6only \ + build" + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + linux debug dynamic-bridge-app-ipv6only \ + out/linux-x64-dynamic-bridge-ipv6only/dynamic-chip-bridge-app \ + /tmp/bloat_reports/ - name: Build example OTA Provider timeout-minutes: 10 run: | diff --git a/.github/workflows/examples-mbed.yaml b/.github/workflows/examples-mbed.yaml index 53da5ba28ba613..55ad878b91fecd 100644 --- a/.github/workflows/examples-mbed.yaml +++ b/.github/workflows/examples-mbed.yaml @@ -41,7 +41,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-mbed-os:0.6.47 + image: connectedhomeip/chip-build-mbed-os:0.7.0 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" @@ -55,7 +55,7 @@ jobs: attempt_limit: 3 attempt_delay: 2000 - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform mbed + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform mbed - name: Detect changed paths uses: dorny/paths-filter@v2 @@ -83,7 +83,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Uploading bootstrap logs uses: actions/upload-artifact@v3 if: ${{ always() && !env.ACT }} diff --git a/.github/workflows/examples-mw320.yaml b/.github/workflows/examples-mw320.yaml index 1aea2f34557a52..f980b3249f9168 100755 --- a/.github/workflows/examples-mw320.yaml +++ b/.github/workflows/examples-mw320.yaml @@ -38,7 +38,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build:0.6.47 + image: connectedhomeip/chip-build:0.7.0 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: @@ -51,7 +51,7 @@ jobs: attempt_limit: 3 attempt_delay: 2000 - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform mw320 + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform mw320 - name: Set up environment for size reports if: ${{ !env.ACT }} @@ -69,7 +69,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 25 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Uploading bootstrap logs uses: actions/upload-artifact@v3 if: ${{ always() && !env.ACT }} diff --git a/.github/workflows/examples-nrfconnect.yaml b/.github/workflows/examples-nrfconnect.yaml index 4f0efb889359c8..09ec03dd1896da 100644 --- a/.github/workflows/examples-nrfconnect.yaml +++ b/.github/workflows/examples-nrfconnect.yaml @@ -38,7 +38,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-nrf-platform:0.6.47 + image: connectedhomeip/chip-build-nrf-platform:0.7.0 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" @@ -52,7 +52,7 @@ jobs: attempt_limit: 3 attempt_delay: 2000 - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform nrfconnect + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform nrfconnect - name: Detect changed paths uses: dorny/paths-filter@v2 id: changed_paths @@ -84,7 +84,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 25 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Uploading bootstrap logs uses: actions/upload-artifact@v3 if: ${{ always() && !env.ACT }} @@ -99,7 +99,9 @@ jobs: run: scripts/run_in_build_env.sh "python3 scripts/setup/nrfconnect/update_ncs.py --check" - name: Run unit tests of factory data generation script timeout-minutes: 15 - run: scripts/run_in_build_env.sh "./scripts/tools/nrfconnect/tests/test_generate_factory_data.py" + run: | + scripts/run_in_build_env.sh 'pip3 install -r scripts/setup/requirements.nrfconnect.txt' + scripts/run_in_build_env.sh "./scripts/tools/nrfconnect/tests/test_generate_factory_data.py" - name: Build example nRF Connect SDK Lock App on nRF52840 DK if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true' timeout-minutes: 15 diff --git a/.github/workflows/examples-openiotsdk.yaml b/.github/workflows/examples-openiotsdk.yaml index ddf3868d878cc1..a4d873a5e813c9 100644 --- a/.github/workflows/examples-openiotsdk.yaml +++ b/.github/workflows/examples-openiotsdk.yaml @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-openiotsdk:0.6.47 + image: connectedhomeip/chip-build-openiotsdk:0.7.0 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" options: --privileged @@ -51,7 +51,7 @@ jobs: attempt_limit: 3 attempt_delay: 2000 - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --recursive --platform openiotsdk + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --recursive --platform openiotsdk - name: Set up environment for size reports if: ${{ !env.ACT }} @@ -69,7 +69,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Build and install Python controller timeout-minutes: 10 diff --git a/.github/workflows/examples-qpg.yaml b/.github/workflows/examples-qpg.yaml index 65376a17a86490..cfa56c20acddec 100644 --- a/.github/workflows/examples-qpg.yaml +++ b/.github/workflows/examples-qpg.yaml @@ -38,7 +38,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build:0.6.47 + image: connectedhomeip/chip-build:0.7.0 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: @@ -51,7 +51,7 @@ jobs: attempt_limit: 3 attempt_delay: 2000 - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform qpg + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform qpg - name: Set up environment for size reports if: ${{ !env.ACT }} @@ -69,7 +69,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 25 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Uploading bootstrap logs uses: actions/upload-artifact@v3 if: ${{ always() && !env.ACT }} diff --git a/.github/workflows/examples-telink.yaml b/.github/workflows/examples-telink.yaml index f26f0a3c7313da..103538b8a35cad 100644 --- a/.github/workflows/examples-telink.yaml +++ b/.github/workflows/examples-telink.yaml @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-telink:0.6.47 + image: connectedhomeip/chip-build-telink:0.6.53 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" @@ -50,7 +50,7 @@ jobs: attempt_limit: 3 attempt_delay: 2000 - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform telink + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform telink - name: Set up environment for size reports if: ${{ !env.ACT }} @@ -68,7 +68,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 25 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Build example Telink All Clusters App run: | @@ -94,6 +94,18 @@ jobs: - name: clean out build output run: rm -rf ./out + - name: Build example Telink Bridge App + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-bridge' build" + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + telink tlsr9518adk80d bridge-app \ + out/telink-tlsr9518adk80d-bridge/zephyr/zephyr.elf \ + /tmp/bloat_reports/ + + - name: clean out build output + run: rm -rf ./out + - name: Build example Telink Contact Sensor App run: | ./scripts/run_in_build_env.sh \ @@ -130,6 +142,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 --allow-changing-global-git-config --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/examples-tizen.yaml b/.github/workflows/examples-tizen.yaml index b5d4c33ece6542..ab6ffb2dfb8b5d 100644 --- a/.github/workflows/examples-tizen.yaml +++ b/.github/workflows/examples-tizen.yaml @@ -34,7 +34,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-tizen:0.6.47 + image: connectedhomeip/chip-build-tizen:0.7.0 options: --user root volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" @@ -50,7 +50,7 @@ jobs: attempt_limit: 3 attempt_delay: 2000 - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform tizen + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform tizen - name: Bootstrap cache uses: actions/cache@v3 @@ -61,7 +61,7 @@ jobs: .environment build_overrides/pigweed_environment.gni - name: Bootstrap - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Build Tizen examples run: | diff --git a/.github/workflows/full-android.yaml b/.github/workflows/full-android.yaml index d28d3fb1679b2d..d57b493097e984 100644 --- a/.github/workflows/full-android.yaml +++ b/.github/workflows/full-android.yaml @@ -37,7 +37,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-android:0.6.47 + image: connectedhomeip/chip-build-android:0.7.0 volumes: - "/tmp/log_output:/tmp/test_logs" @@ -61,7 +61,7 @@ jobs: if: ${{ env.ACT }} name: Checkout (ACT for local build) - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform android + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform android - name: Bootstrap cache uses: actions/cache@v3 @@ -73,7 +73,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Uploading bootstrap logs uses: actions/upload-artifact@v3 if: ${{ always() && !env.ACT }} diff --git a/.github/workflows/fuzzing-build.yaml b/.github/workflows/fuzzing-build.yaml index ae4658086ced6b..801a1cf20a71a8 100644 --- a/.github/workflows/fuzzing-build.yaml +++ b/.github/workflows/fuzzing-build.yaml @@ -34,7 +34,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build:0.6.47 + image: connectedhomeip/chip-build:0.7.0 volumes: - "/tmp/log_output:/tmp/test_logs" @@ -64,7 +64,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Uploading bootstrap logs uses: actions/upload-artifact@v3 if: ${{ always() && !env.ACT }} @@ -124,7 +124,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 25 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Uploading bootstrap logs uses: actions/upload-artifact@v3 if: ${{ always() && !env.ACT }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index caac210d7dfa91..85af069b51d8f6 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -54,7 +54,7 @@ jobs: # Bootstrap and checkout for internal scripts (like idl_lint) # to run - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform linux + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform linux - name: Bootstrap cache uses: actions/cache@v3 timeout-minutes: 10 @@ -65,7 +65,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Check for matter lint errors if: always() @@ -79,25 +79,6 @@ jobs: # https://github.com/project-chip/connectedhomeip/issues/19169 # https://github.com/project-chip/connectedhomeip/issues/22640 if [ "$idl_file" = './examples/all-clusters-app/all-clusters-common/all-clusters-app.matter' ]; then continue; fi - if [ "$idl_file" = './examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter' ]; then continue; fi - if [ "$idl_file" = './examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO' ]; then continue; fi - if [ "$idl_file" = './examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter' ]; then continue; fi - if [ "$idl_file" = './examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter' ]; then continue; fi - if [ "$idl_file" = './examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter' ]; then continue; fi - if [ "$idl_file" = './examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter' ]; then continue; fi - if [ "$idl_file" = './examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter' ]; then continue; fi - if [ "$idl_file" = './examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter' ]; then continue; fi - if [ "$idl_file" = './examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter' ]; then continue; fi - if [ "$idl_file" = './examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter' ]; then continue; fi - if [ "$idl_file" = './examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter' ]; then continue; fi - if [ "$idl_file" = './examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter' ]; then continue; fi - if [ "$idl_file" = './examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter' ]; then continue; fi - if [ "$idl_file" = './examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter' ]; then continue; fi - if [ "$idl_file" = './examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter' ]; then continue; fi - if [ "$idl_file" = './examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter' ]; then continue; fi - if [ "$idl_file" = './examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter' ]; then continue; fi - if [ "$idl_file" = './examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter' ]; then continue; fi - if [ "$idl_file" = './examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter' ]; then continue; fi if [ "$idl_file" = './examples/log-source-app/log-source-common/log-source-app.matter' ]; then continue; fi if [ "$idl_file" = './examples/placeholder/linux/apps/app1/config.matter' ]; then continue; fi if [ "$idl_file" = './examples/placeholder/linux/apps/app2/config.matter' ]; then continue; fi @@ -221,3 +202,12 @@ jobs: if: always() run: | flake8 --extend-ignore=E501,W391 + + # git grep exits with 0 if it finds a match, but we want + # to fail (exit nonzero) on match. And we want to exclude this file, + # to avoid our grep regexp matching itself. + - name: Check for use of "SuccessOrExit(CHIP_ERROR_*)", which should probably be "SuccessOrExit(err = CHIP_ERROR_*)" + if: always() + run: | + git grep -n 'SuccessOrExit(CHIP_ERROR' -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0 + diff --git a/.github/workflows/minimal-build.yaml b/.github/workflows/minimal-build.yaml new file mode 100644 index 00000000000000..e6215890be1dda --- /dev/null +++ b/.github/workflows/minimal-build.yaml @@ -0,0 +1,45 @@ +# 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: Minimal Build (Linux / configure) + +on: + push: + pull_request: + merge_group: + +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: + minimal: + name: Linux / configure build of all-clusters-app + timeout-minutes: 60 + + if: github.actor != 'restyled-io[bot]' + runs-on: ubuntu-latest + + container: + image: connectedhomeip/chip-build-minimal:0.7.2 + + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Checkout submodules + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform linux + - name: Configure and build All Clusters App + timeout-minutes: 10 + run: | + CC=gcc CXX=g++ scripts/configure --project=examples/all-clusters-app/linux && ./ninja-build diff --git a/.github/workflows/qemu.yaml b/.github/workflows/qemu.yaml index c91e378691d976..cf2bcad747d673 100644 --- a/.github/workflows/qemu.yaml +++ b/.github/workflows/qemu.yaml @@ -39,7 +39,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-esp32-qemu:0.6.47 + image: connectedhomeip/chip-build-esp32-qemu:0.7.0 volumes: - "/tmp/log_output:/tmp/test_logs" @@ -53,7 +53,7 @@ jobs: attempt_limit: 3 attempt_delay: 2000 - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform esp32 + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform esp32 - name: Bootstrap cache uses: actions/cache@v3 @@ -65,7 +65,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 25 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Uploading bootstrap logs uses: actions/upload-artifact@v3 if: ${{ always() && !env.ACT }} @@ -103,7 +103,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-tizen-qemu:0.6.47 + image: connectedhomeip/chip-build-tizen-qemu:0.7.0 volumes: - "/tmp/log_output:/tmp/test_logs" @@ -117,7 +117,7 @@ jobs: attempt_limit: 3 attempt_delay: 2000 - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform tizen + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform tizen - name: Bootstrap cache uses: actions/cache@v3 @@ -129,12 +129,12 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 25 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Build and run tests run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py \ - --target tizen-arm-tests-no-ble \ + --target tizen-arm-tests-no-ble-no-thread \ build " diff --git a/.github/workflows/release_artifacts.yaml b/.github/workflows/release_artifacts.yaml index b43247453230fb..b9bbd6376a701d 100644 --- a/.github/workflows/release_artifacts.yaml +++ b/.github/workflows/release_artifacts.yaml @@ -29,7 +29,7 @@ jobs: runs-on: ubuntu-latest container: - image: connectedhomeip/chip-build-esp32:0.6.47 + image: connectedhomeip/chip-build-esp32:0.7.0 steps: - uses: Wandalen/wretry.action@v1.0.36 @@ -53,7 +53,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 25 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Uploading bootstrap logs uses: actions/upload-artifact@v3 if: ${{ always() && !env.ACT }} @@ -85,7 +85,7 @@ jobs: runs-on: ubuntu-latest container: - image: connectedhomeip/chip-build-efr32:0.6.47 + image: connectedhomeip/chip-build-efr32:0.7.0 steps: - uses: Wandalen/wretry.action@v1.0.36 name: Checkout @@ -108,7 +108,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 25 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Uploading bootstrap logs uses: actions/upload-artifact@v3 if: ${{ always() && !env.ACT }} diff --git a/.github/workflows/smoketest-android.yaml b/.github/workflows/smoketest-android.yaml index 769fa93f2530a8..d9b723645c564c 100644 --- a/.github/workflows/smoketest-android.yaml +++ b/.github/workflows/smoketest-android.yaml @@ -38,7 +38,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-android:0.6.47 + image: connectedhomeip/chip-build-android:0.7.0 volumes: - "/tmp/log_output:/tmp/test_logs" @@ -52,7 +52,7 @@ jobs: attempt_limit: 3 attempt_delay: 2000 - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform android + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform android - name: Bootstrap cache uses: actions/cache@v3 @@ -64,7 +64,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Uploading bootstrap logs uses: actions/upload-artifact@v3 if: ${{ always() && !env.ACT }} @@ -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..7cefedeca044b0 --- /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 --allow-changing-global-git-config --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: bash scripts/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/.github/workflows/spell.yml b/.github/workflows/spell.yml index 2ccd0133f89225..f073c203385e53 100644 --- a/.github/workflows/spell.yml +++ b/.github/workflows/spell.yml @@ -52,4 +52,4 @@ jobs: token: ${{ github.token }} attempt_limit: 3 attempt_delay: 2000 - - uses: igsekor/pyspelling-any@v0.0.2 + - uses: igsekor/pyspelling-any@v1.0.4 diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 2eda3b67aa45fd..69d83a5e00748e 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -48,7 +48,7 @@ jobs: runs-on: ubuntu-latest container: - image: connectedhomeip/chip-build:0.6.47 + image: connectedhomeip/chip-build:0.7.0 options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1" @@ -72,7 +72,7 @@ jobs: if: ${{ env.ACT }} name: Checkout (ACT for local build) - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform linux + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform linux - name: Try to ensure the directories for core dumping exist and we can write them. run: | @@ -90,7 +90,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Uploading bootstrap logs uses: actions/upload-artifact@v3 if: ${{ always() && !env.ACT }} @@ -324,7 +324,7 @@ jobs: attempt_limit: 3 attempt_delay: 2000 - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform darwin + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform darwin - name: Setup Environment # coreutils for stdbuf run: brew install coreutils @@ -346,7 +346,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 25 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Uploading bootstrap logs uses: actions/upload-artifact@v3 if: ${{ always() && !env.ACT }} @@ -442,7 +442,7 @@ jobs: runs-on: ubuntu-latest container: - image: connectedhomeip/chip-build:0.6.47 + image: connectedhomeip/chip-build:0.7.0 options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=0 net.ipv6.conf.all.forwarding=0" @@ -450,7 +450,7 @@ jobs: - name: Checkout uses: actions/checkout@v3 - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform linux + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform linux - name: Try to ensure the directories for core dumping exist and we can write them. run: | @@ -468,7 +468,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Uploading bootstrap logs uses: actions/upload-artifact@v3 if: ${{ always() && !env.ACT }} @@ -499,6 +499,7 @@ jobs: scripts/run_in_build_env.sh './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace_decode 1 --enable-key 000102030405060708090a0b0c0d0e0f" --script "src/python_testing/TC_TestEventTrigger.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --bool-arg allow_sdk_dac:true"' scripts/run_in_build_env.sh './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace_decode 1" --script "src/python_testing/TC_ACE_1_4.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --int-arg PIXIT.ACE.APPENDPOINT:1 PIXIT.ACE.APPDEVTYPEID:0x0100 --string-arg PIXIT.ACE.APPCLUSTER:OnOff PIXIT.ACE.APPATTRIBUTE:OnOff"' scripts/run_in_build_env.sh './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace_decode 1" --script "src/python_testing/TC_ACE_1_3.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021"' + scripts/run_in_build_env.sh './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace_decode 1" --script "src/python_testing/TC_CGEN_2_4.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021"' - name: Uploading core files uses: actions/upload-artifact@v3 if: ${{ failure() && !env.ACT }} @@ -528,7 +529,7 @@ jobs: runs-on: ubuntu-latest container: - image: connectedhomeip/chip-build-java:0.6.47 + image: connectedhomeip/chip-build-java:0.7.0 options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=0 net.ipv6.conf.all.forwarding=0" @@ -536,7 +537,7 @@ jobs: - name: Checkout uses: actions/checkout@v3 - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform linux + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform linux - name: Try to ensure the directories for core dumping exist and we can write them. run: | @@ -554,7 +555,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Uploading bootstrap logs uses: actions/upload-artifact@v3 if: ${{ always() && !env.ACT }} @@ -705,7 +706,7 @@ jobs: - name: Checkout uses: actions/checkout@v3 - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform darwin + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform darwin - name: Setup Environment # coreutils for stdbuf run: brew install coreutils @@ -727,7 +728,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 25 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Uploading bootstrap logs uses: actions/upload-artifact@v3 if: ${{ always() && !env.ACT }} diff --git a/.github/workflows/unit_integration_test.yaml b/.github/workflows/unit_integration_test.yaml index 540e4a9563f283..a797c4116370ee 100644 --- a/.github/workflows/unit_integration_test.yaml +++ b/.github/workflows/unit_integration_test.yaml @@ -38,7 +38,7 @@ jobs: runs-on: ubuntu-latest container: - image: connectedhomeip/chip-build:0.6.47 + image: connectedhomeip/chip-build:0.7.0 volumes: - "/tmp/log_output:/tmp/test_logs" options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1" @@ -53,12 +53,12 @@ jobs: attempt_limit: 3 attempt_delay: 2000 - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform linux + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform linux - name: Bootstrap timeout-minutes: 10 run: | mkdir -p /tmp/log_output ; - scripts/build/gn_bootstrap.sh ; + bash scripts/bootstrap.sh ; - name: Uploading bootstrap logs uses: actions/upload-artifact@v3 if: ${{ always() && !env.ACT }} diff --git a/.github/workflows/zap_regeneration.yaml b/.github/workflows/zap_regeneration.yaml index 257b86e81914a7..1057e83af455ba 100644 --- a/.github/workflows/zap_regeneration.yaml +++ b/.github/workflows/zap_regeneration.yaml @@ -28,7 +28,7 @@ jobs: runs-on: ubuntu-20.04 container: - image: connectedhomeip/chip-build:0.6.47 + image: connectedhomeip/chip-build:0.7.0 defaults: run: shell: sh @@ -45,7 +45,7 @@ jobs: attempt_limit: 3 attempt_delay: 2000 - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform linux + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform linux - name: Bootstrap cache uses: actions/cache@v3 @@ -57,7 +57,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Generate all timeout-minutes: 5 diff --git a/.github/workflows/zap_templates.yaml b/.github/workflows/zap_templates.yaml index d1a846b9968cb0..5b0ba11fa6ca69 100644 --- a/.github/workflows/zap_templates.yaml +++ b/.github/workflows/zap_templates.yaml @@ -30,7 +30,7 @@ jobs: runs-on: ubuntu-20.04 container: - image: connectedhomeip/chip-build:0.6.47 + image: connectedhomeip/chip-build:0.7.0 defaults: run: shell: sh @@ -46,7 +46,7 @@ jobs: attempt_limit: 3 attempt_delay: 2000 - name: Checkout submodules - run: scripts/checkout_submodules.py --shallow --platform linux + run: scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform linux - name: Bootstrap cache uses: actions/cache@v3 @@ -58,7 +58,7 @@ jobs: build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 - run: scripts/build/gn_bootstrap.sh + run: bash scripts/bootstrap.sh - name: Generate all run: ./scripts/run_in_build_env.sh scripts/tools/zap_regen_all.py 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/.vscode/settings.json b/.vscode/settings.json index a8e2b99d4e8a70..93e190d66f5cae 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -168,5 +168,6 @@ "files.trimFinalNewlines": true, "C_Cpp.default.cppStandard": "gnu++14", "C_Cpp.default.cStandard": "gnu11", - "cmake.configureOnOpen": false + "cmake.configureOnOpen": false, + "search.followSymlinks": false } diff --git a/.vscode/tasks.json b/.vscode/tasks.json index f73966cddf7c22..2e495a9536fd2c 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -638,6 +638,7 @@ "qpg-qpg6100-lock", "telink-tlsr9518adk80d-all-clusters", "telink-tlsr9518adk80d-all-clusters-minimal", + "telink-tlsr9518adk80d-bridge", "telink-tlsr9518adk80d-contact-sensor", "telink-tlsr9518adk80d-light", "telink-tlsr9518adk80d-light-switch", diff --git a/README.md b/README.md index 03e41c39f2b448..1dd90182ee5181 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Builds](https://github.com/project-chip/connectedhomeip/workflows/Builds/badge.svg)](https://github.com/project-chip/connectedhomeip/actions/workflows/build.yaml) +**Examples:** [![Examples - EFR32](https://github.com/project-chip/connectedhomeip/workflows/Build%20example%20-%20EFR32/badge.svg)](https://github.com/project-chip/connectedhomeip/actions/workflows/examples-efr32.yaml) [![Examples - ESP32](https://github.com/project-chip/connectedhomeip/workflows/Build%20example%20-%20ESP32/badge.svg)](https://github.com/project-chip/connectedhomeip/actions/workflows/examples-esp32.yaml) [![Examples - i.MX Linux](https://github.com/project-chip/connectedhomeip/workflows/Build%20example%20-%20i.MX%20Linux/badge.svg)](https://github.com/project-chip/connectedhomeip/actions/workflows/examples-linux-imx.yaml) @@ -14,14 +15,22 @@ [![Build example - Infineon](https://github.com/project-chip/connectedhomeip/actions/workflows/examples-infineon.yaml/badge.svg)](https://github.com/project-chip/connectedhomeip/actions/workflows/examples-infineon.yaml) [![Build example - BouffaloLab](https://github.com/project-chip/connectedhomeip/workflows/Build%20example%20-%20BouffaloLab/badge.svg)](https://github.com/project-chip/connectedhomeip/actions/workflows/examples-bouffalolab.yaml) +**Platforms:** [![Android](https://github.com/project-chip/connectedhomeip/workflows/Android/badge.svg)](https://github.com/project-chip/connectedhomeip/actions/workflows/android.yaml) +**Tests:** [![Unit / Integration Tests](https://github.com/project-chip/connectedhomeip/workflows/Unit%20/%20Integration%20Tests/badge.svg)](https://github.com/project-chip/connectedhomeip/actions/workflows/unit_integration_test.yaml) [![Cirque](https://github.com/project-chip/connectedhomeip/workflows/Cirque/badge.svg)](https://github.com/project-chip/connectedhomeip/actions/workflows/cirque.yaml) [![QEMU](https://github.com/project-chip/connectedhomeip/workflows/QEMU/badge.svg)](https://github.com/project-chip/connectedhomeip/actions/workflows/qemu.yaml) +**Tools:** [![ZAP Templates](https://github.com/project-chip/connectedhomeip/workflows/ZAP/badge.svg)](https://github.com/project-chip/connectedhomeip/actions/workflows/zap_templates.yaml) +**Documentation:** +[![Documentation Build](https://github.com/project-chip/connectedhomeip/actions/workflows/docbuild.yaml/badge.svg)](https://github.com/project-chip/connectedhomeip/actions/workflows/docbuild.yaml) + +- [Matter SDK documentation page](https://project-chip.github.io/connectedhomeip-doc/index.html) + # About Matter (formerly Project CHIP) creates more connections between more objects, @@ -180,26 +189,26 @@ Instructions about how to build Matter can be found [here](./docs/README.md) . The Matter repository is structured as follows: -| File/Folder | Content | -| ------------------ | ------------------------------------------------------------------ | -| build | Build system support content and built output directories | -| build_overrides | Build system parameter customization for different platforms | -| config | Project configurations | -| credentials | Development and test credentials | -| docs | Documentation, including guides | -| examples | Example firmware applications that demonstrate use of Matter | -| integrations | 3rd Party integrations | -| scripts | Scripts needed to work with the Matter repository | -| src | Implementation of Matter | -| third_party | 3rd party code used by Matter | -| zzz_generated | zap generated template code - Revolving around cluster information | -| BUILD.gn | Build file for the gn build system | -| CODE_OF_CONDUCT.md | Code of conduct for Matter and contribution to it | -| CONTRIBUTING.md | Guidelines for contributing to Matter | -| LICENSE | Matter license file | -| REVIEWERS.md | PR reviewers | -| gn_build.sh | Build script for specific projects such as Android, EFR32, etc. | -| README.md | This File | +| File/Folder | Content | +| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- | +| build | Build system support content and built output directories | +| build_overrides | Build system parameter customization for different platforms | +| config | Project configurations | +| credentials | Development and test credentials | +| docs | Documentation, including guides. Visit the [Matter SDK documentation page](https://project-chip.github.io/connectedhomeip-doc/index.html) to read it. | +| examples | Example firmware applications that demonstrate use of Matter | +| integrations | 3rd Party integrations | +| scripts | Scripts needed to work with the Matter repository | +| src | Implementation of Matter | +| third_party | 3rd party code used by Matter | +| zzz_generated | zap generated template code - Revolving around cluster information | +| BUILD.gn | Build file for the gn build system | +| CODE_OF_CONDUCT.md | Code of conduct for Matter and contribution to it | +| CONTRIBUTING.md | Guidelines for contributing to Matter | +| LICENSE | Matter license file | +| REVIEWERS.md | PR reviewers | +| gn_build.sh | Build script for specific projects such as Android, EFR32, etc. | +| README.md | This File | # License 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/build/chip/fuzz_test.gni b/build/chip/fuzz_test.gni index 3d101c21e03762..7b683be047d913 100644 --- a/build/chip/fuzz_test.gni +++ b/build/chip/fuzz_test.gni @@ -15,10 +15,11 @@ import("//build_overrides/build.gni") import("//build_overrides/chip.gni") import("${build_root}/config/compiler/compiler.gni") +import("${chip_root}/build/chip/tests.gni") declare_args() { - enable_fuzz_test_targets = - is_clang && (current_os == "linux" || current_os == "mac") + enable_fuzz_test_targets = is_clang && chip_build_tests && + (current_os == "linux" || current_os == "mac") } # Define a fuzz target for chip. @@ -45,17 +46,21 @@ template("chip_fuzz_target") { executable(target_name) { forward_variables_from(invoker, "*") - if (defined(public_configs)) { - public_configs += [ - "//build/config/compiler:libfuzzer_fuzzing", - "//build/config/compiler:sanitize_address", - ] + fuzz_configs = [] + if (oss_fuzz) { + fuzz_configs += [ "//build/config/compiler:oss_fuzz" ] } else { - public_configs = [ + fuzz_configs += [ "//build/config/compiler:libfuzzer_fuzzing", "//build/config/compiler:sanitize_address", ] } + + if (defined(public_configs)) { + public_configs += fuzz_configs + } else { + public_configs = fuzz_configs + } if (!defined(oubput_dir)) { output_dir = "${root_out_dir}/tests" } diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn index 13a13f804c3248..9d2f17d1acf86e 100644 --- a/build/config/BUILDCONFIG.gn +++ b/build/config/BUILDCONFIG.gn @@ -57,8 +57,17 @@ if (host_toolchain == "") { } } +_custom_toolchain = { + import("${_build_overrides.build_root}/toolchain/custom/custom.gni") +} + if (_chip_defaults.custom_toolchain != "") { - _default_toolchain = _chip_defaults.custom_toolchain + if (filter_include([ _chip_defaults.custom_toolchain ], [ "/*" ]) == []) { + # Interpret relative toolchain names relative to ${build_root}/toolchain/ + _default_toolchain = "${_build_overrides.build_root}/toolchain/${_chip_defaults.custom_toolchain}" + } else { + _default_toolchain = _chip_defaults.custom_toolchain + } } else if (target_os == "all") { _default_toolchain = "${_pigweed_overrides.dir_pw_toolchain}/default" } else if (target_os == "linux") { diff --git a/build/config/android/config.gni b/build/config/android/config.gni index 508543144bc0f0..ca2b0afc9a8171 100644 --- a/build/config/android/config.gni +++ b/build/config/android/config.gni @@ -20,5 +20,5 @@ declare_args() { android_ndk_root = "" # Version of the Android SDK. - android_sdk_version = 21 + android_sdk_version = 26 } diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index 5c2accfcdc078e..d03db67b0f2322 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn @@ -259,6 +259,7 @@ config("strict_warnings") { cflags_cc = [ "-Wnon-virtual-dtor" ] + configs = [] ldflags = [] if (is_clang) { @@ -269,6 +270,8 @@ config("strict_warnings") { "-Wformat-type-confusion", ] + configs += [ "$dir_pw_build:clang_thread_safety_warnings" ] + # TODO: can make this back fatal in once pigweed updates can be taken again. # See https://github.com/project-chip/connectedhomeip/pull/22079 # @@ -453,11 +456,20 @@ config("libfuzzer_fuzzing") { ldflags = cflags } +config("oss_fuzz") { + cflags = string_split(getenv("CFLAGS")) + ldflags = string_split(getenv("CXXFLAGS")) + ldflags += [ getenv("LIB_FUZZING_ENGINE") ] +} + config("fuzzing_default") { configs = [] if (is_libfuzzer) { configs += [ ":libfuzzer_fuzzing" ] } + if (oss_fuzz) { + configs += [ ":oss_fuzz" ] + } } config("coverage") { diff --git a/build/config/compiler/compiler.gni b/build/config/compiler/compiler.gni index b25aa5c51ca957..5717df7fa33474 100644 --- a/build/config/compiler/compiler.gni +++ b/build/config/compiler/compiler.gni @@ -56,4 +56,7 @@ declare_args() { # Debug prefix mapping (values for -fdebug-prefix-map=). prefix_mappings = [] + + # Enable fuzzer build for OSS-Fuzz + oss_fuzz = false } diff --git a/build/config/linux/pkg_config.gni b/build/config/linux/pkg_config.gni index fb8f5aab32d703..016defafbc3617 100644 --- a/build/config/linux/pkg_config.gni +++ b/build/config/linux/pkg_config.gni @@ -125,6 +125,17 @@ template("pkg_config") { lib_dirs = pkgresult[3] } + # Link libraries statically for OSS-Fuzz fuzzer build + if (oss_fuzz) { + libs = [] + ldflags = [ "-Wl,-Bstatic" ] + foreach(lib, pkgresult[2]) { + ldflags += [ "-l$lib" ] + } + ldflags += [ "-Wl,-Bdynamic" ] + lib_dirs = pkgresult[3] + } + forward_variables_from(invoker, [ "defines", diff --git a/build/config/tizen/config.gni b/build/config/tizen/config.gni index 06a03d59b86881..84891db9545d57 100644 --- a/build/config/tizen/config.gni +++ b/build/config/tizen/config.gni @@ -14,8 +14,8 @@ declare_args() { # Location of Tizen SDK - tizen_sdk_root = getenv("TIZEN_SDK_ROOT") + tizen_sdk_root = "" # Location of Tizen SDK sysroot - tizen_sdk_sysroot = getenv("TIZEN_SDK_SYSROOT") + tizen_sdk_sysroot = "" } diff --git a/build/toolchain/custom/BUILD.gn b/build/toolchain/custom/BUILD.gn index f0ee798e9db194..bb8433ada6a246 100644 --- a/build/toolchain/custom/BUILD.gn +++ b/build/toolchain/custom/BUILD.gn @@ -14,19 +14,9 @@ import("//build_overrides/build.gni") import("${build_root}/config/compiler/compiler.gni") +import("${build_root}/toolchain/custom/custom.gni") import("${build_root}/toolchain/gcc_toolchain.gni") -declare_args() { - # C compiler to use for target build. - target_cc = "" - - # C++ compiler to use for target build. - target_cxx = "" - - # Archive tool to use for target build. - target_ar = "" -} - gcc_toolchain("custom") { if (target_cc == "" || target_cxx == "" || target_ar == "") { assert(false, diff --git a/examples/light-switch-app/silabs/SiWx917/build_for_wifi_gnfile.gn b/build/toolchain/custom/custom.gni similarity index 58% rename from examples/light-switch-app/silabs/SiWx917/build_for_wifi_gnfile.gn rename to build/toolchain/custom/custom.gni index d391814190d09f..890801a1c647df 100644 --- a/examples/light-switch-app/silabs/SiWx917/build_for_wifi_gnfile.gn +++ b/build/toolchain/custom/custom.gni @@ -1,4 +1,4 @@ -# Copyright (c) 2020 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. @@ -12,17 +12,16 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//build_overrides/build.gni") +declare_args() { + # C compiler to use for target build. + # Only relevant with custom_toolchain = "custom". + target_cc = "" -# The location of the build configuration file. -buildconfig = "${build_root}/config/BUILDCONFIG.gn" + # C++ compiler to use for target build. + # Only relevant with custom_toolchain = "custom". + target_cxx = "" -# CHIP uses angle bracket includes. -check_system_includes = true - -default_args = { - target_cpu = "arm" - target_os = "freertos" - chip_enable_wifi = true - import("//build_for_wifi_args.gni") + # Archive tool to use for target build. + # Only relevant with custom_toolchain = "custom". + target_ar = "" } diff --git a/config/ameba/chip.cmake b/config/ameba/chip.cmake index 8de905ae3a9a95..d221ab57352f94 100644 --- a/config/ameba/chip.cmake +++ b/config/ameba/chip.cmake @@ -107,7 +107,7 @@ string(APPEND CHIP_GN_ARGS "ameba_cc = \"arm-none-eabi-gcc\"\n") string(APPEND CHIP_GN_ARGS "ameba_cxx = \"arm-none-eabi-c++\"\n") string(APPEND CHIP_GN_ARGS "ameba_cpu = \"ameba\"\n") string(APPEND CHIP_GN_ARGS "chip_inet_config_enable_ipv4 = false\n") -string(APPEND CHIP_GN_ARGS "chip_use_transitional_commissionable_data_provider = false\n") +string(APPEND CHIP_GN_ARGS "chip_use_transitional_commissionable_data_provider = true\n") # Enable persistent storage audit if (matter_enable_persistentstorage_audit) 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/esp32/components/chip/CMakeLists.txt b/config/esp32/components/chip/CMakeLists.txt index e31baa2e0a6be2..6f30e30e297e34 100644 --- a/config/esp32/components/chip/CMakeLists.txt +++ b/config/esp32/components/chip/CMakeLists.txt @@ -86,10 +86,29 @@ chip_gn_arg_append("esp32_cpu" "\"esp32\"") chip_gn_arg_bool("is_debug" ${is_debug}) # Config the chip log level by IDF menuconfig -chip_gn_arg_bool ("chip_error_logging" CONFIG_LOG_DEFAULT_LEVEL GREATER_EQUAL 1) -chip_gn_arg_bool ("chip_progress_logging" CONFIG_LOG_DEFAULT_LEVEL GREATER_EQUAL 3) -chip_gn_arg_bool ("chip_detail_logging" CONFIG_LOG_DEFAULT_LEVEL GREATER_EQUAL 4) -chip_gn_arg_bool ("chip_automation_logging" CONFIG_LOG_DEFAULT_LEVEL GREATER_EQUAL 5) +if (CONFIG_LOG_DEFAULT_LEVEL GREATER_EQUAL 1) + chip_gn_arg_bool ("chip_error_logging" "true") +else() + chip_gn_arg_bool ("chip_error_logging" "false") +endif() + +if (CONFIG_LOG_DEFAULT_LEVEL GREATER_EQUAL 3) + chip_gn_arg_bool ("chip_progress_logging" "true") +else() + chip_gn_arg_bool ("chip_progress_logging" "false") +endif() + +if (CONFIG_LOG_DEFAULT_LEVEL GREATER_EQUAL 4) + chip_gn_arg_bool ("chip_detail_logging" "true") +else() + chip_gn_arg_bool ("chip_detail_logging" "false") +endif() + +if (CONFIG_LOG_DEFAULT_LEVEL GREATER_EQUAL 5) + chip_gn_arg_bool ("chip_automation_logging" "true") +else() + chip_gn_arg_bool ("chip_automation_logging" "false") +endif() if(CONFIG_ENABLE_CHIPOBLE) chip_gn_arg_append("chip_config_network_layer_ble" "true") @@ -155,12 +174,20 @@ if ((CONFIG_BT_ENABLED) AND (CONFIG_ENABLE_CHIPOBLE)) endif() endif() -if (CONFIG_OPENTHREAD_ENABLED) +if (CONFIG_ENABLE_ESP32_BLE_CONTROLLER) + chip_gn_arg_append("chip_enable_ble_controller" "true") +endif() + +if (CONFIG_ENABLE_MATTER_OVER_THREAD) chip_gn_arg_append("chip_enable_openthread" "true") +else() + chip_gn_arg_append("chip_enable_openthread" "false") endif() if (CONFIG_OPENTHREAD_FTD) chip_gn_arg_append("chip_openthread_ftd" "true") +else() + chip_gn_arg_append("chip_openthread_ftd" "false") endif() if (CONFIG_ENABLE_OTA_REQUESTOR) @@ -174,6 +201,9 @@ endif() if (CONFIG_CHIP_ENABLE_EXTERNAL_PLATFORM) chip_gn_arg_append("chip_device_platform" "\"external\"") + if (CONFIG_ENABLE_CHIP_SHELL) + chip_gn_arg_append("chip_shell_platform" "\"esp32\"") + endif() chip_gn_arg_append("chip_platform_target" "\"//${CONFIG_CHIP_EXTERNAL_PLATFORM_DIR}\"") endif() @@ -204,6 +234,11 @@ if (CONFIG_ENABLE_ESP32_DEVICE_INFO_PROVIDER) chip_gn_arg_append("chip_use_device_info_provider" "true") endif() +if (CONFIG_SEC_CERT_DAC_PROVIDER) + chip_gn_arg_append("chip_use_secure_cert_dac_provider" "true") +endif() + + set(args_gn_input "${CMAKE_CURRENT_BINARY_DIR}/args.gn.in") file(GENERATE OUTPUT "${args_gn_input}" CONTENT "${chip_gn_args}") @@ -343,6 +378,11 @@ endif() idf_component_get_property(main_lib main COMPONENT_LIB) list(APPEND chip_libraries $) +if (CONFIG_SEC_CERT_DAC_PROVIDER) + idf_component_get_property(esp32_secure_cert_mgr_lib espressif__esp_secure_cert_mgr COMPONENT_LIB) + list(APPEND chip_libraries $) +endif() + target_link_libraries(${COMPONENT_LIB} INTERFACE -Wl,--start-group ${chip_libraries} $ $ @@ -352,8 +392,10 @@ target_link_libraries(${COMPONENT_LIB} INTERFACE -Wl,--start-group add_dependencies(${COMPONENT_LIB} chip_gn) if(CONFIG_ENABLE_PW_RPC) - set(WRAP_FUNCTIONS esp_log_write) - target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--wrap=${WRAP_FUNCTIONS}") + set(WRAP_FUNCTIONS esp_log_write esp_log_writev) + foreach(func ${WRAP_FUNCTIONS}) + target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--wrap=${func}") + endforeach() endif() # Build Matter OTA image diff --git a/config/esp32/components/chip/Kconfig b/config/esp32/components/chip/Kconfig index 2b2175f3e834c3..dc3b03b07ac555 100644 --- a/config/esp32/components/chip/Kconfig +++ b/config/esp32/components/chip/Kconfig @@ -108,6 +108,14 @@ menu "CHIP Core" help Build CHIP test binaries. + config DISPATCH_EVENT_LONG_DISPATCH_TIME_WARNING_THRESHOLD_MS + int "Set threshold in ms" + default 700 + help + Time threshold for warning that dispatched took too long. You can + set this default set to 0 to to disable event dispatching time + measurement and suppress the logs "Long dispatch time:...". + # TODO: add log level selection endmenu # "General Options" @@ -498,6 +506,13 @@ menu "CHIP Device Layer" menu "CHIP Thread Options" visible if OPENTHREAD_ENABLED + config ENABLE_MATTER_OVER_THREAD + bool "Enable Matter-over-Thread Support" + default y + depends on OPENTHREAD_ENABLED + help + Enables support for sending and receiving CHIP messages over a Thread Connection. + config THREAD_TASK_STACK_SIZE int "Thread task stack size" default 5120 @@ -678,6 +693,13 @@ menu "CHIP Device Layer" help Enable ESP32 Device LocationCapability + config SEC_CERT_DAC_PROVIDER + bool "Use Secure Cert DAC Provider" + default n + help + Use ESP32 Secure Cert DAC Provider which is ESP32 DeviceAttestationCredentialsProvider implementation which reads attestation + information from the esp_secure_cert partition + endmenu @@ -895,13 +917,6 @@ menu "CHIP Device Layer" help Enable esp32 as a BLE Commissioner. - config ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE - bool "Enable Commissionee and Commissioner mode" - default n - depends on ENABLE_ESP32_BLE_Controller - help - Enable including commissioner code (CHIPDeviceController.cpp) in the commissionee (Server.cpp) code. - endmenu endmenu diff --git a/config/esp32/components/chip/idf_component.yml b/config/esp32/components/chip/idf_component.yml index 7ffcad18792541..30d77e8b2eb7c9 100644 --- a/config/esp32/components/chip/idf_component.yml +++ b/config/esp32/components/chip/idf_component.yml @@ -5,3 +5,8 @@ dependencies: rules: - if: "idf_version >=5.0" - if: "target != esp32h2" + + espressif/esp_secure_cert_mgr: + version: "^2.2.1" + rules: + - if: "idf_version >=4.3" diff --git a/config/mbed/CMakeLists.txt b/config/mbed/CMakeLists.txt index b50f46e0acc2f3..a7006062f12ace 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 @@ -379,6 +209,10 @@ list(APPEND CHIP_DEFINES PW_RPC_USE_GLOBAL_MUTEX=0 ) +# TODO: Update this to use target_link_libraries instead of +# target_include_directories. target_include_directories never should be used to +# access other libraries since it does not add source files to the build graph +# and does not support transitive dependencies. target_include_directories(${APP_TARGET} PRIVATE ${PIGWEED_ROOT}/pw_sys_io/public ${PIGWEED_ROOT}/pw_assert/public @@ -411,6 +245,7 @@ target_include_directories(${APP_TARGET} PRIVATE ${PIGWEED_ROOT}/pw_function/public ${PIGWEED_ROOT}/pw_preprocessor/public ${PIGWEED_ROOT}/pw_rpc/system_server/public + ${PIGWEED_ROOT}/pw_toolchain/public ${PIGWEED_ROOT}/third_party/fuchsia/repo/sdk/lib/fit/include ${PIGWEED_ROOT}/third_party/fuchsia/repo/sdk/lib/stdcompat/include ${CHIP_ROOT}/third_party/nanopb/repo @@ -420,14 +255,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 +271,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 +284,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 +294,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/Kconfig b/config/nrfconnect/chip-module/Kconfig index 390a99b1556e77..e5fbdb405e365d 100644 --- a/config/nrfconnect/chip-module/Kconfig +++ b/config/nrfconnect/chip-module/Kconfig @@ -139,6 +139,14 @@ config CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE when flashing the firmware using the west tool, includes the factory data as well. +config CHIP_FACTORY_DATA_GENERATE_ONBOARDING_CODES + bool "Generate onboarding codes during the generation of a factory data set" + help + Enables generation of onboarding codes (manual pairing code and QR code) + during the generation of a factory data set. You can provide the + onboarding codes a Matter controller to commission a device to a Matter + network. + # Select source of the certificates choice CHIP_FACTORY_DATA_CERT_SOURCE prompt "Attestation certificate file source" diff --git a/config/nrfconnect/chip-module/Kconfig.features b/config/nrfconnect/chip-module/Kconfig.features index 99d13e9d56aa59..0501e351681e9a 100644 --- a/config/nrfconnect/chip-module/Kconfig.features +++ b/config/nrfconnect/chip-module/Kconfig.features @@ -171,4 +171,27 @@ config CHIP_WIFI_CONNECTION_RECOVERY_JITTER a random jitter interval is added to it to avoid periodicity. The random jitter is selected within range [-JITTER; +JITTER]. +config CHIP_ICD_SUBSCRIPTION_HANDLING + bool "Enables platform specific handling of ICD subscriptions" + help + Enables platform specific implementation that handles ICD subscription requests + and selects subscription report interval value considering maximum interval preferred + by the publisher. + +if CHIP_ICD_SUBSCRIPTION_HANDLING + +config CHIP_MAX_PREFERRED_SUBSCRIPTION_REPORT_INTERVAL + int "Maximum preferred interval of sending subscription reports (s)" + default 60 + help + Provides maximum preferred interval to be used by a publisher for negotiation + of the final maximum subscription report interval, after receiving a subscription + request from the initiator. This value should be selected as a compromise between + keeping the power consumption low due to not sending reports too often, and allowing + the initiator device to detect the publisher absence reasonably fast due to not sending + the reports too rarely. The current algorithm is to select bigger value from the one + requested by the initiator and the one preferred by the publisher. + +endif # CHIP_ICD_SUBSCRIPTION_HANDLING + endif # CHIP diff --git a/config/nrfconnect/chip-module/generate_factory_data.cmake b/config/nrfconnect/chip-module/generate_factory_data.cmake index be0c4c0fac692c..a754f22873c13d 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") @@ -87,13 +91,12 @@ string(APPEND script_args "--passcode ${CONFIG_CHIP_DEVICE_SPAKE2_PASSCODE}\n") string(APPEND script_args "--include_passcode\n") string(APPEND script_args "--overwrite\n") +if(CONFIG_CHIP_FACTORY_DATA_GENERATE_ONBOARDING_CODES) + string(APPEND script_args "--generate_onboarding\n") +endif() + # 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..dbe54d4d122c37 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") @@ -42,6 +42,22 @@ FetchContent_Declare( GIT_PROGRESS ON ) +# Apply a patch to TF-M to support GCC 12 +FetchContent_Declare( + trusted-firmware-m + GIT_REPOSITORY https://git.trustedfirmware.org/TF-M/trusted-firmware-m.git + GIT_TAG d0c0a67f1b412e89d09b0987091c12998c4e4660 + GIT_SHALLOW OFF + GIT_PROGRESS ON + # Note: This prevents FetchContent_MakeAvailable() from calling + # add_subdirectory() on the fetched repository. TF-M needs a + # standalone build because it relies on functions defined in its + # own toolchain files and contains paths that reference the + # top-level project instead of its own project. + SOURCE_SUBDIR NONE + PATCH_COMMAND git reset --hard --quiet && git clean --force -dx --quiet && git apply ${CMAKE_CURRENT_LIST_DIR}/tf-m.patch +) + # Open IoT SDK configuration set(IOTSDK_FETCH_LIST mcu-driver-reference-platforms-for-arm @@ -193,7 +209,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 +218,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 +226,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 +240,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 +250,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 +267,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/openiotsdk/cmake/tf-m.patch b/config/openiotsdk/cmake/tf-m.patch new file mode 100644 index 00000000000000..975696d5e63752 --- /dev/null +++ b/config/openiotsdk/cmake/tf-m.patch @@ -0,0 +1,12 @@ +diff --git a/toolchain_GNUARM.cmake b/toolchain_GNUARM.cmake +index d044ed4a5..3d8f64d17 100644 +--- a/toolchain_GNUARM.cmake ++++ b/toolchain_GNUARM.cmake +@@ -71,7 +71,6 @@ macro(tfm_toolchain_reset_linker_flags) + --entry=Reset_Handler + --specs=nano.specs + LINKER:-check-sections +- LINKER:-fatal-warnings + LINKER:--gc-sections + LINKER:--no-wchar-size-warning + ${MEMORY_USAGE_FLAG} diff --git a/config/telink/app/zephyr.conf b/config/telink/app/zephyr.conf index ddef211ffa0c86..a8a4c0af92b8a7 100644 --- a/config/telink/app/zephyr.conf +++ b/config/telink/app/zephyr.conf @@ -22,13 +22,15 @@ CONFIG_SERIAL=y CONFIG_LOG=y CONFIG_LOG_MODE_MINIMAL=y CONFIG_PRINTK=y -CONFIG_ASSERT=y +# CONFIG_ASSERT=y CONFIG_CBPRINTF_LIBC_SUBSTS=y # Set the maximum log level (DEBUG) CONFIG_LOG_DEFAULT_LEVEL=4 CONFIG_MATTER_LOG_LEVEL_DBG=y +CONFIG_MCUBOOT_BOOTUTIL_LIB=y CONFIG_MCUBOOT_UTIL_LOG_LEVEL_DBG=y +CONFIG_NET_LOG=y CONFIG_IEEE802154_DRIVER_LOG_LEVEL_DBG=y CONFIG_NVS_LOG_LEVEL_DBG=y CONFIG_OPENTHREAD_LOG_LEVEL_DEBG=y @@ -44,7 +46,6 @@ CONFIG_LOG_MAX_LEVEL=3 # Generic networking options CONFIG_NETWORKING=y -CONFIG_NET_CONFIG_SETTINGS=y CONFIG_NET_SOCKETS=y CONFIG_NET_SOCKETS_POSIX_NAMES=n CONFIG_NET_CONFIG_INIT_TIMEOUT=0 @@ -92,9 +93,6 @@ CONFIG_NET_L2_OPENTHREAD=y CONFIG_OPENTHREAD_DEBUG=y CONFIG_OPENTHREAD_L2_DEBUG=y -CONFIG_NET_CONFIG_MY_IPV6_ADDR="fdde:ad00:beef::1" -CONFIG_NET_CONFIG_PEER_IPV6_ADDR="fdde:ad00:beef::2" - # OpenThread configs CONFIG_OPENTHREAD_SLAAC=y CONFIG_OPENTHREAD_RADIO_WORKQUEUE_STACK_SIZE=608 @@ -125,7 +123,6 @@ CONFIG_TELINK_B91_REBOOT_ON_FAULT=y # Shell settings CONFIG_SHELL=n -CONFIG_SHELL_BACKEND_SERIAL_RX_RING_BUFFER_SIZE=255 -# Legacy -CONFIG_LEGACY_INCLUDE_PATH=y +# BLE MAC address +CONFIG_B91_BLE_CTRL_MAC_FLASH_ADDR=0x1FE000 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..bce258355feff8 100644 --- a/config/telink/chip-module/Kconfig +++ b/config/telink/chip-module/Kconfig @@ -152,13 +152,30 @@ config CHIP_LOG_SIZE_OPTIMIZATION config CHIP_BUTTON_MANAGER_IRQ_MODE bool "Use GPIO in an IRQ mode instead of polling the GPIO" - default n + default PM help Use GPIO in an IRQ mode to avoid button polling loop and extend the battery lifetime by waking up by GPIO event. GPIO events are working only with GPIO IRQ. This option changes button matrix configuration. config CHIP_ENABLE_APPLICATION_STATUS_LED bool "Enable application status LED" - default y + default !(PM) help Enable application status LED. + +config CHIP_ENABLE_PM_DURING_BLE + bool "Enable PM during BLE operation" + default PM + help + Enable PM during BLE operation. + +config CHIP_OPENTHREAD_TX_POWER + int "OpenThread Transmission power" + range -30 9 + default 0 + help + OpenThread Transmission power in dBm. + +config SHELL_BACKEND_SERIAL_RX_RING_BUFFER_SIZE + int + default 255 if SHELL_BACKEND_SERIAL 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/tizen/chip-gn/platform/BUILD.gn b/config/tizen/chip-gn/platform/BUILD.gn index 781cf53d222929..7d2f25e9bcf4f8 100644 --- a/config/tizen/chip-gn/platform/BUILD.gn +++ b/config/tizen/chip-gn/platform/BUILD.gn @@ -35,6 +35,10 @@ pkg_config("glib") { ] } +pkg_config("capi-system-info") { + packages = [ "capi-system-info" ] +} + if (chip_mdns == "platform") { pkg_config("nsd-dns-sd") { packages = [ "nsd-dns-sd" ] @@ -64,6 +68,7 @@ source_set("tizen") { ":dlog", ":glib", ":capi-appfw-preference", + ":capi-system-info", ] if (chip_mdns == "platform") { 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/ERROR_CODES.md b/docs/ERROR_CODES.md index 4026219328fa2f..38aa66f59f34d0 100644 --- a/docs/ERROR_CODES.md +++ b/docs/ERROR_CODES.md @@ -8,238 +8,144 @@ This file was **AUTOMATICALLY** generated by - [SDK Core errors: range `0x000..0x0FF`](#sdk-core-errors) - [SDK Inet Layer errors: range `0x100..0x1FF`](#sdk-inet-layer-errors) - [SDK Device Layer errors: range `0x200..0x2FF`](#sdk-device-layer-errors) -- [ASN.1 Layer errors: range `0x300..0x3FF`](#asn.1-layer-errors) +- [ASN1 Layer errors: range `0x300..0x3FF`](#asn1-layer-errors) - [BLE Layer errors: range `0x400..0x4FF`](#ble-layer-errors) - [IM Global errors errors: range `0x500..0x5FF`](#im-global-errors-errors) ## SDK Core errors -| Decimal | Hex | Name | -| ------- | ---- | ---------------------------------------------------- | -| 0 | 0x00 | `CHIP_NO_ERROR` | -| 1 | 0x01 | `CHIP_ERROR_SENDING_BLOCKED` | -| 2 | 0x02 | `CHIP_ERROR_CONNECTION_ABORTED` | -| 3 | 0x03 | `CHIP_ERROR_INCORRECT_STATE` | -| 4 | 0x04 | `CHIP_ERROR_MESSAGE_TOO_LONG` | -| 5 | 0x05 | `CHIP_ERROR_UNSUPPORTED_EXCHANGE_VERSION` | -| 6 | 0x06 | `CHIP_ERROR_TOO_MANY_UNSOLICITED_MESSAGE_HANDLERS` | -| 7 | 0x07 | `CHIP_ERROR_NO_UNSOLICITED_MESSAGE_HANDLER` | -| 8 | 0x08 | `CHIP_ERROR_NO_CONNECTION_HANDLER` | -| 9 | 0x09 | `CHIP_ERROR_TOO_MANY_PEER_NODES` | -| 10 | 0x0A | `CHIP_ERROR_SENTINEL` | -| 11 | 0x0B | `CHIP_ERROR_NO_MEMORY` | -| 12 | 0x0C | `CHIP_ERROR_NO_MESSAGE_HANDLER` | -| 13 | 0x0D | `CHIP_ERROR_MESSAGE_INCOMPLETE` | -| 14 | 0x0E | `CHIP_ERROR_DATA_NOT_ALIGNED` | -| 15 | 0x0F | `CHIP_ERROR_UNKNOWN_KEY_TYPE` | -| 16 | 0x10 | `CHIP_ERROR_KEY_NOT_FOUND` | -| 17 | 0x11 | `CHIP_ERROR_WRONG_ENCRYPTION_TYPE` | -| 18 | 0x12 | `CHIP_ERROR_TOO_MANY_KEYS` | -| 19 | 0x13 | `CHIP_ERROR_INTEGRITY_CHECK_FAILED` | -| 20 | 0x14 | `CHIP_ERROR_INVALID_SIGNATURE` | -| 21 | 0x15 | `CHIP_ERROR_UNSUPPORTED_MESSAGE_VERSION` | -| 22 | 0x16 | `CHIP_ERROR_UNSUPPORTED_ENCRYPTION_TYPE` | -| 23 | 0x17 | `CHIP_ERROR_UNSUPPORTED_SIGNATURE_TYPE` | -| 24 | 0x18 | `CHIP_ERROR_INVALID_MESSAGE_LENGTH` | -| 25 | 0x19 | `CHIP_ERROR_BUFFER_TOO_SMALL` | -| 26 | 0x1A | `CHIP_ERROR_DUPLICATE_KEY_ID` | -| 27 | 0x1B | `CHIP_ERROR_WRONG_KEY_TYPE` | -| 28 | 0x1C | `CHIP_ERROR_WELL_UNINITIALIZED` | -| 29 | 0x1D | `CHIP_ERROR_WELL_EMPTY` | -| 30 | 0x1E | `CHIP_ERROR_INVALID_STRING_LENGTH` | -| 31 | 0x1F | `CHIP_ERROR_INVALID_LIST_LENGTH` | -| 32 | 0x20 | `CHIP_ERROR_INVALID_INTEGRITY_TYPE` | -| 33 | 0x21 | `CHIP_ERROR_END_OF_TLV` | -| 34 | 0x22 | `CHIP_ERROR_TLV_UNDERRUN` | -| 35 | 0x23 | `CHIP_ERROR_INVALID_TLV_ELEMENT` | -| 36 | 0x24 | `CHIP_ERROR_INVALID_TLV_TAG` | -| 37 | 0x25 | `CHIP_ERROR_UNKNOWN_IMPLICIT_TLV_TAG` | -| 38 | 0x26 | `CHIP_ERROR_WRONG_TLV_TYPE` | -| 39 | 0x27 | `CHIP_ERROR_TLV_CONTAINER_OPEN` | -| 40 | 0x28 | `CHIP_ERROR_INVALID_TRANSFER_MODE` | -| 41 | 0x29 | `CHIP_ERROR_INVALID_PROFILE_ID` | -| 42 | 0x2A | `CHIP_ERROR_INVALID_MESSAGE_TYPE` | -| 43 | 0x2B | `CHIP_ERROR_UNEXPECTED_TLV_ELEMENT` | -| 44 | 0x2C | `CHIP_ERROR_STATUS_REPORT_RECEIVED` | -| 45 | 0x2D | `CHIP_ERROR_NOT_IMPLEMENTED` | -| 46 | 0x2E | `CHIP_ERROR_INVALID_ADDRESS` | -| 47 | 0x2F | `CHIP_ERROR_INVALID_ARGUMENT` | -| 48 | 0x30 | `CHIP_ERROR_INVALID_PATH_LIST` | -| 49 | 0x31 | `CHIP_ERROR_INVALID_DATA_LIST` | -| 50 | 0x32 | `CHIP_ERROR_TIMEOUT` | -| 51 | 0x33 | `CHIP_ERROR_INVALID_DEVICE_DESCRIPTOR` | -| 52 | 0x34 | `CHIP_ERROR_UNSUPPORTED_DEVICE_DESCRIPTOR_VERSION` | -| 53 | 0x35 | `CHIP_ERROR_END_OF_INPUT` | -| 54 | 0x36 | `CHIP_ERROR_RATE_LIMIT_EXCEEDED` | -| 55 | 0x37 | `CHIP_ERROR_SECURITY_MANAGER_BUSY` | -| 56 | 0x38 | `CHIP_ERROR_INVALID_PASE_PARAMETER` | -| 57 | 0x39 | `CHIP_ERROR_PASE_SUPPORTS_ONLY_CONFIG1` | -| 58 | 0x3A | `CHIP_ERROR_KEY_CONFIRMATION_FAILED` | -| 59 | 0x3B | `CHIP_ERROR_INVALID_USE_OF_SESSION_KEY` | -| 60 | 0x3C | `CHIP_ERROR_CONNECTION_CLOSED_UNEXPECTEDLY` | -| 61 | 0x3D | `CHIP_ERROR_MISSING_TLV_ELEMENT` | -| 62 | 0x3E | `CHIP_ERROR_RANDOM_DATA_UNAVAILABLE` | -| 63 | 0x3F | `CHIP_ERROR_UNSUPPORTED_HOST_PORT_ELEMENT` | -| 64 | 0x40 | `CHIP_ERROR_INVALID_HOST_SUFFIX_INDEX` | -| 65 | 0x41 | `CHIP_ERROR_HOST_PORT_LIST_EMPTY` | -| 66 | 0x42 | `CHIP_ERROR_UNSUPPORTED_AUTH_MODE` | -| 67 | 0x43 | `CHIP_ERROR_INVALID_SERVICE_EP` | -| 68 | 0x44 | `CHIP_ERROR_INVALID_DIRECTORY_ENTRY_TYPE` | -| 69 | 0x45 | `CHIP_ERROR_FORCED_RESET` | -| 70 | 0x46 | `CHIP_ERROR_NO_ENDPOINT` | -| 71 | 0x47 | `CHIP_ERROR_INVALID_DESTINATION_NODE_ID` | -| 72 | 0x48 | `CHIP_ERROR_NOT_CONNECTED` | -| 73 | 0x49 | `CHIP_ERROR_NO_SW_UPDATE_AVAILABLE` | -| 74 | 0x4A | `CHIP_ERROR_CA_CERT_NOT_FOUND` | -| 75 | 0x4B | `CHIP_ERROR_CERT_PATH_LEN_CONSTRAINT_EXCEEDED` | -| 76 | 0x4C | `CHIP_ERROR_CERT_PATH_TOO_LONG` | -| 77 | 0x4D | `CHIP_ERROR_CERT_USAGE_NOT_ALLOWED` | -| 78 | 0x4E | `CHIP_ERROR_CERT_EXPIRED` | -| 79 | 0x4F | `CHIP_ERROR_CERT_NOT_VALID_YET` | -| 80 | 0x50 | `CHIP_ERROR_UNSUPPORTED_CERT_FORMAT` | -| 81 | 0x51 | `CHIP_ERROR_UNSUPPORTED_ELLIPTIC_CURVE` | -| 82 | 0x52 | `CHIP_ERROR_CERT_NOT_USED` | -| 83 | 0x53 | `CHIP_ERROR_CERT_NOT_FOUND` | -| 84 | 0x54 | `CHIP_ERROR_INVALID_CASE_PARAMETER` | -| 85 | 0x55 | `CHIP_ERROR_UNSUPPORTED_CASE_CONFIGURATION` | -| 86 | 0x56 | `CHIP_ERROR_CERT_LOAD_FAILED` | -| 87 | 0x57 | `CHIP_ERROR_CERT_NOT_TRUSTED` | -| 88 | 0x58 | `CHIP_ERROR_INVALID_ACCESS_TOKEN` | -| 89 | 0x59 | `CHIP_ERROR_WRONG_CERT_DN` | -| 90 | 0x5A | `CHIP_ERROR_INVALID_PROVISIONING_BUNDLE` | -| 91 | 0x5B | `CHIP_ERROR_PROVISIONING_BUNDLE_DECRYPTION_ERROR` | -| 92 | 0x5C | `CHIP_ERROR_WRONG_NODE_ID` | -| 93 | 0x5D | `CHIP_ERROR_CONN_ACCEPTED_ON_WRONG_PORT` | -| 94 | 0x5E | `CHIP_ERROR_CALLBACK_REPLACED` | -| 95 | 0x5F | `CHIP_ERROR_NO_CASE_AUTH_DELEGATE` | -| 96 | 0x60 | `CHIP_ERROR_DEVICE_LOCATE_TIMEOUT` | -| 97 | 0x61 | `CHIP_ERROR_DEVICE_CONNECT_TIMEOUT` | -| 98 | 0x62 | `CHIP_ERROR_DEVICE_AUTH_TIMEOUT` | -| 99 | 0x63 | `CHIP_ERROR_MESSAGE_NOT_ACKNOWLEDGED` | -| 100 | 0x64 | `CHIP_ERROR_RETRANS_TABLE_FULL` | -| 101 | 0x65 | `CHIP_ERROR_INVALID_ACK_MESSAGE_COUNTER` | -| 102 | 0x66 | `CHIP_ERROR_SEND_THROTTLED` | -| 103 | 0x67 | `CHIP_ERROR_WRONG_MSG_VERSION_FOR_EXCHANGE` | -| 104 | 0x68 | `CHIP_ERROR_TRANSACTION_CANCELED` | -| 105 | 0x69 | `CHIP_ERROR_LISTENER_ALREADY_STARTED` | -| 106 | 0x6A | `CHIP_ERROR_LISTENER_ALREADY_STOPPED` | -| 107 | 0x6B | `CHIP_ERROR_INVALID_SUBSCRIPTION` | -| 108 | 0x6C | `CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE` | -| 109 | 0x6D | `CHIP_ERROR_PASE_RECONFIGURE_REQUIRED` | -| 110 | 0x6E | `CHIP_ERROR_INVALID_PASE_CONFIGURATION` | -| 111 | 0x6F | `CHIP_ERROR_NO_COMMON_PASE_CONFIGURATIONS` | -| 112 | 0x70 | `CHIP_ERROR_UNSOLICITED_MSG_NO_ORIGINATOR` | -| 113 | 0x71 | `CHIP_ERROR_INVALID_FABRIC_INDEX` | -| 114 | 0x72 | `CHIP_ERROR_TOO_MANY_CONNECTIONS` | -| 115 | 0x73 | `CHIP_ERROR_SHUT_DOWN` | -| 116 | 0x74 | `CHIP_ERROR_CANCELLED` | -| 117 | 0x75 | `CHIP_ERROR_DRBG_ENTROPY_SOURCE_FAILED` | -| 118 | 0x76 | `CHIP_ERROR_TLV_TAG_NOT_FOUND` | -| 119 | 0x77 | `CHIP_ERROR_MISSING_SECURE_SESSION` | -| 120 | 0x78 | `CHIP_ERROR_INVALID_ADMIN_SUBJECT` | -| 121 | 0x79 | `CHIP_ERROR_INSUFFICIENT_PRIVILEGE` | -| 122 | 0x7A | `CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_REPORT_IB` | -| 123 | 0x7B | `CHIP_ERROR_IM_MALFORMED_EVENT_STATUS_IB` | -| 124 | 0x7C | `CHIP_ERROR_IM_MALFORMED_STATUS_RESPONSE_MESSAGE` | -| 125 | 0x7D | `CHIP_ERROR_MESSAGE_COUNTER_EXHAUSTED` | -| 126 | 0x7E | `CHIP_ERROR_FABRIC_EXISTS` | -| 127 | 0x7F | `CHIP_ERROR_KEY_NOT_FOUND_FROM_PEER` | -| 128 | 0x80 | `CHIP_ERROR_WRONG_ENCRYPTION_TYPE_FROM_PEER` | -| 129 | 0x81 | `CHIP_ERROR_UNKNOWN_KEY_TYPE_FROM_PEER` | -| 130 | 0x82 | `CHIP_ERROR_INVALID_USE_OF_SESSION_KEY_FROM_PEER` | -| 131 | 0x83 | `CHIP_ERROR_UNSUPPORTED_ENCRYPTION_TYPE_FROM_PEER` | -| 132 | 0x84 | `CHIP_ERROR_INTERNAL_KEY_ERROR_FROM_PEER` | -| 133 | 0x85 | `CHIP_ERROR_INVALID_KEY_ID` | -| 134 | 0x86 | `CHIP_ERROR_INVALID_TIME` | -| 135 | 0x87 | `CHIP_ERROR_LOCKING_FAILURE` | -| 136 | 0x88 | `CHIP_ERROR_UNSUPPORTED_PASSCODE_CONFIG` | -| 137 | 0x89 | `CHIP_ERROR_PASSCODE_AUTHENTICATION_FAILED` | -| 138 | 0x8A | `CHIP_ERROR_PASSCODE_FINGERPRINT_FAILED` | -| 139 | 0x8B | `CHIP_ERROR_SERIALIZATION_ELEMENT_NULL` | -| 140 | 0x8C | `CHIP_ERROR_WRONG_CERT_SIGNATURE_ALGORITHM` | -| 141 | 0x8D | `CHIP_ERROR_WRONG_CHIP_SIGNATURE_ALGORITHM` | -| 142 | 0x8E | `CHIP_ERROR_SCHEMA_MISMATCH` | -| 143 | 0x8F | `CHIP_ERROR_INVALID_INTEGER_VALUE` | -| 144 | 0x90 | `CHIP_ERROR_CASE_RECONFIG_REQUIRED` | -| 145 | 0x91 | `CHIP_ERROR_TOO_MANY_CASE_RECONFIGURATIONS` | -| 146 | 0x92 | `CHIP_ERROR_BAD_REQUEST` | -| 147 | 0x93 | `CHIP_ERROR_INVALID_MESSAGE_FLAG` | -| 148 | 0x94 | `CHIP_ERROR_KEY_EXPORT_RECONFIGURE_REQUIRED` | -| 149 | 0x95 | `CHIP_ERROR_INVALID_KEY_EXPORT_CONFIGURATION` | -| 150 | 0x96 | `CHIP_ERROR_NO_COMMON_KEY_EXPORT_CONFIGURATIONS` | -| 151 | 0x97 | `CHIP_ERROR_NO_KEY_EXPORT_DELEGATE` | -| 152 | 0x98 | `CHIP_ERROR_UNAUTHORIZED_KEY_EXPORT_REQUEST` | -| 153 | 0x99 | `CHIP_ERROR_UNAUTHORIZED_KEY_EXPORT_RESPONSE` | -| 154 | 0x9A | `CHIP_ERROR_EXPORTED_KEY_AUTHENTICATION_FAILED` | -| 155 | 0x9B | `CHIP_ERROR_TOO_MANY_SHARED_SESSION_END_NODES` | -| 156 | 0x9C | `CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_DATA_IB` | -| 157 | 0x9D | `CHIP_ERROR_WRONG_CERT_TYPE` | -| 158 | 0x9E | `CHIP_ERROR_DEFAULT_EVENT_HANDLER_NOT_CALLED` | -| 159 | 0x9F | `CHIP_ERROR_PERSISTED_STORAGE_FAILED` | -| 160 | 0xA0 | `CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND` | -| 161 | 0xA1 | `CHIP_ERROR_IM_FABRIC_DELETED` | -| 162 | 0xA2 | `CHIP_ERROR_PROFILE_STRING_CONTEXT_NOT_REGISTERED` | -| 163 | 0xA3 | `CHIP_ERROR_INCOMPATIBLE_SCHEMA_VERSION` | -| 165 | 0xA5 | `CHIP_ERROR_ACCESS_DENIED` | -| 166 | 0xA6 | `CHIP_ERROR_UNKNOWN_RESOURCE_ID` | -| 167 | 0xA7 | `CHIP_ERROR_VERSION_MISMATCH` | -| 168 | 0xA8 | `CHIP_ERROR_UNSUPPORTED_THREAD_NETWORK_CREATE` | -| 169 | 0xA9 | `CHIP_ERROR_INCONSISTENT_CONDITIONALITY` | -| 170 | 0xAA | `CHIP_ERROR_LOCAL_DATA_INCONSISTENT` | -| 171 | 0xAB | `CHIP_ERROR_EVENT_ID_FOUND` | -| 172 | 0xAC | `CHIP_ERROR_INTERNAL` | -| 173 | 0xAD | `CHIP_ERROR_OPEN_FAILED` | -| 174 | 0xAE | `CHIP_ERROR_READ_FAILED` | -| 175 | 0xAF | `CHIP_ERROR_WRITE_FAILED` | -| 176 | 0xB0 | `CHIP_ERROR_DECODE_FAILED` | -| 177 | 0xB1 | `CHIP_ERROR_SESSION_KEY_SUSPENDED` | -| 178 | 0xB2 | `CHIP_ERROR_UNSUPPORTED_WIRELESS_REGULATORY_DOMAIN` | -| 179 | 0xB3 | `CHIP_ERROR_UNSUPPORTED_WIRELESS_OPERATING_LOCATION` | -| 180 | 0xB4 | `CHIP_ERROR_MDNS_COLLISION` | -| 181 | 0xB5 | `CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB` | -| 182 | 0xB6 | `CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB` | -| 183 | 0xB7 | `CHIP_ERROR_IM_MALFORMED_COMMAND_PATH_IB` | -| 184 | 0xB8 | `CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_STATUS_IB` | -| 185 | 0xB9 | `CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_IB` | -| 186 | 0xBA | `CHIP_ERROR_IM_MALFORMED_EVENT_DATA_IB` | -| 187 | 0xBB | `CHIP_ERROR_IM_MALFORMED_STATUS_IB` | -| 188 | 0xBC | `CHIP_ERROR_PEER_NODE_NOT_FOUND` | -| 189 | 0xBD | `CHIP_ERROR_HSM` | -| 190 | 0xBE | `CHIP_ERROR_INTERMEDIATE_CA_NOT_REQUIRED` | -| 191 | 0xBF | `CHIP_ERROR_REAL_TIME_NOT_SYNCED` | -| 192 | 0xC0 | `CHIP_ERROR_UNEXPECTED_EVENT` | -| 193 | 0xC1 | `CHIP_ERROR_ENDPOINT_POOL_FULL` | -| 194 | 0xC2 | `CHIP_ERROR_INBOUND_MESSAGE_TOO_BIG` | -| 195 | 0xC3 | `CHIP_ERROR_OUTBOUND_MESSAGE_TOO_BIG` | -| 196 | 0xC4 | `CHIP_ERROR_DUPLICATE_MESSAGE_RECEIVED` | -| 197 | 0xC5 | `CHIP_ERROR_INVALID_PUBLIC_KEY` | -| 198 | 0xC6 | `CHIP_ERROR_FABRIC_MISMATCH_ON_ICA` | -| 199 | 0xC7 | `CHIP_ERROR_MESSAGE_COUNTER_OUT_OF_WINDOW` | -| 200 | 0xC8 | `CHIP_ERROR_REBOOT_SIGNAL_RECEIVED` | -| 201 | 0xC9 | `CHIP_ERROR_NO_SHARED_TRUSTED_ROOT` | -| 202 | 0xCA | `CHIP_ERROR_IM_STATUS_CODE_RECEIVED` | -| 203 | 0xCB | `CHIP_ERROR_IM_MALFORMED_COMMAND_STATUS_IB` | -| 204 | 0xCC | `CHIP_ERROR_IM_MALFORMED_INVOKE_RESPONSE_IB` | -| 205 | 0xCD | `CHIP_ERROR_IM_MALFORMED_INVOKE_REQUEST_MESSAGE` | -| 206 | 0xCE | `CHIP_ERROR_IM_MALFORMED_INVOKE_RESPONSE_MESSAGE` | -| 207 | 0xCF | `CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_REPORT_MESSAGE` | -| 208 | 0xD0 | `CHIP_ERROR_IM_MALFORMED_WRITE_REQUEST_MESSAGE` | -| 209 | 0xD1 | `CHIP_ERROR_IM_MALFORMED_EVENT_FILTER_IB` | -| 210 | 0xD2 | `CHIP_ERROR_IM_MALFORMED_READ_REQUEST_MESSAGE` | -| 211 | 0xD3 | `CHIP_ERROR_IM_MALFORMED_SUBSCRIBE_REQUEST_MESSAGE` | -| 212 | 0xD4 | `CHIP_ERROR_IM_MALFORMED_SUBSCRIBE_RESPONSE_MESSAGE` | -| 213 | 0xD5 | `CHIP_ERROR_IM_MALFORMED_EVENT_REPORT_IB` | -| 214 | 0xD6 | `CHIP_ERROR_IM_MALFORMED_CLUSTER_PATH_IB` | -| 215 | 0xD7 | `CHIP_ERROR_IM_MALFORMED_DATA_VERSION_FILTER_IB` | -| 216 | 0xD8 | `CHIP_ERROR_NOT_FOUND` | -| 217 | 0xD9 | `CHIP_ERROR_IM_MALFORMED_TIMED_REQUEST_MESSAGE` | -| 218 | 0xDA | `CHIP_ERROR_INVALID_FILE_IDENTIFIER` | -| 219 | 0xDB | `CHIP_ERROR_BUSY` | -| 220 | 0xDC | `CHIP_ERROR_MAX_RETRY_EXCEEDED` | -| 221 | 0xDD | `CHIP_ERROR_PROVIDER_LIST_EXHAUSTED` | -| 222 | 0xDE | `CHIP_ERROR_ANOTHER_COMMISSIONING_IN_PROGRESS` | -| 223 | 0xDF | `CHIP_ERROR_INVALID_SCHEME_PREFIX` | -| 224 | 0xE0 | `CHIP_ERROR_MISSING_URI_SEPARATOR` | +| Decimal | Hex | Name | +| ------- | ---- | -------------------------------------------------- | +| 0 | 0x00 | `CHIP_NO_ERROR` | +| 1 | 0x01 | `CHIP_ERROR_SENDING_BLOCKED` | +| 2 | 0x02 | `CHIP_ERROR_CONNECTION_ABORTED` | +| 3 | 0x03 | `CHIP_ERROR_INCORRECT_STATE` | +| 4 | 0x04 | `CHIP_ERROR_MESSAGE_TOO_LONG` | +| 5 | 0x05 | `CHIP_ERROR_RECURSION_DEPTH_LIMIT` | +| 6 | 0x06 | `CHIP_ERROR_TOO_MANY_UNSOLICITED_MESSAGE_HANDLERS` | +| 7 | 0x07 | `CHIP_ERROR_NO_UNSOLICITED_MESSAGE_HANDLER` | +| 8 | 0x08 | `CHIP_ERROR_NO_CONNECTION_HANDLER` | +| 9 | 0x09 | `CHIP_ERROR_TOO_MANY_PEER_NODES` | +| 10 | 0x0A | `CHIP_ERROR_SENTINEL` | +| 11 | 0x0B | `CHIP_ERROR_NO_MEMORY` | +| 12 | 0x0C | `CHIP_ERROR_NO_MESSAGE_HANDLER` | +| 13 | 0x0D | `CHIP_ERROR_MESSAGE_INCOMPLETE` | +| 14 | 0x0E | `CHIP_ERROR_DATA_NOT_ALIGNED` | +| 15 | 0x0F | `CHIP_ERROR_UNKNOWN_KEY_TYPE` | +| 16 | 0x10 | `CHIP_ERROR_KEY_NOT_FOUND` | +| 17 | 0x11 | `CHIP_ERROR_WRONG_ENCRYPTION_TYPE` | +| 19 | 0x13 | `CHIP_ERROR_INTEGRITY_CHECK_FAILED` | +| 20 | 0x14 | `CHIP_ERROR_INVALID_SIGNATURE` | +| 23 | 0x17 | `CHIP_ERROR_UNSUPPORTED_SIGNATURE_TYPE` | +| 24 | 0x18 | `CHIP_ERROR_INVALID_MESSAGE_LENGTH` | +| 25 | 0x19 | `CHIP_ERROR_BUFFER_TOO_SMALL` | +| 26 | 0x1A | `CHIP_ERROR_DUPLICATE_KEY_ID` | +| 27 | 0x1B | `CHIP_ERROR_WRONG_KEY_TYPE` | +| 28 | 0x1C | `CHIP_ERROR_WELL_UNINITIALIZED` | +| 29 | 0x1D | `CHIP_ERROR_WELL_EMPTY` | +| 30 | 0x1E | `CHIP_ERROR_INVALID_STRING_LENGTH` | +| 31 | 0x1F | `CHIP_ERROR_INVALID_LIST_LENGTH` | +| 33 | 0x21 | `CHIP_ERROR_END_OF_TLV` | +| 34 | 0x22 | `CHIP_ERROR_TLV_UNDERRUN` | +| 35 | 0x23 | `CHIP_ERROR_INVALID_TLV_ELEMENT` | +| 36 | 0x24 | `CHIP_ERROR_INVALID_TLV_TAG` | +| 37 | 0x25 | `CHIP_ERROR_UNKNOWN_IMPLICIT_TLV_TAG` | +| 38 | 0x26 | `CHIP_ERROR_WRONG_TLV_TYPE` | +| 39 | 0x27 | `CHIP_ERROR_TLV_CONTAINER_OPEN` | +| 42 | 0x2A | `CHIP_ERROR_INVALID_MESSAGE_TYPE` | +| 43 | 0x2B | `CHIP_ERROR_UNEXPECTED_TLV_ELEMENT` | +| 45 | 0x2D | `CHIP_ERROR_NOT_IMPLEMENTED` | +| 46 | 0x2E | `CHIP_ERROR_INVALID_ADDRESS` | +| 47 | 0x2F | `CHIP_ERROR_INVALID_ARGUMENT` | +| 48 | 0x30 | `CHIP_ERROR_INVALID_PATH_LIST` | +| 49 | 0x31 | `CHIP_ERROR_INVALID_DATA_LIST` | +| 50 | 0x32 | `CHIP_ERROR_TIMEOUT` | +| 51 | 0x33 | `CHIP_ERROR_INVALID_DEVICE_DESCRIPTOR` | +| 56 | 0x38 | `CHIP_ERROR_INVALID_PASE_PARAMETER` | +| 59 | 0x3B | `CHIP_ERROR_INVALID_USE_OF_SESSION_KEY` | +| 60 | 0x3C | `CHIP_ERROR_CONNECTION_CLOSED_UNEXPECTEDLY` | +| 61 | 0x3D | `CHIP_ERROR_MISSING_TLV_ELEMENT` | +| 62 | 0x3E | `CHIP_ERROR_RANDOM_DATA_UNAVAILABLE` | +| 65 | 0x41 | `CHIP_ERROR_HOST_PORT_LIST_EMPTY` | +| 69 | 0x45 | `CHIP_ERROR_FORCED_RESET` | +| 70 | 0x46 | `CHIP_ERROR_NO_ENDPOINT` | +| 71 | 0x47 | `CHIP_ERROR_INVALID_DESTINATION_NODE_ID` | +| 72 | 0x48 | `CHIP_ERROR_NOT_CONNECTED` | +| 74 | 0x4A | `CHIP_ERROR_CA_CERT_NOT_FOUND` | +| 75 | 0x4B | `CHIP_ERROR_CERT_PATH_LEN_CONSTRAINT_EXCEEDED` | +| 76 | 0x4C | `CHIP_ERROR_CERT_PATH_TOO_LONG` | +| 77 | 0x4D | `CHIP_ERROR_CERT_USAGE_NOT_ALLOWED` | +| 78 | 0x4E | `CHIP_ERROR_CERT_EXPIRED` | +| 79 | 0x4F | `CHIP_ERROR_CERT_NOT_VALID_YET` | +| 80 | 0x50 | `CHIP_ERROR_UNSUPPORTED_CERT_FORMAT` | +| 81 | 0x51 | `CHIP_ERROR_UNSUPPORTED_ELLIPTIC_CURVE` | +| 83 | 0x53 | `CHIP_ERROR_CERT_NOT_FOUND` | +| 84 | 0x54 | `CHIP_ERROR_INVALID_CASE_PARAMETER` | +| 86 | 0x56 | `CHIP_ERROR_CERT_LOAD_FAILED` | +| 87 | 0x57 | `CHIP_ERROR_CERT_NOT_TRUSTED` | +| 89 | 0x59 | `CHIP_ERROR_WRONG_CERT_DN` | +| 92 | 0x5C | `CHIP_ERROR_WRONG_NODE_ID` | +| 100 | 0x64 | `CHIP_ERROR_RETRANS_TABLE_FULL` | +| 104 | 0x68 | `CHIP_ERROR_TRANSACTION_CANCELED` | +| 107 | 0x6B | `CHIP_ERROR_INVALID_SUBSCRIPTION` | +| 108 | 0x6C | `CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE` | +| 112 | 0x70 | `CHIP_ERROR_UNSOLICITED_MSG_NO_ORIGINATOR` | +| 113 | 0x71 | `CHIP_ERROR_INVALID_FABRIC_INDEX` | +| 114 | 0x72 | `CHIP_ERROR_TOO_MANY_CONNECTIONS` | +| 115 | 0x73 | `CHIP_ERROR_SHUT_DOWN` | +| 116 | 0x74 | `CHIP_ERROR_CANCELLED` | +| 118 | 0x76 | `CHIP_ERROR_TLV_TAG_NOT_FOUND` | +| 119 | 0x77 | `CHIP_ERROR_MISSING_SECURE_SESSION` | +| 120 | 0x78 | `CHIP_ERROR_INVALID_ADMIN_SUBJECT` | +| 121 | 0x79 | `CHIP_ERROR_INSUFFICIENT_PRIVILEGE` | +| 125 | 0x7D | `CHIP_ERROR_MESSAGE_COUNTER_EXHAUSTED` | +| 126 | 0x7E | `CHIP_ERROR_FABRIC_EXISTS` | +| 128 | 0x80 | `CHIP_ERROR_WRONG_ENCRYPTION_TYPE_FROM_PEER` | +| 133 | 0x85 | `CHIP_ERROR_INVALID_KEY_ID` | +| 134 | 0x86 | `CHIP_ERROR_INVALID_TIME` | +| 142 | 0x8E | `CHIP_ERROR_SCHEMA_MISMATCH` | +| 143 | 0x8F | `CHIP_ERROR_INVALID_INTEGER_VALUE` | +| 146 | 0x92 | `CHIP_ERROR_BAD_REQUEST` | +| 157 | 0x9D | `CHIP_ERROR_WRONG_CERT_TYPE` | +| 159 | 0x9F | `CHIP_ERROR_PERSISTED_STORAGE_FAILED` | +| 160 | 0xA0 | `CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND` | +| 161 | 0xA1 | `CHIP_ERROR_IM_FABRIC_DELETED` | +| 164 | 0xA4 | `CHIP_ERROR_IN_PROGRESS` | +| 165 | 0xA5 | `CHIP_ERROR_ACCESS_DENIED` | +| 166 | 0xA6 | `CHIP_ERROR_UNKNOWN_RESOURCE_ID` | +| 167 | 0xA7 | `CHIP_ERROR_VERSION_MISMATCH` | +| 171 | 0xAB | `CHIP_ERROR_EVENT_ID_FOUND` | +| 172 | 0xAC | `CHIP_ERROR_INTERNAL` | +| 173 | 0xAD | `CHIP_ERROR_OPEN_FAILED` | +| 174 | 0xAE | `CHIP_ERROR_READ_FAILED` | +| 175 | 0xAF | `CHIP_ERROR_WRITE_FAILED` | +| 176 | 0xB0 | `CHIP_ERROR_DECODE_FAILED` | +| 180 | 0xB4 | `CHIP_ERROR_MDNS_COLLISION` | +| 181 | 0xB5 | `CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB` | +| 182 | 0xB6 | `CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB` | +| 185 | 0xB9 | `CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_IB` | +| 186 | 0xBA | `CHIP_ERROR_IM_MALFORMED_EVENT_DATA_IB` | +| 188 | 0xBC | `CHIP_ERROR_PEER_NODE_NOT_FOUND` | +| 189 | 0xBD | `CHIP_ERROR_HSM` | +| 191 | 0xBF | `CHIP_ERROR_REAL_TIME_NOT_SYNCED` | +| 192 | 0xC0 | `CHIP_ERROR_UNEXPECTED_EVENT` | +| 193 | 0xC1 | `CHIP_ERROR_ENDPOINT_POOL_FULL` | +| 194 | 0xC2 | `CHIP_ERROR_INBOUND_MESSAGE_TOO_BIG` | +| 195 | 0xC3 | `CHIP_ERROR_OUTBOUND_MESSAGE_TOO_BIG` | +| 196 | 0xC4 | `CHIP_ERROR_DUPLICATE_MESSAGE_RECEIVED` | +| 197 | 0xC5 | `CHIP_ERROR_INVALID_PUBLIC_KEY` | +| 198 | 0xC6 | `CHIP_ERROR_FABRIC_MISMATCH_ON_ICA` | +| 201 | 0xC9 | `CHIP_ERROR_NO_SHARED_TRUSTED_ROOT` | +| 202 | 0xCA | `CHIP_ERROR_IM_STATUS_CODE_RECEIVED` | +| 215 | 0xD7 | `CHIP_ERROR_IM_MALFORMED_DATA_VERSION_FILTER_IB` | +| 216 | 0xD8 | `CHIP_ERROR_NOT_FOUND` | +| 218 | 0xDA | `CHIP_ERROR_INVALID_FILE_IDENTIFIER` | +| 219 | 0xDB | `CHIP_ERROR_BUSY` | +| 220 | 0xDC | `CHIP_ERROR_MAX_RETRY_EXCEEDED` | +| 221 | 0xDD | `CHIP_ERROR_PROVIDER_LIST_EXHAUSTED` | +| 223 | 0xDF | `CHIP_ERROR_INVALID_SCHEME_PREFIX` | +| 224 | 0xE0 | `CHIP_ERROR_MISSING_URI_SEPARATOR` | +| 225 | 0xE1 | `CHIP_ERROR_HANDLER_NOT_SET` | ## SDK Inet Layer errors @@ -271,7 +177,7 @@ This file was **AUTOMATICALLY** generated by | 515 | 0x203 | `CHIP_DEVICE_ERROR_SOFTWARE_UPDATE_ABORTED` | | 516 | 0x204 | `CHIP_DEVICE_ERROR_SOFTWARE_UPDATE_IGNORED` | -## ASN.1 Layer errors +## ASN1 Layer errors | Decimal | Hex | Name | | ------- | ----- | --------------------------------- | diff --git a/docs/code_generation.md b/docs/code_generation.md index f9b0d587f3fd9b..318cfedd359954 100644 --- a/docs/code_generation.md +++ b/docs/code_generation.md @@ -234,9 +234,48 @@ scripts/codepregen.py ${OUTPUT_DIRECTORY:-./zzz_pregenerated/} # To generate a single output you can use `--input-glob`: -scripts/codepregen.py --input-glob "*all-clusters*" ${OUTPUT_DIRECTORY:-./zzz_pregenerated/} +scripts/codepregen.py --input-glob "*all-clusters*" --input-glob "*controller*" ${OUTPUT_DIRECTORY:-./zzz_pregenerated/} ``` +### External applications/zap files + +#### Ensure you have a `.matter` file + +Code generation generally will use both `.zap` or `.matter` files. If you only +have a `.zap` file, you can create the corresponding `.matter` file via: + +```bash +scripts/tools/zap/generate.py ${ZAP_FILE_PATH} +``` + +The above will use the template `src/app/zap-templates/matter-idl.json` to +generate a `.matter` file corresponding to the input `.zap` file. + +`.matter` files are designed to be human readable. It is recommended to take a +look at the generated file and see if it contains what is expected and also lint +it. If anything seems wrong, the `.zap` file should be fixed (`.matter` +represents the content of `.zap`). To lint use: + +```bash +scripts/idl_lint.py ${MATTER_FILE_PATH} +``` + +#### Running pre-generation + +If you have zap files outside the CHIP repository (i.e. not in `src` or +`examples`) you should provide the root of your application source. + +```bash +scripts/codepregen.py --external-root ${PATH_TO_SOURCE_ROOT} ${OUTPUT_DIRECTORY:-./zzz_pregenerated/} +``` + +NOTE: `$PATH_TO_SOURCE_ROOT` should be a top-level directory containing +zap/matter files as the code pre-generation will generate files based on the +path inside the root: + +- if files are `$PATH_TO_SOURCE_ROOT/some/path/foo.zap` this will generate + files into `$OUTPUT_DIRECTORY/some/path/foo/...` + ### Using pre-generated code Instead of generating code at compile time, the chip build system accepts usage diff --git a/docs/conf.py b/docs/conf.py index 2434c39e7a7224..1f2f0d96cf74e8 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -12,7 +12,7 @@ # -- Project information ----------------------------------------------------- project = "Matter" -copyright = "2022, Matter Contributors" +copyright = "2020-2023, Matter Contributors" author = "Matter Contributors" version = "1.0.0" @@ -31,6 +31,10 @@ "examples/providers/README.md", "examples/thermostat/nxp/linux-se05x/README.md", "examples/common/m5stack-tft/repo", + "docs/guides/README.md", + "scripts/tools/memory/memdf/README.md", + "scripts/tools/memory/platform/README.md", + "scripts/tools/memory/README-GitHub-CI.md", ] @@ -68,6 +72,8 @@ (MATTER_BASE, "examples/**/*.png"), (MATTER_BASE, "examples/**/*.jpg"), (MATTER_BASE, "examples/**/*.JPG"), + (MATTER_BASE, "src/tools/**/*.md"), + (MATTER_BASE, "scripts/tools/**/*.md"), ] external_content_link_prefixes = [ "src/", diff --git a/docs/guides/BUILDING.md b/docs/guides/BUILDING.md index 662ccebdf4c763..26ff8d59485e13 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 \ @@ -48,64 +55,85 @@ sudo apt-get install git gcc g++ pkg-config libssl-dev libdbus-1-dev \ python3-pip unzip libgirepository1.0-dev libcairo2-dev libreadline-dev ``` +#### UI builds + +If building via `build_examples.py` and `-with-ui` variant, also install SDL2: + +``` +sudo apt-get install libsdl2-dev +``` + ### Installing prerequisites on macOS On macOS, install Xcode from the Mac App Store. +#### UI builds + +If building `-with-ui` variant, also install SDL2: + +``` +brew install sdl2 +``` + ### 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 +162,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. Use this if you are - developing zap locally and would like to run zap with your changes +- `$ZAP_DEVELOPMENT_PATH` to point to a ZAP checkout. -- `$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` + - Use this if you are developing ZAP locally and would like to run ZAP + with your changes. -- Otherwise scripts assume `zap-cli` or `zap` is available in `$PATH` +- `$ZAP_INSTALL_PATH` to point to where `zap-linux.zip` or `zap-mac.zip` was + unpacked. + + - 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 +184,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 +204,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 +215,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 +224,94 @@ 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. + +## Using `build_examples.py` + +The script `./scripts/build/build_examples.py` provides a uniform build +interface into using `gn`, `cmake`, `ninja` and other tools as needed to compile +various platforms. + +Use `./scripts/build/build_examples.py targets` to see a list of supported +targets. + +Example build commands: ``` -ninja: no work to do +# Compiles and runs all tests on the host: +./scripts/build/build_examples.py --target linux-x64-tests build + +# Compiles fuzzing tagets using libfuzzer (fuzzing requires clang) +./scripts/build/build_examples.py --target linux-x64-tests-clang-asan-libfuzzer build + +# Compiles a esp32 example +./scripts/build/build_examples.py --target esp32-m5stack-all-clusters build + +# Compiles a nrf example +./scripts/build/build_examples.py --target nrf-nrf5340dk-pump build ``` -that means that the tests passed in a previous build. +### `libfuzzer` unit tests + +`libfuzzer` unit tests tests are only compiled but not executed (you have to +manually execute them). For best error detection, some form of sanitizer like +`asan` should be used. + +To compile, use: + +``` +./scripts/build/build_examples.py --target linux-x64-tests-clang-asan-libfuzzer build +``` + +After which tests should be located in +`out/linux-x64-tests-clang-asan-libfuzzer/tests/`. + +#### `ossfuzz` configurations + +`ossfuzz` configurations are not stand-alone fuzzing and instead serve as an +integration point with external fuzzing automated builds. + +They pick up environment variables such as `$CFLAGS`, `$CXXFLAGS` and +`$LIB_FUZZING_ENGINE`. + +You likely want `libfuzzer` + `asan` builds instead for local testing. ## Build custom configuration -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: +The build is configured by setting build arguments. These you can set in one of +the following manners: + +- Passing the `--args` option to `gn gen`. +- Running `gn args` on the output directory. +- Editing `args.gn` in the output directory. + +To configure a new build or edit the arguments to existing build, run the +following command: ``` source scripts/activate.sh @@ -227,10 +321,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 +333,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. -To build the `chip-shell` example as a separate project: +### Build examples as separate projects + +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 +347,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 +365,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 +382,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 +390,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 +398,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 help -``` +GN has integrated help that you can access with the `gn help` command. -Recommended topics: +Make sure to check the following recommended topics: ``` gn help execution @@ -328,70 +426,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 +505,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..655cc226fb6e0c 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,19 +251,21 @@ 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 one of them using the provided setup +code, use the following command pattern: ``` $ ./chip-tool pairing onnetwork ``` -In this command: +The command keeps trying devices until pairing with one of them succeeds or +until it runs out of pairing possibilities. In this command: - __ is the user-defined ID of the node being commissioned. - __ is device specific _setup PIN code_ determined in the @@ -271,14 +274,15 @@ 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 one of them +using the provided setup code, use the following command pattern: ``` $ ./chip-tool pairing onnetwork-long ``` -In this command: +The command keeps trying devices until pairing with one of them succeeds or +until it runs out of pairing possibilities. In this command: - __ is the user-defined ID of the node being commissioned. - __ and __ are device specific keys determined in @@ -289,14 +293,15 @@ 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 one of them, use the following command pattern: ``` $ ./chip-tool pairing code ``` -In this command: +The command keeps trying devices until pairing with one of them succeeds or +until it runs out of pairing possibilities. In this command: - __ is the user-defined ID of the node being commissioned. - __ is the QR code payload ID, for example @@ -305,8 +310,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 +326,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 +398,49 @@ $ ./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 + ``` + + Moreover, when using the single-command mode, the CHIP Tool will establish a + new CASE session with every command sent. + +- 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. Moreover, when using the interactive mode, the CHIP Tool will + establish a new CASE session only when there is no session available yet. On + the following commands, it will use the existing session. + +#### 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 +630,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 +663,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. - -#### Example: running `TestClusters` test +- To get the list of available tests, run the following command: -As an example of running one test suite test: + ``` + $ ./chip-tool tests + ``` -``` -# Clean initialization of state. -rm -fr /tmp/chip_* +- To execute a particular test against the paired device, use the following + command pattern: -# In a shell window, start the DUT device. -./out/debug/standalone/chip-all-clusters-app + ``` + $ ./chip-tool tests + ``` -# In a second shell window, pair the DUT with chip-tool. -./out/debug/standalone/chip-tool pairing onnetwork 333221 20202021 + In this command: -# Now run the test -./out/debug/standalone/chip-tool tests TestCluster --nodeId 333221 -``` + - __ is the name of the particular test. -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 +702,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 +875,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 +927,15 @@ $ ./chip-tool pairing open-commissioning-window