Skip to content

Commit

Permalink
Merge branch 'master' into master_sample_apps
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 authored Jul 14, 2022
2 parents 28a77f1 + ccd41c6 commit 49f9079
Show file tree
Hide file tree
Showing 257 changed files with 22,381 additions and 14,249 deletions.
2 changes: 0 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@ RUN chown -R $USERNAME:$USERNAME /opt/ameba/ambd_sdk_with_chip_non_NDA/
# NXP uses a patch_sdk script to change SDK files
RUN chown -R $USERNAME:$USERNAME /opt/sdk/sdks/

RUN chown -R $USERNAME:$USERNAME /opt/fsl-imx-xwayland/5.10-hardknott/
RUN chown -R $USERNAME:$USERNAME /opt/fsl-imx-xwayland/5.15-kirkstone/
RUN chown -R $USERNAME:$USERNAME /opt/fsl-imx-wayland/5.15-kirkstone/

# Add access to openocd for VSCode debugging
RUN chown -R $USERNAME:$USERNAME /opt/openocd
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,9 @@ jobs:
- name: Run Python library specific unit tests
timeout-minutes: 5
run: |
scripts/run_in_build_env.sh 'pip3 install ./out/controller/python/chip-0.0-cp37-abi3-linux_x86_64.whl'
scripts/run_in_build_env.sh 'pip3 install ./out/controller/python/chip_core-0.0-cp37-abi3-linux_x86_64.whl'
scripts/run_in_build_env.sh 'pip3 install ./out/controller/python/chip_clusters-0.0-py3-none-any.whl'
scripts/run_in_build_env.sh 'pip3 install ./out/controller/python/chip_repl-0.0-py3-none-any.whl'
scripts/run_in_build_env.sh '(cd src/controller/python/test/unit_tests/ && python3 -m unittest -v)'
build_darwin:
Expand Down
79 changes: 79 additions & 0 deletions .github/workflows/examples-bl602.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# 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.

name: Build example - BL602

on:
push:
pull_request:

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:
bl602:
name: BL602
timeout-minutes: 90

runs-on: ubuntu-latest
if: github.actor != 'restyled-io[bot]'

container:
image: connectedhomeip/chip-build:latest
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
steps:
- uses: Wandalen/wretry.action@v1.0.15
name: Checkout
with:
action: actions/checkout@v3
with: |
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform bl602

- name: Set up environment for size reports
if: ${{ !env.ACT }}
env:
GH_CONTEXT: ${{ toJson(github) }}
run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}"

- name: Build example BL602 Lighting App
timeout-minutes: 30
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --target bl602-light build"
- name: Get Lighting size stats
run: |
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py bl602 bl602 lighting-app \
out/bl602-light/chip-bl602-lighting-example.out /tmp/bloat_reports/
- name: Build example BL602 Lighting App with RPCs
timeout-minutes: 30
run: |
scripts/examples/gn_bl602_example.sh lighting-app ./out/bl602-light-rpc 'import("//with_pw_rpc.gni")'
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py bl602 bl602+rpc lighting-app \
out/bl602-light-rpc/chip-bl602-lighting-example.out /tmp/bloat_reports/
- name: Uploading Size Reports
uses: actions/upload-artifact@v2
if: ${{ !env.ACT }}
with:
name: Size,BL602-Examples,${{ env.GH_EVENT_PR }},${{ env.GH_EVENT_HASH }},${{ env.GH_EVENT_PARENT }},${{ github.event_name }}
path: |
/tmp/bloat_reports/
6 changes: 3 additions & 3 deletions .github/workflows/examples-linux-arm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
--target linux-arm64-all-clusters \
--target linux-arm64-chip-tool-no-interactive-ipv6only \
--target linux-arm64-chip-tool-ipv6only \
--target linux-arm64-lock \
--target linux-arm64-minmdns \
--target linux-arm64-thermostat-no-ble \
Expand All @@ -80,8 +80,8 @@ jobs:
timeout-minutes: 5
run: |
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
linux arm64 chip-tool-no-interactive-ipv6only \
out/linux-arm64-chip-tool-no-interactive-ipv6only/chip-tool \
linux arm64 chip-tool-ipv6only \
out/linux-arm64-chip-tool-ipv6only/chip-tool \
/tmp/bloat_reports/
- name: Bloat report - thermostat
timeout-minutes: 5
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/examples-linux-imx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
# TODO: this image SHOULD use a newer version.
#
# NOTE: After https://github.com/project-chip/connectedhomeip/pull/19941
# the image became large enough that github CI runs out of space.
# The image has increased from aroud 2.5GB to 10+GB
image: connectedhomeip/chip-build-imx:0.5.79
image: connectedhomeip/chip-build-imx:0.5.85

