Skip to content

Commit fd66a70

Browse files
authored
Merge branch 'master' into link_as_needed
2 parents c377aac + 5aeae51 commit fd66a70

33 files changed

+1649
-120
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/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

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"

config/telink/chip-module/Kconfig.defaults

+45-17
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ config CHIP_PROJECT_CONFIG
2424
string "Project configuration file for Matter"
2525
default "include/CHIPProjectConfig.h"
2626

27+
config ZEPHYR_VERSION_3_3
28+
bool "Using Zephyr version 3.3"
29+
default n
30+
2731
config LOG
2832
default y
2933

@@ -62,6 +66,7 @@ config POSIX_MAX_FDS
6266
# Application stack size
6367
config MAIN_STACK_SIZE
6468
default 3240 if PM || SOC_RISCV_TELINK_TL321X
69+
default 4608 if SOC_RISCV_TELINK_W91 && !ZEPHYR_VERSION_3_3
6570
default 4096
6671

6772
config INIT_STACKS
@@ -79,11 +84,12 @@ config SYSTEM_WORKQUEUE_STACK_SIZE
7984
default 616 if PM
8085

8186
config HEAP_MEM_POOL_SIZE
82-
default 256
87+
default 256 if ZEPHYR_VERSION_3_3
88+
default 1280
8389

8490
config COMMON_LIBC_MALLOC_ARENA_SIZE
85-
default 20716 if SOC_RISCV_TELINK_TL321X || SOC_SERIES_RISCV_TELINK_B9X_RETENTION
86-
default 16384 if SOC_RISCV_TELINK_TL721X
91+
default 20716 if SOC_SERIES_RISCV_TELINK_B9X_RETENTION || (SOC_RISCV_TELINK_TL321X && ZEPHYR_VERSION_3_3)
92+
default 16384 if SOC_RISCV_TELINK_TL721X || (SOC_RISCV_TELINK_TL321X && !ZEPHYR_VERSION_3_3)
8793
default 12288
8894

8995
config NET_IPV6_MLD
@@ -171,7 +177,8 @@ config BT_DEVICE_NAME_GATT_WRITABLE
171177
if SOC_RISCV_TELINK_B9X || SOC_RISCV_TELINK_TLX
172178

173179
config TL_BLE_CTRL_THREAD_STACK_SIZE
174-
default 648
180+
default 648 if ZEPHYR_VERSION_3_3
181+
default 680
175182

176183
config TL_BLE_CTRL_MASTER_MAX_NUM
177184
default 0
@@ -193,13 +200,9 @@ endif # SOC_RISCV_TELINK_B9X || SOC_RISCV_TELINK_TLX
193200

194201
endif # BT
195202

196-
# Board retention config
197-
# Cut down the ram cost by matter's change,it can keep ramcode (driver).
198-
# No need load the ramcode every time in thread mode (retention mode).
199-
# If the ram is not enough , can change it back , initial setting is n.
200203
if BOARD_TLSR9528A_RETENTION || BOARD_TLSR9518ADK80D_RETENTION
201204
config SOC_SERIES_RISCV_TELINK_B9X_NON_RETENTION_RAM_CODE
202-
default n if PM
205+
default y if PM
203206

204207
config TELINK_B9X_MATTER_RETENTION_LAYOUT
205208
default y if PM
@@ -236,7 +239,7 @@ config CHIP_OTA_REQUESTOR
236239
default y
237240

238241
config MCUBOOT_SIGNATURE_KEY_FILE
239-
default "bootloader/mcuboot/root-ec-p256.pem" if BOARD_TLSR9118BDK40D
242+
default "bootloader/mcuboot/root-ec-p256.pem" if BOARD_TLSR9118BDK40D || BOARD_TLSR9118BDK40D_V1
240243
depends on BOOTLOADER_MCUBOOT
241244

242245
# In current config/zephyr/Kconfig
@@ -350,6 +353,8 @@ config CHIP_WIFI
350353
select NET_IPV6_ND # enable Neighbor Discovery to handle Router Advertisements
351354
select NET_IPV6_NBR_CACHE
352355
select NET_STATISTICS_USER_API
356+
imply MBEDTLS_ENTROPY_C
357+
imply MBEDTLS_KEY_EXCHANGE_RSA_ENABLED
353358

