Skip to content

Commit e56ddc4

Browse files
Sync csa branch with main (#306)
2 parents e61ee3c + 1612d52 commit e56ddc4

File tree

127 files changed

+13360
-497
lines changed

Some content is hidden

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

127 files changed

+13360
-497
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

.vscode/launch.json

+19
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,25 @@
550550
"runToEntryPoint": "main",
551551
"preLaunchTask": "Debug Open IoT SDK unit-tests",
552552
"showDevDebugOutput": "parsed"
553+
},
554+
{
555+
"name": "Zephyr native tests",
556+
"type": "cppdbg",
557+
"request": "launch",
558+
"program": "${workspaceFolder}/out/nrf-native-sim-tests/nrfconnect/zephyr/zephyr.exe",
559+
"args": ["-testargs"],
560+
"stopAtEntry": false,
561+
"cwd": "${workspaceFolder}/out/nrf-native-sim-tests/nrfconnect",
562+
"environment": [],
563+
"externalConsole": false,
564+
"MIMode": "gdb",
565+
"setupCommands": [
566+
{
567+
"description": "Enable pretty-printing for gdb",
568+
"text": "-enable-pretty-printing",
569+
"ignoreFailures": true
570+
}
571+
]
553572
}
554573
],
555574
"inputs": [

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/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

0 commit comments

Comments
 (0)