Skip to content

Commit

Permalink
Merge branch 'master' into telink_image_update
Browse files Browse the repository at this point in the history
  • Loading branch information
s07641069 authored Nov 15, 2023
2 parents 11e73ee + 75cf38c commit c006e6c
Show file tree
Hide file tree
Showing 138 changed files with 30,621 additions and 6,649 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ jobs:
src/app/zap-templates/zcl/data-model/chip/thread-network-diagnostics-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/time-format-localization-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/time-synchronization-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/timer-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/user-label-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/unit-localization-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/wake-on-lan-cluster.xml \
Expand Down Expand Up @@ -455,6 +456,7 @@ jobs:
scripts/run_in_python_env.sh out/venv './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-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_ACE_1_3.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
scripts/run_in_python_env.sh out/venv './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-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_CGEN_2_4.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
scripts/run_in_python_env.sh out/venv './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-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_DA_1_2.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
scripts/run_in_python_env.sh out/venv './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-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TestGroupTableReports.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --script "src/python_testing/TC_TIMESYNC_2_1.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-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --script "src/python_testing/TC_TIMESYNC_2_2.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-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --script "src/python_testing/TC_TIMESYNC_2_4.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-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
Expand Down
6 changes: 6 additions & 0 deletions build/toolchain/flashable_executable.gni
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@ template("flashable_executable") {
} else {
flashing_options = []
}

# Allows to set a different image name in the flasher script
if (defined(invoker.flashing_image_name)) {
image_name = invoker.flashing_image_name
}

