Skip to content

Commit

Permalink
Merge branch 'project-chip:master' into bozowski/chef-ci-merge
Browse files Browse the repository at this point in the history
  • Loading branch information
aBozowski authored Jun 6, 2022
2 parents fbcc330 + d2a5192 commit 37e5c88
Show file tree
Hide file tree
Showing 38 changed files with 944 additions and 497 deletions.
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
"christian-kohler.path-intellisense",
"knisterpeter.vscode-github",
"npclaudiu.vscode-gn",
"marus25.cortex-debug"
"marus25.cortex-debug",
"msedge-dev.gnls"
],
// Use 'settings' to set *default* container specific settings.json values on container create.
// You can edit these settings after create using File > Preferences > Settings > Remote.
Expand Down
1 change: 1 addition & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
"cppStandard": "gnu++14",
"intelliSenseMode": "gcc-arm",
"compilerPath": "/opt/tizen-sdk/tools/arm-linux-gnueabi-gcc-9.2/bin/arm-linux-gnueabi-gcc",
"compileCommands": "${workspaceFolder}/out/debug/compile_commands.tizen_arm.json",
"browse": {
"path": ["${workspaceFolder}/out/debug/"],
"limitSymbolsToIncludedHeaders": true
Expand Down
14 changes: 14 additions & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
# Enable building for Android.
enable_android_builds = false

# Enable building for Tizen.
enable_tizen_builds = false

# Set this to true to enable TI builds by default.
enable_ti_simplelink_builds = false

Expand Down Expand Up @@ -284,6 +287,8 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
enable_bl602_lighting_app_build = enable_bl602_builds

enable_fake_tests = enable_default_builds && host_os == "linux"

enable_tizen_lighting_app = enable_tizen_builds
}

if (enable_host_clang_build) {
Expand Down Expand Up @@ -468,6 +473,12 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
}
}

if (enable_tizen_lighting_app) {
group("tizen_lighting_app") {
deps = [ "${chip_root}/examples/lighting-app/tizen/(${chip_root}/build/toolchain/tizen:tizen_arm)" ]
}
}

group("default") {
deps = []
if (enable_host_clang_build) {
Expand All @@ -487,6 +498,9 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
":android_x86",
]
}
if (enable_tizen_builds) {
deps += [ ":tizen_lighting_app" ]
}
if (enable_standalone_chip_cert_build) {
deps += [ ":standalone_chip_cert" ]
}
Expand Down
2 changes: 2 additions & 0 deletions build/config/sysroot.gni
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ if (sysroot_platform_config == "") {
sysroot_platform_config = "${build_root}/config/webos/webos_sysroot.gni"
} else if (is_clang && current_cpu == "arm" && current_os == "freertos") {
sysroot_platform_config = "${build_root}/toolchain/arm/arm_sysroot.gni"
} else if (current_os == "tizen") {
sysroot_platform_config = "${build_root}/config/tizen/tizen_sysroot.gni"
}
}

Expand Down
3 changes: 3 additions & 0 deletions build/config/tizen/config.gni
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
# limitations under the License.

declare_args() {
# Location of The Tizen sysroot
tizen_sdk_sysroot = ""

# Location of the Tizen SDK.
tizen_sdk_root = ""
}
18 changes: 18 additions & 0 deletions build/config/tizen/tizen_sysroot.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) 2022 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.

import("//build_overrides/build.gni")
import("${build_root}/config/tizen/config.gni")

sysroot = tizen_sdk_sysroot
6 changes: 6 additions & 0 deletions config/nrfconnect/chip-module/Kconfig.features
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ config SYSTEM_WORKQUEUE_STACK_SIZE

if SOC_SERIES_NRF53X

# FLASH nop device is enabled to prevent bus faults when mcumgr tries to access
# simulated partition with network core image data.
config FLASH_NOP_DEVICE
bool
default y

# Enable custom SMP request to erase settings partition.
config MCUMGR_GRP_ZEPHYR_BASIC
bool
Expand Down
1 change: 1 addition & 0 deletions examples/chef/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ set(PIGWEED_ROOT "${CHIP_ROOT}/third_party/pigweed/repo")
include(${PIGWEED_ROOT}/pw_build/pigweed.cmake)
include(${PIGWEED_ROOT}/pw_protobuf_compiler/proto.cmake)

