Skip to content

Commit ead2028

Browse files
Sync csa branch with main (#316)
2 parents 01a2d4a + 7d7d638 commit ead2028

File tree

149 files changed

+10771
-321
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+10771
-321
lines changed

.github/workflows/examples-linux-standalone.yaml

+11-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,17 @@ jobs:
238238
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
239239
linux debug camera-app \
240240
out/linux-x64-camera/chip-camera-app \
241-
/tmp/bloat_reports/
241+
/tmp/bloat_reports/
242+
- name: Build example Camera Controller App
243+
run: |
244+
./scripts/run_in_build_env.sh \
245+
"./scripts/build/build_examples.py \
246+
--target linux-x64-camera-controller \
247+
build"
248+
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
249+
linux debug camera-controller \
250+
out/linux-x64-camera-controller/camera-controller \
251+
/tmp/bloat_reports/
242252
- name: Uploading Size Reports
243253
uses: ./.github/actions/upload-size-reports
244254
if: ${{ !env.ACT }}

.github/workflows/examples-nxp.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
if: github.actor != 'restyled-io[bot]'
4141

4242
container:
43-
image: ghcr.io/project-chip/chip-build-nxp:119
43+
image: ghcr.io/project-chip/chip-build-nxp:120
4444
volumes:
4545
- "/tmp/bloat_reports:/tmp/bloat_reports"
4646
steps:

SECURITY.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Security Policy
2+
3+
Thank you for helping us keep the Matter SDK secure!
4+
5+
## Reporting a Vulnerability
6+
7+
To report a security vulnerability, please follow the instructions at
8+
[Report a Vulnerability | How to Report - CSA-IOT](https://csa-iot.org/vulnerability-reporting/).
9+
10+
We appreciate responsible disclosure and will work to address any issues
11+
promptly.

config/common/cmake/chip_gn.cmake

+5-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ if (NOT CHIP_ROOT)
3636
get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_LIST_DIR}/../../.. REALPATH)
3737
endif()
3838

39+
if (NOT CHIP_APP_ZAP_DIR)
40+
get_filename_component(CHIP_APP_ZAP_DIR ${CHIP_ROOT}/zzz_generated/app-common REALPATH)
41+
endif()
42+
3943
# ==============================================================================
4044
# Find required programs
4145
# ==============================================================================
@@ -165,7 +169,7 @@ macro(matter_build target)
165169
${CHIP_ROOT}/third_party/nlassert/repo/include
166170
${CHIP_ROOT}/third_party/nlio/repo/include
167171
${CHIP_ROOT}/third_party/nlfaultinjection/include
168-
${CHIP_ROOT}/zzz_generated/app-common
172+
${CHIP_APP_ZAP_DIR}
169173
${CMAKE_CURRENT_BINARY_DIR}/gen/include
170174
)
171175

config/esp32/args.gni

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ lwip_platform = "external"
2929
chip_inet_config_enable_tcp_endpoint = false
3030
chip_inet_config_enable_udp_endpoint = true
3131

32+
chip_config_memory_management = "platform"
33+
3234
custom_toolchain = "//third_party/connectedhomeip/config/esp32/toolchain:esp32"
3335

3436
# Avoid constraint forcing for ESP32:

config/esp32/components/chip/CMakeLists.txt

+8
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,14 @@ if(CONFIG_ENABLE_ICD_SERVER)
149149
endif()
150150
endif()
151151

152+
if(CONFIG_CHIP_MEM_ALLOC_MODE_INTERNAL)
153+
chip_gn_arg_append("chip_memory_alloc_mode" "\"internal\"")
154+
elseif(CONFIG_CHIP_MEM_ALLOC_MODE_EXTERNAL)
155+
chip_gn_arg_append("chip_memory_alloc_mode" "\"external\"")
156+
elseif(CONFIG_CHIP_MEM_ALLOC_MODE_DEFAULT)
157+
chip_gn_arg_append("chip_memory_alloc_mode" "\"default\"")
158+
endif()
159+
152160
if(CONFIG_ENABLE_PW_RPC)
153161
string(APPEND chip_gn_args "import(\"//build_overrides/pigweed.gni\")\n")
154162
chip_gn_arg_append("remove_default_configs" "[\"//third_party/connectedhomeip/third_party/pigweed/repo/pw_build:toolchain_cpp_standard\"]")