flashing_options += [
"--application",
rebase_path(image_name, root_out_dir, root_out_dir),
Expand Down
109 changes: 39 additions & 70 deletions examples/all-clusters-app/nrfconnect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,102 +176,71 @@ communicate with it using the
Before building the example, check out the Matter repository and sync submodules
using the following command:

$ git submodule update --init
$ python3 scripts/checkout_submodules.py --shallow --platform nrfconnect

The example requires a specific revision of the nRF Connect SDK. You can either
install it along with the related tools directly on your system or use a Docker
image that has the tools pre-installed.

If you are a macOS user, you won't be able to use the Docker container to flash
the application onto a Nordic development kit due to
[certain limitations of Docker for macOS](https://docs.docker.com/docker-for-mac/faqs/#can-i-pass-through-a-usb-device-to-a-container).
Use the [native shell](#using-native-shell-for-setup) for building instead.

### Using Docker container for setup

To use the Docker container for setup, complete the following steps:

1. If you do not have the nRF Connect SDK installed yet, create a directory for
it by running the following command:

$ mkdir ~/nrfconnect

2. Download the latest version of the nRF Connect SDK Docker image by running
the following command:
> **Note**:
>
> For Linux operating system install
> [SEGGER J-Link Software](https://www.segger.com/downloads/jlink/#J-LinkSoftwareAndDocumentationPack).
$ docker pull nordicsemi/nrfconnect-chip
### Install Command Line Tools

3. Start Docker with the downloaded image by running the following command,
customized to your needs as described below:
With admin permissions enabled, download and install the
[nRF Command Line Tools](https://www.nordicsemi.com/Products/Development-tools/nrf-command-line-tools).

$ docker run --rm -it -e RUNAS=$(id -u) -v ~/nrfconnect:/var/ncs -v ~/connectedhomeip:/var/chip \
-v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" nordicsemi/nrfconnect-chip
### Install Toolchain Manager

In this command:
Toolchain Manager is available from
[nRF Connect for Desktop](https://www.nordicsemi.com/Products/Development-tools/nrf-connect-for-desktop),
a cross-platform tool that provides different applications that simplify
installing the nRF Connect SDK. Both the tool and the application are available
for Windows, Linux, and macOS.

- _~/nrfconnect_ can be replaced with an absolute path to the nRF Connect
SDK source directory.
- _~/connectedhomeip_ must be replaced with an absolute path to the CHIP
source directory.
- _-v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:_ rmw"\*
parameters can be omitted if you are not planning to flash the example
onto hardware. These parameters give the container access to USB devices
connected to your computer such as the nRF52840 DK.
- _--rm_ can be omitted if you do not want the container to be
auto-removed when you exit the container shell session.
- _-e RUNAS=\$(id -u)_ is needed to start the container session as the
current user instead of root.
To install the Toolchain Manager app, complete the following steps:

4. Update the nRF Connect SDK to the most recent supported revision, by running
the following command:
1. [Download nRF Connect for Desktop](https://www.nordicsemi.com/Products/Development-tools/nrf-connect-for-desktop/download#infotabs)
for your operating system.

$ cd /var/chip
$ python3 scripts/setup/nrfconnect/update_ncs.py --update

Now you can proceed with the [Building](#building) instruction.
2. Install and run the tool on your machine.

### Using native shell for setup
3. In the **APPS** section, click **Install** button on the Toolchain Manager
tab.

To use the native shell for setup, complete the following steps:
### Install nRF Connect SDK

1. Download and install the following additional software:
Complete the following steps to install the nRF Connect SDK:

- [nRF Command Line Tools](https://www.nordicsemi.com/Software-and-Tools/Development-Tools/nRF-Command-Line-Tools)
- [GN meta-build system](https://gn.googlesource.com/gn/)
1. Open Toolchain Manager in nRF Connect for Desktop.

2. If you do not have the nRF Connect SDK installed, follow the
[guide](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/gs_assistant.html#)
in the nRF Connect SDK documentation to install the latest stable nRF
Connect SDK version. Since command-line tools will be used for building the
example, installing SEGGER Embedded Studio is not required.
2. Click the **Install** button next to the
[recommended](../../../config/nrfconnect/.nrfconnect-recommended-revision)
version of the nRF Connect SDK.

If you have the SDK already installed, continue to the next step and update
the nRF Connect SDK after initializing environment variables.
3. A pop-up window will inform you about the current installation directory. If
you want to change the directory, click the **Change directory** button.
Otherwise, click the **Continue installation** button.

3. Initialize environment variables referred to by the CHIP and the nRF Connect
SDK build scripts. Replace _nrfconnect-dir_ with the path to your nRF
Connect SDK installation directory, and _toolchain-dir_ with the path to GNU
Arm Embedded Toolchain.
4. When the nRF Connect SDK is installed on your machine, the **Install**
button changes to the **Open VS Code** button.

$ source nrfconnect-dir/zephyr/zephyr-env.sh
$ export ZEPHYR_TOOLCHAIN_VARIANT=gnuarmemb
$ export GNUARMEMB_TOOLCHAIN_PATH=toolchain-dir
5. Click the dropdown menu next to the **Open VS Code** button for the
installed nRF Connect SDK version, and select **Open terminal**.

4. Update the nRF Connect SDK to the most recent supported revision by running
the following command (replace _matter-dir_ with the path to Matter
repository directory):
6. Make sure that the nRF Connect SDK version is compatible with the Matter SDK
version:

$ cd matter-dir
```
$ cd {connectedhomeip directory}
$ python3 scripts/setup/nrfconnect/update_ncs.py --update
```
Now you can proceed with the [Building](#building) instruction.
<hr>
## Building
Complete the following steps, regardless of the method used for setting up the
environment:
Complete the following steps to build the sample:
1. Navigate to the example's directory:
Expand Down
69 changes: 60 additions & 9 deletions examples/build_overrides/pigweed_environment.gni
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,71 @@ _bootstrap_root = "//third_party/connectedhomeip"
import("${_bootstrap_root}/build_overrides/pigweed_environment.gni")

# Rebase paths to our root.
#
# If out of tree, the paths will look like:
#
# pw_env_setup_CIPD_PIGWEED = "//../home/vscode/pigweed/env/cipd/packages/pigweed"
#
# and these paths are used by things like protoc since
# https://github.com/google/pigweed/commit/ddbc9fc7f5c601ab417db37e02cbe5294f21ad6d
#
# See https://github.com/project-chip/connectedhomeip/issues/30475
#
# Existing logic:
# - this file is imported from `examples/common/pigweed` or similar
# - we transform paths from "//../" into "//../../../"
#
# TODO: need a better expansion here. This replacement logic seems very brittle and
# it is unclear how we know exactly 3 levels of indirections are correct
#
if (defined(pw_env_setup_CIPD_ARM)) {
pw_env_setup_CIPD_ARM =
get_path_info("${_bootstrap_root}/${pw_env_setup_CIPD_ARM}", "abspath")
_split_arm = string_split(pw_env_setup_CIPD_ARM, "//../")
if (_split_arm[0] == "") {
pw_env_setup_CIPD_ARM = get_path_info(
string_replace(pw_env_setup_CIPD_ARM, "//../", "//../../../"),
"abspath")
} else {
pw_env_setup_CIPD_ARM =
get_path_info("${_bootstrap_root}/${pw_env_setup_CIPD_ARM}", "abspath")
}
}
if (defined(pw_env_setup_CIPD_PIGWEED)) {
pw_env_setup_CIPD_PIGWEED =
get_path_info("${_bootstrap_root}/${pw_env_setup_CIPD_PIGWEED}",
"abspath")
_split_pigweed = string_split(pw_env_setup_CIPD_PIGWEED, "//../")
if (_split_pigweed[0] == "") {
pw_env_setup_CIPD_PIGWEED =
get_path_info(
string_replace(pw_env_setup_CIPD_PIGWEED, "//../", "//../../../"),
"abspath")
} else {
pw_env_setup_CIPD_PIGWEED =
get_path_info("${_bootstrap_root}/${pw_env_setup_CIPD_PIGWEED}",
"abspath")
}
}

if (defined(pw_env_setup_CIPD_PYTHON)) {
pw_env_setup_CIPD_PYTHON =
get_path_info("${_bootstrap_root}/${pw_env_setup_CIPD_PYTHON}", "abspath")
_split_python = string_split(pw_env_setup_CIPD_PYTHON, "//../")
if (_split_python[0] == "") {
pw_env_setup_CIPD_PYTHON =
get_path_info(
string_replace(pw_env_setup_CIPD_PYTHON, "//../", "//../../../"),
"abspath")
} else {
pw_env_setup_CIPD_PYTHON =
get_path_info("${_bootstrap_root}/${pw_env_setup_CIPD_PYTHON}",
"abspath")
}
}
if (defined(pw_env_setup_VIRTUAL_ENV)) {
pw_env_setup_VIRTUAL_ENV =
get_path_info("${_bootstrap_root}/${pw_env_setup_VIRTUAL_ENV}", "abspath")
_split_env = string_split(pw_env_setup_VIRTUAL_ENV, "//../")
if (_split_env[0] == "") {
pw_env_setup_VIRTUAL_ENV =
get_path_info(
string_replace(pw_env_setup_VIRTUAL_ENV, "//../", "//../../../"),
"abspath")
} else {
pw_env_setup_VIRTUAL_ENV =
get_path_info("${_bootstrap_root}/${pw_env_setup_VIRTUAL_ENV}",
"abspath")
}
}
Loading

0 comments on commit c006e6c

Please sign in to comment.