steps:
- uses: Wandalen/wretry.action@v1.0.15
Expand Down
84 changes: 84 additions & 0 deletions .github/workflows/examples-mw320.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Copyright (c) 2020-2021 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: Build example - MW320

on:
push:
pull_request:

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:
mw320:
name: MW320
timeout-minutes: 60

env:
BUILD_TYPE: gn_mw320

runs-on: ubuntu-latest
if: github.actor != 'restyled-io[bot]'

container:
image: connectedhomeip/chip-build:0.5.84
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
steps:
- uses: Wandalen/wretry.action@v1.0.15
name: Checkout
with:
action: actions/checkout@v3
with: |
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform mw320

- name: Set up environment for size reports
if: ${{ !env.ACT }}
env:
GH_CONTEXT: ${{ toJson(github) }}
run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}"

- name: Bootstrap
timeout-minutes: 25
run: scripts/build/gn_bootstrap.sh
- name: Uploading bootstrap logs
uses: actions/upload-artifact@v2
if: ${{ always() && !env.ACT }}
with:
name: bootstrap-logs
path: |
.environment/gn_out/.ninja_log
.environment/pigweed-venv/*.log
- name: Build MW320 all clusters example app
timeout-minutes: 20
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
--target 'mw320-all-clusters-app' \
build \
--copy-artifacts-to out/artifacts \
"
- name: Uploading Size Reports
uses: actions/upload-artifact@v2
if: ${{ !env.ACT }}
with:
name: Size,MW320-Examples,${{ env.GH_EVENT_PR }},${{ env.GH_EVENT_HASH }},${{ env.GH_EVENT_PARENT }},${{ github.event_name }}
path: |
/tmp/bloat_reports/
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,5 @@ compile_commands.json
*~

# log files
*.log
*.log
examples/thermostat/ameba/build
4 changes: 2 additions & 2 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
if (enable_pylib) {
deps += [ "${chip_root}/src/pybindings/pycontroller" ]
}
deps += [ "${chip_root}/src/controller/python" ]
deps += [ "${chip_root}/src/controller/python:chip-repl" ]
}
}

Expand All @@ -166,7 +166,7 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
if (enable_pylib) {
data_deps += [ "${chip_root}/src/pybindings/pycontroller" ]
}
data_deps += [ "${chip_root}/src/controller/python" ]
data_deps += [ "${chip_root}/src/controller/python:chip-repl" ]
}

write_runtime_deps = "${root_out_dir}/certification.runtime_deps"
Expand Down
4 changes: 2 additions & 2 deletions build/chip/linux/gdbus_library.gni
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

glib_config = rebase_path(":glib")
gen_dbus_wrapper = rebase_path("gen_gdbus_wrapper.py")
glib_config = get_label_info(":glib", "label_no_toolchain")
gen_dbus_wrapper = get_path_info("gen_gdbus_wrapper.py", "abspath")

# Runs gdbus-codegen and defines the resulting library.
#
Expand Down
5 changes: 5 additions & 0 deletions build_overrides/p6.gni
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ declare_args() {
# Root directory for p6 SDK build files.
p6_sdk_build_root = "//third_party/p6"
}

declare_args() {
# Root directory for p6 SDK sources.
p6_sdk_root = "${p6_sdk_build_root}/p6_sdk"
}
33 changes: 32 additions & 1 deletion config/nrfconnect/chip-module/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ config CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE
factory data.

# Use default certificates without generating or providing them
config CHIP_FACTORY_DATA_USE_DEFAULTS_CERTS
config CHIP_FACTORY_DATA_USE_DEFAULT_CERTS
bool "Use default certificates located in Matter repository"
default y
help
Expand Down Expand Up @@ -254,4 +254,35 @@ config CHIP_DEVICE_ROTATING_DEVICE_UID
A device rotating id unique id which will be generated if
this config is not set in prj.conf file.

config CHIP_DEVICE_ENABLE_KEY
string "Enable Key for triggering test actions on device"
default "00112233445566778899AABBCCDDEEFF"
help
The Enable Key is a 128-bit value that triggers test action
while invoking the TestEventTrigger Command.
Pattern: "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
This value is used during Certification Tests,
and should not be present on production devices.

config CHIP_CERTIFICATION_DECLARATION_STORAGE
bool "Enable storing Certification Declaration"
depends on CHIP_FACTORY_DATA
help
Enables storing Certification Declaration in Zephyr settings
instead of using hardcoded value from firmware. It also adds
support for including new Certification Declaration into a firmware
update image package sent via OTA Software Update.

if CHIP_CERTIFICATION_DECLARATION_STORAGE

config CHIP_CERTIFiCATION_DECLARATION_OTA_IMAGE_ID
int "Certification declaration OTA image id"
default 205 #0xcd
help
The image id of Certification Declaration image
for sending it via OTA Software Update purposes.

endif


endif
25 changes: 12 additions & 13 deletions config/nrfconnect/chip-module/generate_factory_data.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,12 @@ if(NOT CONFIG_CHIP_DEVICE_GENERATE_ROTATING_DEVICE_UID)
else()
string(APPEND script_args "--rd_uid \"${CONFIG_CHIP_DEVICE_ROTATING_DEVICE_UID}\"\n")
endif()
else()
string(APPEND script_args "--generate_rd_uid\n")
endif()

# for development purpose user can use default certs instead of generating or providing them
if(CONFIG_CHIP_FACTORY_DATA_USE_DEFAULTS_CERTS)
if(CONFIG_CHIP_FACTORY_DATA_USE_DEFAULT_CERTS)
# 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)
Expand All @@ -68,14 +70,9 @@ if(CONFIG_CHIP_FACTORY_DATA_USE_DEFAULTS_CERTS)
string(APPEND script_args "--dac_key \"${CHIP_ROOT}/credentials/development/attestation/Matter-Development-DAC-${raw_pid}-Key.der\"\n")
string(APPEND script_args "--pai_cert \"${CHIP_ROOT}/credentials/development/attestation/Matter-Development-PAI-noPID-Cert.der\"\n")
else()
# try to generate a new DAC and PAI certs and DAC key
# request script to generate a new certificates
# by adding an argument to script_args
find_program(chip-cert NAMES chip-cert)
if(NOT chip-cert)
message(FATAL_ERROR "Could not find chip_cert_path executable in PATH")
endif()
string(APPEND script_args "--chip_cert_path ${chip-cert}\n")
find_program(chip_cert_exe NAMES chip-cert REQUIRED)
string(APPEND script_args "--gen_cd\n")
string(APPEND script_args "--chip_cert_path ${chip_cert_exe}\n")
endif()

# add Password-Authenticated Key Exchange parameters
Expand All @@ -88,16 +85,18 @@ string(APPEND script_args "--passcode ${CONFIG_CHIP_DEVICE_SPAKE2_PASSCODE}\n")
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)
if(NOT spake_exe)
message(FATAL_ERROR "Could not find spake2p executable in PATH")
endif()
find_program(spake_exe NAMES spake2p REQUIRED)
string(APPEND script_args "--spake2p_path ${spake_exe}\n")
else()
# Spake2 verifier should be provided using kConfig
string(APPEND script_args "--spake2_verifier \"${CONFIG_CHIP_DEVICE_SPAKE2_TEST_VERIFIER}\"\n")
endif()

if(CONFIG_CHIP_DEVICE_ENABLE_KEY)
# Add optional EnableKey that triggers user-specific action.
string(APPEND script_args "--enable_key \"${CONFIG_CHIP_DEVICE_ENABLE_KEY}\"\n")
endif()

# Set output JSON file and path to SCHEMA file to validate generated factory data
string(APPEND script_args "-o \"${output_path}/${factory_data_target}.json\"\n")
string(APPEND script_args "-s \"${schema_path}\"\n")
Expand Down
Loading

0 comments on commit 49f9079

Please sign in to comment.