Skip to content

Commit

Permalink
Merge branch 'master' into update_esp32h2_beta2
Browse files Browse the repository at this point in the history
  • Loading branch information
wqx6 authored Aug 23, 2022
2 parents e1cc7b8 + f6929bb commit 483d2a2
Show file tree
Hide file tree
Showing 35 changed files with 218 additions and 159 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/docker_img.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ jobs:
- "-esp32"
- "-esp32-qemu"
- "-infineon"
- "-imx"
# NOTE: imx image requires too much space for GitHub-hosted runners. It fails with:
# ```
# ....
# ApplyLayer exit status 1 stdout: stderr: write /opt/fsl-imx-xwayland/5.15-kirkstone/sysroots/armv8a-poky-linux/opt/ltp/testcases/bin/fanotify15: no space left on device
# ```
# - "-imx"
- "-k32w"
- "-mbed-os"
- "-nrf-platform"
Expand Down
54 changes: 27 additions & 27 deletions .github/workflows/examples-nrfconnect.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,6 @@ jobs:
nrfconnect nrf52840dk_nrf52840 lock-app \
examples/lock-app/nrfconnect/build/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: Build example nRF Connect SDK Lighting App on nRF52840 DK
if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
timeout-minutes: 15
run: |
scripts/examples/nrfconnect_example.sh lighting-app nrf52840dk_nrf52840
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
nrfconnect nrf52840dk_nrf52840 lighting-app \
examples/lighting-app/nrfconnect/build/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: Build example nRF Connect SDK Lighting App on nRF52840 Dongle
if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
timeout-minutes: 15
Expand All @@ -122,6 +113,15 @@ jobs:
nrfconnect nrf52840dk_nrf52840+rpc lighting-app \
examples/lighting-app/nrfconnect/build/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: Build example nRF Connect SDK Light Switch App on nRF52840 DK
if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
timeout-minutes: 15
run: |
scripts/examples/nrfconnect_example.sh light-switch-app nrf52840dk_nrf52840
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
nrfconnect nrf52840dk_nrf52840 light-switch-app \
examples/light-switch-app/nrfconnect/build/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: Build example nRF Connect SDK Shell on nRF52840 DK
if: github.event_name == 'push' || steps.changed_paths.outputs.shell == 'true'
timeout-minutes: 15
Expand All @@ -140,24 +140,6 @@ jobs:
nrfconnect nrf52840dk_nrf52840 pigweed-app \
examples/pigweed-app/nrfconnect/build/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: Build example nRF Connect SDK Lock App on nRF5340 DK
if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
timeout-minutes: 15
run: |
scripts/examples/nrfconnect_example.sh lock-app nrf5340dk_nrf5340_cpuapp
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
nrfconnect nrf5340dk_nrf5340_cpuapp lock-app \
examples/lock-app/nrfconnect/build/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: Build example nRF Connect SDK Lighting App on nRF5340 DK
if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
timeout-minutes: 15
run: |
scripts/examples/nrfconnect_example.sh lighting-app nrf5340dk_nrf5340_cpuapp
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
nrfconnect nrf5340dk_nrf5340_cpuapp lighting-app \
examples/lighting-app/nrfconnect/build/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: Build example nRF Connect SDK Pump App on nRF52840 DK
if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
timeout-minutes: 15
Expand Down Expand Up @@ -192,6 +174,24 @@ jobs:
nrfconnect nrf52840dk_nrf52840 all-clusters-minimal-app \
examples/all-clusters-minimal-app/nrfconnect/build/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: Build example nRF Connect SDK Lock App on nRF5340 DK
if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
timeout-minutes: 15
run: |
scripts/examples/nrfconnect_example.sh lock-app nrf5340dk_nrf5340_cpuapp
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
nrfconnect nrf5340dk_nrf5340_cpuapp lock-app \
examples/lock-app/nrfconnect/build/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: Build example nRF Connect SDK Lighting App on nRF5340 DK
if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
timeout-minutes: 15
run: |
scripts/examples/nrfconnect_example.sh lighting-app nrf5340dk_nrf5340_cpuapp
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
nrfconnect nrf5340dk_nrf5340_cpuapp lighting-app \
examples/lighting-app/nrfconnect/build/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: Run unit tests for Zephyr native_posix_64 platform
if: github.event_name == 'push' || steps.changed_paths.outputs.tests == 'true'
timeout-minutes: 15
Expand Down
7 changes: 3 additions & 4 deletions docs/guides/BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Tested on:

- macOS 10.15
- Debian 11
- Ubuntu 20.04 LTS
- Ubuntu 22.04 LTS

Build system features:

Expand Down Expand Up @@ -81,9 +81,8 @@ dependency.

### Installing prerequisites on Raspberry Pi 4