354359
if CHIP_WIFI
355360

@@ -404,7 +409,14 @@ config CHIP_WIFI_CONNECTION_RECOVERY_JITTER
404409
within range [-JITTER; +JITTER].
405410

406411
config NET_MGMT_EVENT_STACK_SIZE
407-
default 1128
412+
default 1128 if ZEPHYR_VERSION_3_3
413+
default 1250
414+
415+
if !ZEPHYR_VERSION_3_3
416+
config IPC_SERVICE_BACKEND_ICMSG_WQ_STACK_SIZE
417+
int "Size of RX work queue stack"
418+
default 2304 if TELINK_W91_IPC_DISPATCHER
419+
endif
408420

409421
endif # CHIP_WIFI
410422

@@ -419,12 +431,9 @@ config CHIP_ENABLE_PAIRING_AUTOSTART
419431
config MBEDTLS
420432
default y
421433

422-
config MBEDTLS_USER_CONFIG_ENABLE
434+
config MBEDTLS_CIPHER_AES_ENABLED
423435
default y
424436

425-
config MBEDTLS_USER_CONFIG_FILE
426-
default "telink-mbedtls-config.h"
427-
428437
config MBEDTLS_CIPHER_CCM_ENABLED
429438
default y
430439

@@ -443,10 +452,29 @@ config MBEDTLS_ECDH_C
443452
config MBEDTLS_ECDSA_C
444453
default y
445454

446-
# getopt version
447-
config GETOPT_LONG
455+
config MBEDTLS_PKCS5_C
456+
default y
457+
458+
config MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED
459+
default y
460+
461+
if !ZEPHYR_VERSION_3_3
462+
config MBEDTLS_ENTROPY_POLL_ZEPHYR
463+
bool "Provide entropy data to Mbed TLS through entropy driver or random generator"
464+
default y
465+
466+
config MBEDTLS_HKDF_C
467+
bool "HMAC-based Extract-and-Expand Key Derivation Function"
448468
default y
449469

470+
config MBEDTLS_X509_CSR_WRITE_C
471+
bool "X.509 Certificate Signing Requests writing"
472+
default y
473+
endif # !ZEPHYR_VERSION_3_3
474+
475+
config GETOPT_LONG
476+
default y if ZEPHYR_VERSION_3_3
477+
450478
# Disable not used shell modules
451479

452480
config SHELL_WILDCARD

docs/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
docutils==0.21.2
2-
Sphinx==8.2.0
2+
Sphinx==8.2.3
33
sphinx-book-theme
44
myst-parser>=2.0.0
55
breathe>=4.34

examples/energy-management-app/energy-management-common/energy-management-app.matter

+4-3
Original file line numberDiff line numberDiff line change
@@ -2576,7 +2576,8 @@ provisional cluster DeviceEnergyManagementMode = 159 {
25762576
}
25772577