pw_set_module_config(pw_rpc_CONFIG pw_rpc.disable_global_mutex_config)
pw_set_backend(pw_log pw_log_basic)
pw_set_backend(pw_assert pw_assert_log)
pw_set_backend(pw_sys_io pw_sys_io.nrfconnect)
Expand Down
2 changes: 0 additions & 2 deletions examples/lighting-app/nxp/k32w/k32w0/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ static OTAImageProcessorImpl gImageProcessor;
constexpr uint16_t requestedOtaBlockSize = 1024;
#endif

extern bool shouldReset;

CHIP_ERROR AppTask::StartAppTask()
{
CHIP_ERROR err = CHIP_NO_ERROR;
Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/tizen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ gn gen --check \
--fail-on-unused-args \
--export-compile-commands \
--root=$PW_PROJECT_ROOT/examples/lighting-app/tizen \
"--args=target_os=\"tizen\" target_cpu=\"arm\" tizen_sdk_root=\"$TIZEN_SDK_ROOT\" sysroot=\"$TIZEN_SDK_SYSROOT\"" \
"--args=target_os=\"tizen\" target_cpu=\"arm\" tizen_sdk_root=\"$TIZEN_SDK_ROOT\" tizen_sdk_sysroot=\"$TIZEN_SDK_SYSROOT\"" \
$PW_PROJECT_ROOT/out/tizen-arm-light
```

Expand Down
4 changes: 1 addition & 3 deletions examples/lock-app/lock-common/lock-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,6 @@ server cluster DoorLock = 257 {
attribute access(write: manage) boolean enablePrivacyModeButton = 43;
attribute access(write: administer) int8u wrongCodeEntryLimit = 48;
attribute access(write: administer) int8u userCodeTemporaryDisableTime = 49;
attribute access(write: administer) boolean requirePINforRemoteOperation = 51;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;

Expand Down Expand Up @@ -2183,8 +2182,7 @@ endpoint 1 {
ram attribute enablePrivacyModeButton;
ram attribute wrongCodeEntryLimit default = 3;
ram attribute userCodeTemporaryDisableTime default = 10;
ram attribute requirePINforRemoteOperation;
ram attribute featureMap default = 0x113;
ram attribute featureMap default = 0x133;
ram attribute clusterRevision default = 6;
}
}
Expand Down
7 changes: 4 additions & 3 deletions examples/lock-app/lock-common/lock-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -7850,7 +7850,7 @@
"mfgCode": null,
"side": "server",
"type": "boolean",
"included": 1,
"included": 0,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
Expand Down Expand Up @@ -7934,7 +7934,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0x113",
"defaultValue": "0x133",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand Down Expand Up @@ -8082,5 +8082,6 @@
"endpointVersion": 1,
"deviceIdentifier": 10
}
]
],
"log": []
}
104 changes: 82 additions & 22 deletions examples/ota-requestor-app/linux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ scripts/examples/gn_build_example.sh examples/ota-provider-app/linux/ out chip_c
**Run the OTA Provider application**

```
out/chip-ota-provider-app --discriminator 22 --secured-device-port 5565 --KVS /tmp/chip_kvs_provider --filepath /tmp/test.bin
out/chip-ota-provider-app --discriminator 22 --secured-device-port 5565 --KVS /tmp/chip_kvs_provider --filepath /tmp/ota-image.bin
```

#### In terminal 2:
Expand Down Expand Up @@ -270,7 +270,7 @@ scripts/examples/gn_build_example.sh examples/ota-provider-app/linux/ out chip_c
**Run the OTA Provider application**

```
out/chip-ota-provider-app --discriminator 22 --secured-device-port 5565 --KVS /tmp/chip_kvs_provider --filepath /tmp/test.bin
out/chip-ota-provider-app --discriminator 22 --secured-device-port 5565 --KVS /tmp/chip_kvs_provider --filepath /tmp/ota-image.bin
```

#### In terminal 2:
Expand Down Expand Up @@ -304,7 +304,7 @@ out/chip-tool pairing onnetwork-long 0x1234567890 20202021 18
**Write to the DefaultOTAProviders attribute**

```
out/chip-tool otasoftwareupdaterequestor write default-ota-providers '[{"fabricIndex": 1, "providerNodeID": 3735928559, "endpoint": 0}]' 0x0000001234567890 0
out/chip-tool otasoftwareupdaterequestor write default-ota-providers '[{"providerNodeID": 3735928559, "endpoint": 0}]' 0x1234567890 0
```

Every 60 seconds from when the OTA Requestor application has launched, the OTA
Expand All @@ -319,48 +319,108 @@ structs. Each entry in this list is a default OTA Provider per fabric. There can
not be more than one entry containing the same fabric.

To add more than one entry to the `DefaultOTAProviders` attribute, the OTA
Requestor app must be commissioned on multiple fabrics. This can be done as
specified below:
Requestor app must be commissioned into multiple fabrics. At least one OTA
Provider app should be commissioned into each corresponding fabric that the OTA
Requestor app had been commissioned into.

**Build and run the OTA Requestor application**
The following example has two OTA Provider apps, each commissioned into a
different fabric (alpha and beta) and one OTA Requestor app commissioned into
both alpha and beta fabrics.

### In terminal 1:

**Build the OTA Provider application**

```
scripts/examples/gn_build_example.sh examples/ota-provider-app/linux/ out chip_config_network_layer_ble=false
```

**Run the first OTA Provider application**

```
out/chip-ota-provider-app --discriminator 22 --secured-device-port 5565 --KVS /tmp/chip_kvs_provider --filepath /tmp/ota-image.bin
```

### In terminal 2:

**Run the second OTA Provider application**

```
out/chip-ota-provider-app --discriminator 23 --secured-device-port 5566 --KVS /tmp/chip_kvs_provider2 --filepath /tmp/ota-image2.bin
```

### In terminal 3:

**Build the OTA Requestor application**

```
scripts/examples/gn_build_example.sh examples/ota-requestor-app/linux/ out chip_config_network_layer_ble=false
out/chip-ota-requestor-app --discriminator 18 --secured-device-port 5560 --KVS /tmp/chip_kvs_requestor --otaDownloadPath /tmp/test.bin
```

**Commission to the first fabric**
**Run the OTA Requestor application**

```
out/chip-tool pairing onnetwork-long 0x1234567890 20202021 18
out/chip-ota-requestor-app --discriminator 18 --secured-device-port 5560 --KVS /tmp/chip_kvs_requestor --periodicQueryTimeout 10
```

**Open Basic Commissioning Window**
### In terminal 4:

**Commission the first OTA Provider into the first fabric (alpha)**

```
out/chip-tool administratorcommissioning open-basic-commissioning-window 600 0x1234567890 0 --timedInteractionTimeoutMs 600
out/chip-tool pairing onnetwork-long 0xC0FFEE 20202021 22
```

**Commission to the second fabric**
**Commission the second OTA Provider into the second fabric (beta)**

```
out/chip-tool pairing onnetwork-long 0x858 20202021 18 --commissioner-name beta
out/chip-tool pairing onnetwork-long 0xB0BA 20202021 23 --commissioner-name beta
```

For all operations, specify which fabric to use by passing in
`--commissioner-name`. The supported values are alpha, beta, and gamma. By
default, if none is supplied, alpha is used.
**Commission the OTA Requestor application into the first fabric (alpha)**

```
out/chip-tool pairing onnetwork-long 0xDEB 20202021 18
```

**Open Basic Commissioning Window for the OTA Requestor application**

```
out/chip-tool administratorcommissioning open-basic-commissioning-window 600 0xDEB 0 --timedInteractionTimeoutMs 600
```

**Commission the OTA Requestor application into the second fabric (beta)**

```
out/chip-tool pairing onnetwork-long 0xB0B 20202021 18 --commissioner-name beta
```

**Write/Read DefaultOTAProviders on first fabric**
**Write/Read DefaultOTAProviders on the first fabric (alpha)**

```
out/chip-tool otasoftwareupdaterequestor write default-ota-providers '[{"fabricIndex": 1, "providerNodeID": 3735928559, "endpoint": 0}]' 0x0000001234567890 0
out/chip-tool otasoftwareupdaterequestor read default-ota-providers 0x1234567890 0
out/chip-tool otasoftwareupdaterequestor write default-ota-providers '[{"providerNodeID": 12648430, "endpoint": 0}]' 0xDEB 0
out/chip-tool otasoftwareupdaterequestor read default-ota-providers 0xDEB 0
```

**Write/Read DefaultOTAProviders on second fabric**
**Write/Read DefaultOTAProviders on second fabric (beta)**

```
out/chip-tool otasoftwareupdaterequestor write default-ota-providers '[{"fabricIndex": 2, "providerNodeID": 1, "endpoint": 0}]' 0x858 0 --commissioner-name beta
out/chip-tool otasoftwareupdaterequestor read default-ota-providers 0x858 0 --commissioner-name beta
out/chip-tool otasoftwareupdaterequestor write default-ota-providers '[{"providerNodeID": 45242, "endpoint": 0}]' 0xB0B 0 --commissioner-name beta
out/chip-tool otasoftwareupdaterequestor read default-ota-providers 0xB0B 0 --commissioner-name beta
```

**Write ACL for the first OTA Provider application**

```
out/chip-tool accesscontrol write acl '[{"privilege": 5, "authMode": 2, "subjects": [112233], "targets": null}, {"privilege": 3, "authMode": 2, "subjects": null, "targets": [{"cluster": 41, "endpoint": null, "deviceType": null}]}]' 0xC0FFEE 0
```

**Write ACL for the second OTA Provider application**

```
out/chip-tool accesscontrol write acl '[{"privilege": 5, "authMode": 2, "subjects": [112233], "targets": null}, {"privilege": 3, "authMode": 2, "subjects": null, "targets": [{"cluster": 41, "endpoint": null, "deviceType": null}]}]' 0xB0BA 0 --commissioner-name beta
```

NOTE: For all operations, specify which fabric to use by passing in
`--commissioner-name`. The supported values are alpha, beta, and gamma. By
default, if none is supplied, alpha is used.
6 changes: 5 additions & 1 deletion examples/platform/nxp/k32w/k32w0/app/support/FreeRtosHooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <stdio.h>
#include <string.h>

#include "PDM.h"
#include "PWR_Interface.h"
#include "TimersManager.h"
#include "board.h"
Expand All @@ -52,6 +53,8 @@
#define APP_DBG_LOG(...)
#endif

#define PDM_MAX_WRITES_INFINITE 0xFF

static inline void mutex_init(mbedtls_threading_mutex_t * p_mutex)
{
assert(p_mutex != NULL);
Expand Down Expand Up @@ -229,10 +232,11 @@ static void BOARD_ActionOnIdle(void)
#endif
}

extern void OTAIdleActivities();
extern void OTAIdleActivities(void);

void vApplicationIdleHook(void)
{
PDM_vIdleTask(PDM_MAX_WRITES_INFINITE);
OTAIdleActivities();
BOARD_ActionOnIdle();
}
14 changes: 14 additions & 0 deletions gn_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,20 @@ fi

echo

tizen_sdk_args=""

if [[ -d "${TIZEN_SDK_ROOT}" && -d "${TIZEN_SDK_SYSROOT}" ]]; then
tizen_sdk_args+="tizen_sdk_root=\"$TIZEN_SDK_ROOT\" tizen_sdk_sysroot=\"$TIZEN_SDK_SYSROOT\""
extra_args+=" $tizen_sdk_args enable_tizen_builds=true"
else
echo
echo "Hint: Set \$TIZEN_SDK_ROOT and \$TIZEN_SDK_SYSROOT to enable building for Tizen"
echo " Required Tizen SDK can be obtained from"
echo " https://developer.tizen.org/development/tizen-studio/download"
fi

echo

_chip_banner "Build: GN configure"

gn --root="$CHIP_ROOT" gen --check --fail-on-unused-args "$CHIP_ROOT/out/debug" --args='target_os="all"'"$extra_args$user_args"
Expand Down
Loading

0 comments on commit 37e5c88

Please sign in to comment.