Using `rpi-imager`, install the Ubuntu _21.04_ 64-bit _server_ OS for arm64
architectures on a micro SD card. This release will have bluez 5.55 or newer
which is required for BLE functionality.
Using `rpi-imager`, install the Ubuntu _22.04_ 64-bit _server_ OS for arm64
architectures on a micro SD card.

Boot the SD card, login with the default user account "ubuntu" and password
"ubuntu", then proceed with
Expand Down
1 change: 1 addition & 0 deletions examples/chef/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ efr32_executable("chef_app") {
if (chip_enable_openthread) {
deps += [
"${chip_root}/third_party/openthread:openthread",
"${chip_root}/third_party/openthread:openthread_device",
"${examples_plat_dir}:efr-matter-shell",
]
}
Expand Down
1 change: 1 addition & 0 deletions examples/light-switch-app/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ efr32_executable("light_switch_app") {
if (chip_enable_openthread) {
deps += [
"${chip_root}/third_party/openthread:openthread",
"${chip_root}/third_party/openthread:openthread_device",
"${examples_plat_dir}:efr-matter-shell",
]
}
Expand Down
2 changes: 1 addition & 1 deletion examples/light-switch-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ target_sources(app PRIVATE
main/BindingHandler.cpp
${GEN_DIR}/light-switch-app/zap-generated/callback-stub.cpp
${GEN_DIR}/light-switch-app/zap-generated/IMClusterCommandHandler.cpp
${NRFCONNECT_COMMON}/util/LEDWidget.cpp
${NRFCONNECT_COMMON}/util/LEDWidget.cpp)


if(CONFIG_CHIP_OTA_REQUESTOR)
Expand Down
1 change: 1 addition & 0 deletions examples/lighting-app/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ efr32_executable("lighting_app") {
if (chip_enable_openthread) {
deps += [
"${chip_root}/third_party/openthread:openthread",
"${chip_root}/third_party/openthread:openthread_device",
"${examples_plat_dir}:efr-matter-shell",
]
}
Expand Down
1 change: 1 addition & 0 deletions examples/lock-app/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ efr32_executable("lock_app") {
if (chip_enable_openthread) {
deps += [
"${chip_root}/third_party/openthread:openthread",
"${chip_root}/third_party/openthread:openthread_device",
"${examples_plat_dir}:efr-matter-shell",
]
}
Expand Down
3 changes: 2 additions & 1 deletion examples/platform/efr32/init_efrPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ void init_efrPlatform(void)
#endif

#if CHIP_ENABLE_OPENTHREAD
sl_ot_sys_init();
efr32RadioInit();
efr32AlarmInit();
#endif // CHIP_ENABLE_OPENTHREAD
}

Expand Down
15 changes: 4 additions & 11 deletions examples/shell/shell_common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,10 @@ static_library("shell_common") {

if (chip_enable_openthread &&
(current_os == "freertos" || current_os == "zephyr")) {
if (chip_openthread_ftd) {
public_deps += [
"${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd",
"${chip_root}/third_party/openthread/repo:libopenthread-ftd",
]
} else {
public_deps += [
"${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd",
"${chip_root}/third_party/openthread/repo:libopenthread-mtd",
]
}
public_deps += [
"${chip_root}/third_party/openthread:openthread_cli",
"${chip_root}/third_party/openthread:openthread_device",
]
}

if (chip_shell_cmd_server) {
Expand Down
1 change: 1 addition & 0 deletions examples/thermostat/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ efr32_executable("thermostat_app") {
if (chip_enable_openthread) {
deps += [
"${chip_root}/third_party/openthread:openthread",
"${chip_root}/third_party/openthread:openthread_device",
"${examples_plat_dir}:efr-matter-shell",
]
}
Expand Down
1 change: 1 addition & 0 deletions examples/window-app/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ efr32_executable("window_app") {
if (chip_enable_openthread) {
deps += [
"${chip_root}/third_party/openthread:openthread",
"${chip_root}/third_party/openthread:openthread_device",
"${examples_plat_dir}:efr-matter-shell",
]
}
Expand Down
24 changes: 12 additions & 12 deletions scripts/requirements.esp32.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
click>=7.0
future>=0.15.2
pyparsing>=2.0.3,<2.4.0
idf-component-manager>=0.2.99-beta
gdbgui==0.13.2.0
pygdbmi<=0.9.0.2
reedsolo>=1.5.3,<=1.5.4
bitstring>=3.1.6
ecdsa>=0.16.0
kconfiglib==13.7.1
construct==2.10.54
python-socketio<5
click>=7.0 ; platform_machine != 'aarch64' and sys_platform == 'linux'
future>=0.15.2 ; platform_machine != 'aarch64' and sys_platform == 'linux'
pyparsing>=2.0.3,<2.4.0 ; platform_machine != 'aarch64' and sys_platform == 'linux'
idf-component-manager>=0.2.99-beta ; platform_machine != 'aarch64' and sys_platform == 'linux'
gdbgui==0.13.2.0 ; platform_machine != 'aarch64' and sys_platform == 'linux'
pygdbmi<=0.9.0.2 ; platform_machine != 'aarch64' and sys_platform == 'linux'
reedsolo>=1.5.3,<=1.5.4 ; platform_machine != 'aarch64' and sys_platform == 'linux'
bitstring>=3.1.6 ; platform_machine != 'aarch64' and sys_platform == 'linux'
ecdsa>=0.16.0 ; platform_machine != 'aarch64' and sys_platform == 'linux'
kconfiglib==13.7.1 ; platform_machine != 'aarch64' and sys_platform == 'linux'
construct==2.10.54 ; platform_machine != 'aarch64' and sys_platform == 'linux'
python-socketio<5 ; platform_machine != 'aarch64' and sys_platform == 'linux'
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ package com.google.chip.chiptool
import android.content.Context
import android.util.Log
import chip.devicecontroller.ChipDeviceController
import chip.devicecontroller.ControllerParams
import chip.devicecontroller.GetConnectedDeviceCallbackJni.GetConnectedDeviceCallback
import chip.platform.AndroidBleManager
import chip.platform.AndroidChipPlatform
Expand All @@ -38,12 +39,14 @@ object ChipClient {
private const val TAG = "ChipClient"
private lateinit var chipDeviceController: ChipDeviceController
private lateinit var androidPlatform: AndroidChipPlatform
/* 0xFFF4 is a test vendor ID, replace with your assigned company ID */
private const val VENDOR_ID = 0xFFF4

fun getDeviceController(context: Context): ChipDeviceController {
getAndroidChipPlatform(context)

if (!this::chipDeviceController.isInitialized) {
chipDeviceController = ChipDeviceController()
chipDeviceController = ChipDeviceController(ControllerParams.newBuilder().setControllerVendorId(VENDOR_ID).build())
}
return chipDeviceController
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/EventLogging.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ CHIP_ERROR LogEvent(const T & aEventData, EndpointId aEndpoint, EventNumber & aE
eventOptions.mPriority = aEventData.GetPriorityLevel();
eventOptions.mFabricIndex = aEventData.GetFabricIndex();
// this skips logging the event if it's fabric-scoped but no fabric association exists yet.
VerifyOrReturnError(eventOptions.mFabricIndex != kUndefinedFabricIndex, CHIP_NO_ERROR);
VerifyOrReturnError(eventOptions.mFabricIndex != kUndefinedFabricIndex, CHIP_ERROR_INVALID_FABRIC_INDEX);

//
// Unlike attributes which have a different 'EncodeForRead' for fabric-scoped structs,
Expand Down
2 changes: 1 addition & 1 deletion src/controller/java/AndroidDeviceControllerWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ void AndroidDeviceControllerWrapper::OnCommissioningStatusUpdate(PeerId peerId,
JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread();
jmethodID onCommissioningStatusUpdateMethod;
CHIP_ERROR err = JniReferences::GetInstance().FindMethod(env, mJavaObjectRef, "onCommissioningStatusUpdate",
"(JLjava/lang/string;I)V", &onCommissioningStatusUpdateMethod);
"(JLjava/lang/String;I)V", &onCommissioningStatusUpdateMethod);
VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Controller, "Error finding Java method: %" CHIP_ERROR_FORMAT, err.Format()));

UtfString jStageCompleted(env, StageToString(stageCompleted));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,11 @@ public static void loadJni() {
return;
}

/** Returns a new {@link ChipDeviceController} with default parameters. */
public ChipDeviceController() {
this(ControllerParams.newBuilder().build());
}

/** Returns a new {@link ChipDeviceController} with the specified parameters. */
/**
* Returns a new {@link ChipDeviceController} with the specified parameters. you must set a vendor
* ID, ControllerParams.newBuilder().setControllerVendorId(0xFFF4).build() 0xFFF4 is a test vendor
* ID
*/
public ChipDeviceController(ControllerParams params) {
deviceControllerPtr = newDeviceController(params);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ public static Builder newBuilder() {

/**
* Returns parameters which uses the provided {@code operationalKeyConfig} as its operating
* credentials.
* credentials. You must set a vendor ID, 0xFFF4 is a test vendor ID
* ControllerParams.newBuilder().setControllerVendorId(0xFFF4).build()
*/
public static Builder newBuilder(OperationalKeyConfig operationalKeyConfig) {
return newBuilder()
Expand Down
14 changes: 10 additions & 4 deletions src/controller/python/test/test_scripts/cluster_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,6 @@ async def _TriggerEvent(cls, devCtrl):
await devCtrl.SendCommand(nodeid=NODE_ID, endpoint=1, payload=Clusters.TestCluster.Commands.TestEmitTestEventRequest())
await devCtrl.SendCommand(nodeid=NODE_ID, endpoint=1, payload=Clusters.TestCluster.Commands.TestEmitTestEventRequest())
await devCtrl.SendCommand(nodeid=NODE_ID, endpoint=1, payload=Clusters.TestCluster.Commands.TestEmitTestEventRequest())
await devCtrl.SendCommand(nodeid=NODE_ID, endpoint=1, payload=Clusters.TestCluster.Commands.TestEmitTestFabricScopedEventRequest(arg1=0))
await devCtrl.SendCommand(nodeid=NODE_ID, endpoint=1, payload=Clusters.TestCluster.Commands.TestEmitTestFabricScopedEventRequest(arg1=1))

@classmethod
async def _RetryForContent(cls, request, until, retryCount=10, intervalSeconds=1):
Expand All @@ -335,11 +333,19 @@ async def TriggerAndWaitForEvents(cls, devCtrl, req):
@base.test_case
async def TestGenerateUndefinedFabricScopedEventRequests(cls, devCtrl):
logger.info("Running TestGenerateUndefinedFabricScopedEventRequests")
await devCtrl.SendCommand(nodeid=NODE_ID, endpoint=1, payload=Clusters.TestCluster.Commands.TestEmitTestFabricScopedEventRequest(arg1=0))
try:
res = await devCtrl.SendCommand(nodeid=NODE_ID, endpoint=1, payload=Clusters.TestCluster.Commands.TestEmitTestFabricScopedEventRequest(arg1=0))
raise ValueError(f"Unexpected Failure")
except chip.interaction_model.InteractionModelError as ex:
logger.info(f"Recevied {ex} from server.")
res = await devCtrl.ReadEvent(nodeid=NODE_ID, events=[
(1, Clusters.TestCluster.Events.TestEvent, 0),
(1, Clusters.TestCluster.Events.TestFabricScopedEvent, 0),
])
logger.info(f"return result is {res}")
if len(res) != 0:
raise AssertionError("failure: not expect to receive fabric-scoped event when fabric is undefined")
else:
logger.info("TestGenerateUndefinedFabricScopedEventRequests: Success")

@classmethod
@base.test_case
Expand Down
8 changes: 5 additions & 3 deletions src/inet/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ static_library("inet") {
"InetArgParser.h",
"InetError.cpp",
"InetError.h",
"InetFaultInjection.h",
"InetInterface.cpp",
"InetInterface.h",
"InetLayer.h",
Expand All @@ -108,7 +107,7 @@ static_library("inet") {
}

if (chip_system_config_use_open_thread_inet_endpoints) {
public_deps += [ "${chip_root}/third_party/openthread:openthread" ]
public_deps += [ "${chip_root}/third_party/openthread:openthread_device" ]
}

if (chip_inet_config_enable_tcp_endpoint) {
Expand All @@ -132,7 +131,10 @@ static_library("inet") {
}

if (chip_with_nlfaultinjection) {
sources += [ "InetFaultInjection.cpp" ]
sources += [
"InetFaultInjection.cpp",
"InetFaultInjection.h",
]
public_deps += [ "${nlfaultinjection_root}:nlfaultinjection" ]
}

Expand Down
9 changes: 7 additions & 2 deletions src/inet/tests/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ static_library("helpers") {
"TestInetCommonOptions.h",
"TestInetCommonPosix.cpp",
"TestInetLayerCommon.cpp",
"TestSetupFaultInjection.h",
"TestSetupFaultInjectionPosix.cpp",
"TestSetupSignalling.h",
"TestSetupSignallingPosix.cpp",
]
Expand All @@ -45,6 +43,13 @@ static_library("helpers") {
sources += [ "TestInetLayer.cpp" ]
}

if (chip_with_nlfaultinjection) {
sources += [
"TestSetupFaultInjection.h",
"TestSetupFaultInjectionPosix.cpp",
]
}

cflags = [ "-Wconversion" ]

public_deps = [
Expand Down
4 changes: 2 additions & 2 deletions src/platform/EFR32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ static_library("EFR32") {
"$dir_pw_kvs",
]
if (chip_enable_openthread) {
public_deps += [ "${chip_root}/third_party/openthread:openthread" ]
public_deps += [ "${chip_root}/third_party/openthread:openthread_device" ]

deps += [ "${chip_root}/third_party/silabs:openthread_cli" ]
deps += [ "${chip_root}/third_party/openthread:openthread_cli" ]

sources += [
"../OpenThread/OpenThreadUtils.cpp",
Expand Down
Loading

0 comments on commit 483d2a2

Please sign in to comment.