25782578
endpoint 0 {
2579-
device type ma_rootdevice = 22, version 1;
2579+
device type ma_rootdevice = 22, version 3;
2580+
device type ma_otarequestor = 18, version 1;
25802581

25812582
binding cluster OtaSoftwareUpdateProvider;
25822583

@@ -2786,8 +2787,8 @@ endpoint 0 {
27862787
endpoint 1 {
27872788
device type ma_powersource = 17, version 1;
27882789
device type ma_electricalsensor = 1296, version 1;
2789-
device type energy_evse = 1292, version 1;
2790-
device type device_energy_management = 1293, version 1;
2790+
device type energy_evse = 1292, version 2;
2791+
device type device_energy_management = 1293, version 2;
27912792

27922793

27932794
server cluster Identify {

examples/energy-management-app/energy-management-common/energy-management-app.zap

+13-4
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,22 @@
5151
"label": "MA-rootdevice",
5252
"name": "MA-rootdevice",
5353
"deviceTypeOrder": 0
54+
},
55+
{
56+
"code": 18,
57+
"profileId": 259,
58+
"label": "MA-otarequestor",
59+
"name": "MA-otarequestor",
60+
"deviceTypeOrder": 1
5461
}
5562
],
5663
"deviceVersions": [
64+
3,
5765
1
5866
],
5967
"deviceIdentifiers": [
60-
22
68+
22,
69+
18
6170
],
6271
"deviceTypeName": "MA-rootdevice",
6372
"deviceTypeCode": 22,
@@ -1606,7 +1615,7 @@
16061615
"storageOption": "External",
16071616
"singleton": 0,
16081617
"bounded": 0,
1609-
"defaultValue": null,
1618+
"defaultValue": "",
16101619
"reportable": 1,
16111620
"minInterval": 1,
16121621
"maxInterval": 65534,
@@ -2561,9 +2570,9 @@
25612570
}
25622571
],
25632572
"deviceVersions": [
2573+
2,
25642574
1,
2565-
1,
2566-
1,
2575+
2,
25672576
1
25682577
],
25692578
"deviceIdentifiers": [

examples/platform/telink/common.cmake

+22-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,27 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16+
# Generate Zephyr version files for backward compatibility
17+
file(STRINGS "$ENV{ZEPHYR_BASE}/VERSION" ZEPHYR_VERSION_STRING REGEX "[0-9]+")
18+
string(REGEX REPLACE "[^0-9;]" "" ZEPHYR_VERSION_STRING "${ZEPHYR_VERSION_STRING}")
19+
string(REPLACE ";" "." ZEPHYR_VERSION_STRING "${ZEPHYR_VERSION_STRING}")
20+
file(WRITE "${CMAKE_BINARY_DIR}/modules/chip-module/zephyr_version.gni" "ZEPHYR_VERSION_STRING = \"${ZEPHYR_VERSION_STRING}\"\n")
21+
if(${ZEPHYR_VERSION_STRING} MATCHES "^3\\.3")
22+
set(ZEPHYR_VERSION_OVERLAY_FILE "${CMAKE_BINARY_DIR}/zephyr_version.conf")
23+
file(WRITE ${ZEPHYR_VERSION_OVERLAY_FILE} "CONFIG_ZEPHYR_VERSION_3_3=y\n")
24+
25+
function(add_compile_definitions)
26+
foreach(flag IN LISTS ARGN)
27+
add_definitions(-D${flag})
28+
list(APPEND MATTER_CFLAGS "-D${flag}")
29+
endforeach()
30+
set(MATTER_CFLAGS "${MATTER_CFLAGS}" PARENT_SCOPE)
31+
endfunction()
32+
33+
# Add required MbedTLS defines for Zephyr 3.3
34+
add_compile_definitions(MBEDTLS_HKDF_C MBEDTLS_X509_CREATE_C MBEDTLS_X509_CSR_WRITE_C)
35+
endif()
36+
1637
string(REPLACE "_retention" "" BASE_BOARD ${BOARD})
1738
string(REGEX REPLACE "_v[0-9]+" "" BASE_BOARD ${BASE_BOARD})
1839

@@ -117,7 +138,7 @@ else()
117138
endif()
118139

119140
if(NOT CONF_FILE)
120-
set(CONF_FILE ${USB_CONF_OVERLAY_FILE} ${MARS_CONF_OVERLAY_FILE} prj.conf)
141+
set(CONF_FILE ${USB_CONF_OVERLAY_FILE} ${MARS_CONF_OVERLAY_FILE} ${ZEPHYR_VERSION_OVERLAY_FILE} prj.conf)
121142
endif()
122143

123144
# Load NCS/Zephyr build system

integrations/docker/images/stage-2/chip-build-java/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ RUN set -x \
1919
&& rm -f kotlinc/bin/*.bat \
2020
&& : # last line
2121

22-
ENV PATH $PATH:/usr/lib/kotlinc/bin
22+
ENV PATH=$PATH:/usr/lib/kotlinc/bin
2323
ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64

0 commit comments

Comments
 (0)