config/esp32/components/chip/Kconfig

+21
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,27 @@ menu "CHIP Core"
191191
Enable dynamic server to handle a different interaction model dispatch.
192192
Can be implied when users do not want to use the same server clusters.
193193

194+
choice CHIP_MEM_ALLOC_MODE
195+
prompt "Memory allocation strategy"
196+
default CHIP_MEM_ALLOC_MODE_DEFAULT
197+
help
198+
Strategy for Matter memory management
199+
- Internal DRAM memory only
200+
- External SPIRAM memory only
201+
- Either internal or external memory based on default malloc() behavior in ESP-IDF
202+
203+
config CHIP_MEM_ALLOC_MODE_INTERNAL
204+
bool "Internal memory"
205+
206+
config CHIP_MEM_ALLOC_MODE_EXTERNAL
207+
bool "External SPIRAM"
208+
depends on SPIRAM_USE_CAPS_ALLOC || SPIRAM_USE_MALLOC
209+
210+
config CHIP_MEM_ALLOC_MODE_DEFAULT
211+
bool "Default alloc mode"
212+
213+
endchoice # CHIP_MEM_ALLOC_MODE
214+
194215
endmenu # "General Options"
195216

196217
menu "Networking Options"

config/nrfconnect/chip-module/CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ include(generate_factory_data.cmake)
4141
if (NOT CHIP_ROOT)
4242
get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../.. REALPATH)
4343
endif()
44+
45+
if (NOT CHIP_APP_ZAP_DIR)
46+
get_filename_component(CHIP_APP_ZAP_DIR ${CHIP_ROOT}/zzz_generated/app-common REALPATH)
47+
endif()
48+
4449
get_filename_component(GN_ROOT_TARGET ${CHIP_ROOT}/config/nrfconnect/chip-gn REALPATH)
4550
get_filename_component(COMMON_CMAKE_SOURCE_DIR ${CHIP_ROOT}/config/common/cmake REALPATH)
4651

