Skip to content

Commit 1dd299e

Browse files
Merge branch 'master' into metering-identification-cluster-test-scripts
2 parents 15cb8bd + f4260df commit 1dd299e

File tree

486 files changed

+26338
-7872
lines changed

Some content is hidden

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

486 files changed

+26338
-7872
lines changed

.devcontainer/Dockerfile

+6-6
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ LABEL org.opencontainers.image.source https://github.com/project-chip/connectedh
2222
ARG USERNAME=vscode
2323
ARG USER_UID=1000
2424
ARG USER_GID=$USER_UID
25-
ENV LANG en_US.utf8
25+
ENV LANG=en_US.utf8
2626

2727

2828
# These are installed for terminal/dev convenience. If more tooling for build is required, please
@@ -81,17 +81,17 @@ RUN sed -i '/^TIZEN_SDK_DATA_PATH/d' $TIZEN_SDK_ROOT/sdk.info \
8181
&& ln -sf /home/$USERNAME/.tizen-cli-config $TIZEN_SDK_ROOT/tools/.tizen-cli-config \
8282
&& : # last line
8383

84-
ENV TIZEN_ROOTFS /tizen_rootfs
84+
ENV TIZEN_ROOTFS=/tizen_rootfs
8585

8686
# Fast Model GDB plugins path for debugging support
87-
ENV FAST_MODEL_PLUGINS_PATH /opt/FastModelsPortfolio_11.16/plugins/Linux64_GCC-9.3
87+
ENV FAST_MODEL_PLUGINS_PATH=/opt/FastModelsPortfolio_11.16/plugins/Linux64_GCC-9.3
8888

8989
# Set up ccache as a pigweed command launcher when using the scripts/build/build_examples.py
9090
# script. Also, set up icecc as the command prefix for ccache. Such setup allows to benefit
9191
# from compilation caching and distributed compilation at the same time.
9292
#
9393
# NOTE: In order to use distributed compilation with icecc, one should run
9494
# "scripts/icecc.sh start" before starting the build.
95-
ENV CHIP_PW_COMMAND_LAUNCHER ccache
96-
ENV CCACHE_PREFIX icecc
97-
ENV PATH /usr/lib/ccache:$PATH
95+
ENV CHIP_PW_COMMAND_LAUNCHER=ccache
96+
ENV CCACHE_PREFIX=icecc
97+
ENV PATH=/usr/lib/ccache:$PATH

.github/workflows/docker_img.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ jobs:
105105
- "-nxp-zephyr"
106106
- "-nrf-platform"
107107
- "-telink"
108+
- "-telink-zephyr_3_3"
108109
- "-ti"
109110
- "-tizen"
110111
- "-openiotsdk"

.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:

.github/workflows/examples-telink.yaml

+18-13
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@ jobs:
175175
out/telink-tl3218x-light-ota-compress-lzma-shell-factory-data/zephyr/zephyr.elf \
176176
/tmp/bloat_reports/
177177
178+
- name: clean out build output (keep tools)
179+
run: rm -rf ./out/telink*
180+
178181
- name: Build example Telink (tl321x_retention) Light Switch App with OTA, Shell, Factory Data
179182
# Run test for master and all PRs
180183
run: |
@@ -311,19 +314,21 @@ jobs:
311314
- name: clean out build output
312315
run: rm -rf ./out
313316