@@ -132,6 +137,7 @@ matter_common_gn_args(
132137
matter_add_gn_arg_string("zephyr_ar" ${CMAKE_AR})
133138
matter_add_gn_arg_string("zephyr_cc" ${CMAKE_C_COMPILER})
134139
matter_add_gn_arg_string("zephyr_cxx" ${CMAKE_CXX_COMPILER})
140+
matter_add_gn_arg_string("chip_app_zap_dir" ${CHIP_APP_ZAP_DIR})
135141
matter_add_gn_arg_bool ("chip_logging" CONFIG_LOG)
136142
matter_add_gn_arg_bool ("chip_enable_openthread" CONFIG_NET_L2_OPENTHREAD)
137143
matter_add_gn_arg_bool ("chip_openthread_ftd" CONFIG_OPENTHREAD_FTD)

docs/examples/camera_controller.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
## Camera
2+
3+
```{toctree}
4+
:glob:
5+
:maxdepth: 1
6+
7+
camera-controller/README
8+
```

examples/all-clusters-app/all-clusters-common/all-clusters-app.matter

+3-3
Original file line numberDiff line numberDiff line change
@@ -3648,7 +3648,7 @@ cluster SmokeCoAlarm = 92 {
36483648

36493649
/** Attributes and commands for configuring the Dishwasher alarm. */
36503650
cluster DishwasherAlarm = 93 {
3651-
revision 1; // NOTE: Default/not specifically set
3651+
revision 1;
36523652

36533653
bitmap AlarmBitmap : bitmap32 {
36543654
kInflowError = 0x1;
@@ -3689,9 +3689,9 @@ cluster DishwasherAlarm = 93 {
36893689
AlarmBitmap mask = 0;
36903690
}
36913691

3692-
/** Reset alarm */
3692+
/** This command resets active and latched alarms (if possible). */
36933693
command Reset(ResetRequest): DefaultSuccess = 0;
3694-
/** Modify enabled alarms */
3694+
/** This command allows a client to request that an alarm be enabled or suppressed at the server. */
36953695
command ModifyEnabledAlarms(ModifyEnabledAlarmsRequest): DefaultSuccess = 1;
36963696
}
36973697

examples/all-clusters-app/nxp/rt/rt1060/BUILD.gn

+15
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,25 @@ rt_sdk("sdk") {
7676
sources += [ "${example_platform_dir}/board/${evkname}/pin_mux.c" ]
7777
}
7878

79+
if (iw416_transceiver || w8801_transceiver || iwx12_transceiver) {
80+
if (evkname == "evkmimxrt1060") {
81+
include_dirs += [ "${example_platform_dir}/board/evkbmimxrt1060/" ]
82+
sources +=
83+
[ "${example_platform_dir}/board/evkbmimxrt1060/sdmmc_config.c" ]
84+
sources +=
85+
[ "${example_platform_dir}/board/evkbmimxrt1060/wifi_bt_config.c" ]
86+
} else {
87+
include_dirs += [ "${example_platform_dir}/board/${evkname}/" ]
88+
sources += [ "${example_platform_dir}/board/${evkname}/sdmmc_config.c" ]
89+
sources += [ "${example_platform_dir}/board/${evkname}/wifi_bt_config.c" ]
90+
}
91+
}
92+
7993
sources += [ "${example_platform_dir}/board/hardware_init.c" ]
8094
sources += [ "${example_platform_dir}/board/clock_config.c" ]
8195
sources += [ "${example_platform_dir}/board/board.c" ]
8296
sources += [ "${example_platform_dir}/board/peripherals.c" ]
97+
sources += [ "${example_platform_dir}/board/board_comp.c" ]
8398

8499
# Indicate the path to CHIPProjectConfig.h
85100
include_dirs += [ "include/config" ]

examples/all-clusters-app/nxp/rt/rt1170/BUILD.gn

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ rt_sdk("sdk") {
6868
sources += [ "${example_platform_dir}/board/board.c" ]
6969
sources += [ "${example_platform_dir}/board/peripherals.c" ]
7070
sources += [ "${example_platform_dir}/board/sdmmc_config.c" ]
71+
sources += [ "${example_platform_dir}/board/wifi_bt_config.c" ]
7172

7273
# Indicate the path to CHIPProjectConfig.h
7374
include_dirs += [ "include/config" ]

examples/camera-controller/.gn

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Copyright (c) 2025 Project CHIP Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
import("//build_overrides/build.gni")
16+
17+
# The location of the build configuration file.
18+
buildconfig = "${build_root}/config/BUILDCONFIG.gn"
19+
20+
# CHIP uses angle bracket includes.
21+
check_system_includes = true
22+
23+
default_args = {
24+
import("//args.gni")
25+
}

examples/camera-controller/BUILD.gn

+117
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# Copyright (c) 2025 Project CHIP Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
import("//build_overrides/build.gni")
16+
import("//build_overrides/chip.gni")
17+
18+
import("//build_overrides/editline.gni")
19+
import("${chip_root}/build/chip/tools.gni")
20+
import("${chip_root}/examples/camera-controller/camera-controller.gni")
21+
import("${chip_root}/src/lib/core/core.gni")
22+
23+
assert(chip_build_tools)
24+
25+
config("config") {
26+
include_dirs = [
27+
".",
28+
"${chip_root}/examples/common",
29+
"${chip_root}/zzz_generated/app-common/app-common",
30+
"${chip_root}/zzz_generated/chip-tool",
31+
"${chip_root}/src/lib",
32+
]
33+
34+
defines = [ "CONFIG_USE_SEPARATE_EVENTLOOP=${config_use_separate_eventloop}" ]
35+
36+
# Note: CONFIG_USE_LOCAL_STORAGE is tested for via #ifdef, not #if.
37+
if (config_use_local_storage) {
38+
defines += [ "CONFIG_USE_LOCAL_STORAGE" ]
39+
}
40+
}
41+
42+
static_library("camera-controller-utils") {
43+
sources = [
44+
"${chip_root}/src/controller/ExamplePersistentStorage.cpp",
45+
"${chip_root}/src/controller/ExamplePersistentStorage.h",
46+
"${chip_root}/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp",
47+
"${chip_root}/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp",
48+
"commands/clusters/ModelCommand.cpp",
49+
"commands/clusters/ModelCommand.h",
50+
"commands/clusters/ReportCommand.cpp",
51+
"commands/clusters/ReportCommand.h",
52+
"commands/common/CHIPCommand.cpp",
53+
"commands/common/CHIPCommand.h",
54+
"commands/common/Command.cpp",
55+
"commands/common/Command.h",
56+
"commands/common/Commands.cpp",
57+
"commands/common/Commands.h",
58+
"commands/common/CredentialIssuerCommands.h",
59+
"commands/common/HexConversion.h",
60+
"commands/common/RemoteDataModelLogger.cpp",
61+
"commands/common/RemoteDataModelLogger.h",
62+
"commands/pairing/OpenCommissioningWindowCommand.cpp",
63+
"commands/pairing/OpenCommissioningWindowCommand.h",
64+
"commands/pairing/PairingCommand.cpp",
65+
"commands/pairing/ToTLVCert.cpp",
66+
]
67+
68+
deps = [ "${chip_root}/src/app:events" ]
69+
70+
sources += [ "commands/interactive/InteractiveCommands.cpp" ]
71+
deps += [
72+
"${chip_root}/src/platform/logging:headers",
73+
"${editline_root}:editline",
74+
]
75+
76+
if (chip_device_platform == "darwin") {
77+
sources += [ "commands/common/DeviceScanner.cpp" ]
78+
}
79+
80+
public_deps = [
81+
"${chip_root}/examples/common/tracing:commandline",
82+
"${chip_root}/src/app/server",
83+
"${chip_root}/src/app/tests/suites/commands/interaction_model",
84+
"${chip_root}/src/controller/data_model",
85+
"${chip_root}/src/credentials:file_attestation_trust_store",
86+
"${chip_root}/src/lib",
87+
"${chip_root}/src/lib/core:types",
88+
"${chip_root}/src/lib/support/jsontlv",
89+
"${chip_root}/src/platform",
90+
"${chip_root}/third_party/inipp",
91+
"${chip_root}/third_party/jsoncpp",
92+
]
93+
94+
public_configs = [ ":config" ]
95+
96+
if (chip_enable_transport_trace) {
97+
public_deps +=
98+
[ "${chip_root}/examples/common/tracing:trace_handlers_decoder" ]
99+
}
100+
101+
output_dir = root_out_dir
102+
}
103+
104+
executable("camera-controller") {
105+
sources = [ "main.cpp" ]
106+
107+
deps = [
108+
":camera-controller-utils",
109+
"${chip_root}/src/platform/logging:stdio",
110+
]
111+
112+
output_dir = root_out_dir
113+
}
114+
115+
group("default") {
116+
deps = [ ":camera-controller" ]
117+
}

examples/camera-controller/README.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Matter Camera Controller Example
2+
3+
This example application demonstrates the CHIP Camera Controller running on a
4+
Linux platform and explains how to build and run the Camera Controller Example
5+
on Linux.
6+
7+
In a typical setup, the Camera Controller app manages a CameraDevice app running
8+
on a Raspberry Pi. The CameraDevice captures and encodes the video feed before
9+
streaming it through a WebRTC track, while the CameraController receives this
10+
video stream and displays it, creating a complete end-to-end camera solution.
11+
12+
---
13+
14+
- [Building the Example Application](#building-the-example-application)
15+
16+
---
17+
18+
## Building the Example Application
19+
20+
For Linux host example:
21+
22+
```
23+
source scripts/activate.sh
24+
./scripts/build/build_examples.py --target linux-x64-camera-controller build
25+
```

0 commit comments

Comments
 (0)