314-
- name: Build example Telink (B91 Mars) Temperature Measurement App with OTA
315-
# Run test for master and s07641069 PRs
316-
if: github.event.pull_request.number == null || github.event.pull_request.head.repo.full_name == 's07641069/connectedhomeip'
317-
run: |
318-
./scripts/run_in_build_env.sh \
319-
"./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-temperature-measurement-mars-ota' build"
320-
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
321-
telink tlsr9518adk80d temperature-measurement-app-mars-ota \
322-
out/telink-tlsr9518adk80d-temperature-measurement-mars-ota/zephyr/zephyr.elf \
323-
/tmp/bloat_reports/
324-
325-
- name: clean out build output
326-
run: rm -rf ./out
317+
# B91 Mars adopted only for Zephyr 3.7
318+
# Will be uncommented in next commits
319+
# - name: Build example Telink (B91 Mars) Temperature Measurement App with OTA
320+
# # Run test for master and s07641069 PRs
321+
# if: github.event.pull_request.number == null || github.event.pull_request.head.repo.full_name == 's07641069/connectedhomeip'
322+
# run: |
323+
# ./scripts/run_in_build_env.sh \
324+
# "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-temperature-measurement-mars-ota' build"
325+
# .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
326+
# telink tlsr9518adk80d temperature-measurement-app-mars-ota \
327+
# out/telink-tlsr9518adk80d-temperature-measurement-mars-ota/zephyr/zephyr.elf \
328+
# /tmp/bloat_reports/
329+
330+
# - name: clean out build output
331+
# run: rm -rf ./out
327332

328333
- name: Build example Telink (B91) Thermostat App
329334
# Run test for master and s07641069 PRs

.github/workflows/tests.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ jobs:
200200
src/app/zap-templates/zcl/data-model/chip/time-synchronization-cluster.xml \
201201
src/app/zap-templates/zcl/data-model/chip/timer-cluster.xml \
202202
src/app/zap-templates/zcl/data-model/chip/tls-certificate-management-cluster.xml \
203+
src/app/zap-templates/zcl/data-model/chip/tls-client-management-cluster.xml \
203204
src/app/zap-templates/zcl/data-model/chip/user-label-cluster.xml \
204205
src/app/zap-templates/zcl/data-model/chip/unit-localization-cluster.xml \
205206
src/app/zap-templates/zcl/data-model/chip/wake-on-lan-cluster.xml \

.github/workflows/zap_regeneration.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
zap_regeneration:
2929
name: ZAP Regeneration
3030

31-
runs-on: ubuntu-20.04
31+
runs-on: ubuntu-latest
3232
container:
3333
image: ghcr.io/project-chip/chip-build:119
3434
defaults:

.github/workflows/zap_templates.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
zap_templates:
3434
name: ZAP templates generation
3535

36-
runs-on: ubuntu-20.04
36+
runs-on: ubuntu-latest
3737
container:
3838
image: ghcr.io/project-chip/chip-build:119
3939
defaults:

CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,6 @@ stm32/ @STYoannZamaron
6767

6868
telink/ @s07641069
6969
chip-build-telink/ @s07641069
70+
chip-build-telink-zephyr_3_3/ @s07641069
7071

7172
webos/ @joonhaengHeo

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ be useful for quick filtering like `[TC-ABC-1.2]` to tag test changes.
175175
Examples of descriptive titles:
176176

177177
- `[Silabs] Fix compile of SiWx917 if LED and BUTTON are disabled`
178-
- `[Telink] Update build Dockerfile with new Zeprhy SHA: c05c4.....`
178+
- `[Telink] Update build Dockerfile with new Zephyr SHA: c05c4.....`
179179
- `General Commissioning Cluster: use AttributeAccessInterface/CommandHandlerInterface for processing`
180180
- `Scenes Management/CopyScene: set access as manage instead of default to match the spec`
181181
- `Fix build errors due to ChipDeviceEvent default constructor not being available`

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.

build/config/compiler/BUILD.gn

+7
Original file line numberDiff line numberDiff line change
@@ -671,3 +671,10 @@ config("specs_default") {
671671
ldflags = cflags
672672
}
673673
}
674+
675+
config("link_as_needed") {
676+
# ld64.lld on clang used by Apple does not have a --as-needed option
677+
if (current_os != "mac" && current_os != "ios") {
678+
ldflags = [ "-Wl,--as-needed" ]
679+
}
680+
}

build/config/defaults.gni

+5
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ declare_args() {
6161
# Defaults configs for pie.
6262
default_configs_pie = [ "${build_root}/config/compiler:pie_default" ]
6363

64+
# Default configs for GNU ld --as-needed
65+
default_configs_link_as_needed =
66+
[ "${build_root}/config/compiler:link_as_needed" ]
67+
6468
# Defaults configs for warnings.
6569
default_configs_warnings =
6670
[ "${build_root}/config/compiler:warnings_default" ]
@@ -124,3 +128,4 @@ default_configs += default_configs_extra
124128

125129
executable_default_configs = []
126130
executable_default_configs += default_configs_pie
131+
executable_default_configs += default_configs_link_as_needed

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)

config/telink/app/bootloader.conf

+3
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ CONFIG_BOOT_SWAP_USING_SCRATCH=n
2929
# With disabled option the only image magic is validated
3030
CONFIG_BOOT_VALIDATE_SLOT0=y
3131

32+
# Required for Zephyr 3.3 and replased with CONFIG_BOOT_MAX_IMG_SECTORS_AUTO in new versions
3233
# Maximum number of image sectors supported by the bootloader.
3334
# Maximum signed image size: 512 * 4096 = 2M Bytes
3435
CONFIG_BOOT_MAX_IMG_SECTORS=512
@@ -40,3 +41,5 @@ CONFIG_BOOT_MAX_IMG_SECTORS=512
4041
# - INFO, LOG_LEVEL_INF
4142
# - DEBUG, LOG_LEVEL_DBG
4243
CONFIG_MCUBOOT_LOG_LEVEL_INF=y
44+
45+
CONFIG_PICOLIBC=y

config/telink/app/bootloader_compress_lzma.conf

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ CONFIG_BOOT_UPGRADE_ONLY=y
2222
# With disabled option the only image magic is validated
2323
CONFIG_BOOT_VALIDATE_SLOT0=y
2424

25+
# Required for Zephyr 3.3 and replased with CONFIG_BOOT_MAX_IMG_SECTORS_AUTO in new versions
2526
# Maximum number of image sectors supported by the bootloader.
2627
# Maximum signed image size: 512 * 4096 = 2M Bytes
2728
CONFIG_BOOT_MAX_IMG_SECTORS=512
@@ -42,3 +43,5 @@ CONFIG_SIZE_OPTIMIZATIONS=y
4243

4344
# Enable support LZMA compression
4445
CONFIG_COMPRESS_LZMA=y
46+
47+
CONFIG_PICOLIBC=y

config/telink/chip-module/CMakeLists.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ endif()
5656
matter_add_flags(-DNL_ASSERT_USE_FLAGS_DEFAULT=1)
5757

5858
zephyr_include_directories(${CHIP_ROOT}/src/platform/telink/)
59+
zephyr_include_directories(${CHIP_ROOT}/src/platform/telink/wifi/${ZEPHYR_VERSION_STRING})
5960

6061
zephyr_get_compile_flags(ZEPHYR_CFLAGS_C C)
6162
matter_add_cflags("${ZEPHYR_CFLAGS_C}")
@@ -64,7 +65,7 @@ matter_add_cxxflags("${ZEPHYR_CFLAGS_CC}")
6465
zephyr_get_gnu_cpp_standard(ZEPHYR_GNU_CPP_STD)
6566
matter_add_cxxflags(${ZEPHYR_GNU_CPP_STD})
6667

67-
matter_add_flags(-DMBEDTLS_USER_CONFIG_FILE=<telink-mbedtls-config.h>)
68+
matter_add_flags(-DMBEDTLS_USER_CONFIG_FILE=<${CONFIG_MBEDTLS_CFG_FILE}>)
6869

6970
# Set up custom OpenThread configuration
7071

config/telink/chip-module/Kconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ config BOOTLOADER_MCUBOOT
4646
select IMG_MANAGER
4747
select STREAM_FLASH
4848
select STREAM_FLASH_ERASE
49-
select TELINK_W91_N22_MATTER_OTA_LAYOUT if BOARD_TLSR9118BDK40D
49+
select TELINK_W91_N22_MATTER_OTA_LAYOUT if BOARD_TLSR9118BDK40D || BOARD_TLSR9118BDK40D_V1
5050

5151
config CHIP_OTA_REQUESTOR_BUFFER_SIZE
5252
int "OTA Requestor image buffer size"

0 commit comments

Comments
 (0)