Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Telink] Update to Zephyr v3.7 #36691

Draft
wants to merge 41 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
3663762
[Telink] Zephyr v3.7 update changes
interfer Dec 2, 2024
f0d697e
[Telink] Manual Zephyr SDK update to check CI jobs
s07641069 Nov 25, 2024
794dc59
[Telink] Fix build errors:
s07641069 Nov 25, 2024
bf1b9c8
[Telink] CONFIG_BOOT_MAX_IMG_SECTORS_AUTO used
s07641069 Nov 26, 2024
951f73a
[Telink] Fix build errors
s07641069 Nov 26, 2024
5f20728
[Telink] Reduce mcuboot partition size to 60Kb
s07641069 Dec 2, 2024
cda4887
[Telink] Reduce NET_BUF_*_COUNT (to be tested)
s07641069 Nov 27, 2024
d304e94
[Telink] avoid using NEWLIB_LIBC (use PICOLIB)
s07641069 Dec 2, 2024
1ea5831
Restyled by whitespace
restyled-commits Dec 2, 2024
368924c
Restyled by clang-format
restyled-commits Dec 2, 2024
44b20d6
[Telink] Update Zephyr revision & SDK
s07641069 Dec 2, 2024
05f54f9
[Telink] Adopt TL3218 to latest Zephyr version
s07641069 Dec 2, 2024
79c54e3
[Telink] Use 4mb flash for (B92) Light Switch App target build
s07641069 Dec 3, 2024
2b61414
[Telink] Fix W91 target build
s07641069 Dec 3, 2024
2064da8
[Telink] Fix B91 Mars target build
s07641069 Dec 3, 2024
95eface
[Telink] Use correct if SOC_RISCV_TELINK_TL321X
s07641069 Dec 3, 2024
a1b1a16
[Telink] Fix retention target builds
s07641069 Dec 3, 2024
d9371be
[Telink] fixed W91 WiFi interface init
interfer Dec 4, 2024
6893758
[Telink] Update to latest zephyr (develop_new_matter_fixes) hash
s07641069 Dec 4, 2024
c643c5e
[Telink] memory layout and default config changes
interfer Dec 6, 2024
768e02a
Merge pull request #349 from s07641069/update_zephyr_3.7_mem_optimize
interfer Dec 16, 2024
a3093b6
[Telink] W91 OTA, Factory data commissioning fix
interfer Dec 16, 2024
f887453
[Telink] W91 stacks increase
interfer Dec 17, 2024
3c4d272
[Telink] review changes draft
interfer Dec 17, 2024
025d722
Merge branch 'master' into update_zephyr_3.7
s07641069 Dec 30, 2024
0d36905
[Telink] Add tl7218 board.
andriy-bilynskyy Dec 30, 2024
3cc4d9f
[Telink] Fix compilation warnings.
andriy-bilynskyy Dec 30, 2024
99b861d
[Telink] Fix config option.
andriy-bilynskyy Dec 30, 2024
04ee5ac
[Telink] Cleanup MbedTLS configuration.
andriy-bilynskyy Dec 30, 2024
5d8f6fb
[Telink] Update tl721x default Kconfig
s07641069 Dec 30, 2024
11422fd
[Telink] Remove unused files
s07641069 Dec 30, 2024
79c7f01
[Telink] Update Zephyr revision
s07641069 Dec 30, 2024
01524da
[Telink] Clean config types
s07641069 Jan 2, 2025
d4a3914
[Telink] Update Zephyr revision
s07641069 Jan 3, 2025
55364c4
[Telink] Increase BLE_CTRL_THREAD_STACK_SIZE (B92 SoC retention test)
s07641069 Jan 6, 2025
7548e35
[Telink] Fix compilation warninig
s07641069 Jan 7, 2025
53fb192
[Telink] TL7218 upgrade to support version A2
s07641069 Jan 7, 2025
1bc3274
Merge branch 'master' into update_zephyr_3.7
s07641069 Jan 7, 2025
fd0ff22
[Telink] Remove unused file after resolve merge conflict
s07641069 Jan 7, 2025
493c81a
[Telink] Add tl7218_retention target
s07641069 Jan 20, 2025
41eab7f
riscv: telink: seperate ram for tl3218x .
haiwentelink Jan 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions .github/workflows/chef.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ concurrency:

env:
CHIP_NO_LOG_TIMESTAMPS: true
# Required to Update Zephyr SDK (for developers purpose)
TELINK_ZEPHYR_SDK_DIR: /opt/telink/zephyr-sdk-0.17.0

jobs:
chef_linux:
Expand Down Expand Up @@ -105,13 +107,22 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update Zephyr SDK (for developers purpose)
run: |
set -e
cd /opt/telink
rm -rf zephyr-sdk-0.16.1
curl --location /~https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.17.0/zephyr-sdk-0.17.0_linux-x86_64_minimal.tar.xz --output zephyr-sdk-0.17.0_linux-x86_64_minimal.tar.xz
tar xvf zephyr-sdk-0.17.0_linux-x86_64_minimal.tar.xz
rm -rf zephyr-sdk-0.17.0_linux-x86_64_minimal.tar.xz
zephyr-sdk-0.17.0/setup.sh -t riscv64-zephyr-elf
- name: Checkout submodules & Bootstrap
uses: ./.github/actions/checkout-submodules-and-bootstrap
with:
platform: telink
# - name: Update Zephyr to specific revision (for developers purpose)
# shell: bash
# run: scripts/run_in_build_env.sh "python3 scripts/tools/telink/update_zephyr.py c05c461b1119782cc839cf436fa04ec5e1fb2c8c"
- name: Update Zephyr to specific revision (for developers purpose)
shell: bash
run: scripts/run_in_build_env.sh "python3 scripts/tools/telink/update_zephyr.py 28deded4d225ac5c112d9c6e3659970434a6203a"
- name: CI Examples Telink
shell: bash
run: |
Expand Down
58 changes: 39 additions & 19 deletions .github/workflows/examples-telink.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ concurrency:

env:
CHIP_NO_LOG_TIMESTAMPS: true
# Required to Update Zephyr SDK (for developers purpose)
TELINK_ZEPHYR_SDK_DIR: /opt/telink/zephyr-sdk-0.17.0

jobs:
telink:
Expand All @@ -46,6 +48,17 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Update Zephyr SDK (for developers purpose)
run: |
set -e
cd /opt/telink
rm -rf zephyr-sdk-0.16.1
curl --location /~https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.17.0/zephyr-sdk-0.17.0_linux-x86_64_minimal.tar.xz --output zephyr-sdk-0.17.0_linux-x86_64_minimal.tar.xz
tar xvf zephyr-sdk-0.17.0_linux-x86_64_minimal.tar.xz
rm -rf zephyr-sdk-0.17.0_linux-x86_64_minimal.tar.xz
zephyr-sdk-0.17.0/setup.sh -t riscv64-zephyr-elf

- name: Checkout submodules & Bootstrap
uses: ./.github/actions/checkout-submodules-and-bootstrap
with:
Expand All @@ -57,8 +70,8 @@ jobs:
with:
gh-context: ${{ toJson(github) }}

# - name: Update Zephyr to specific revision (for developers purpose)
# run: scripts/run_in_build_env.sh "python3 scripts/tools/telink/update_zephyr.py c05c461b1119782cc839cf436fa04ec5e1fb2c8c"
- name: Update Zephyr to specific revision (for developers purpose)
run: scripts/run_in_build_env.sh "python3 scripts/tools/telink/update_zephyr.py 28deded4d225ac5c112d9c6e3659970434a6203a"

- name: Build example Telink (B92 retention) Air Quality Sensor App
# Run test for master and s07641069 PRs
Expand All @@ -77,7 +90,6 @@ jobs:
- name: Build example Telink (W91) All Clusters App
# Run test for master and s07641069 PRs
if: github.event.pull_request.number == null || github.event.pull_request.head.repo.full_name == 's07641069/connectedhomeip'
continue-on-error: true
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --target 'telink-tlsr9118bdk40d-all-clusters' build"
Expand Down Expand Up @@ -142,7 +154,6 @@ jobs:

- name: Build example Telink (W91) Lighting App with OTA, Factory Data
# Run test for master and all PRs
continue-on-error: true
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --target 'telink-tlsr9118bdk40d-light-ota-factory-data' build"
Expand All @@ -154,7 +165,7 @@ jobs:
- name: clean out build output (keep tools)
run: rm -rf ./out/telink*

- name: Build example Telink (B91) Lighting App with OTA, RPC, Factory Data and 4Mb flash
- name: Build example Telink (B91) Lighting App with OTA, RPC, Factory Data, 4Mb flash
# Run test for master and all PRs
run: |
./scripts/run_in_build_env.sh \
Expand All @@ -167,40 +178,50 @@ jobs:
- name: clean out build output (keep tools)
run: rm -rf ./out/telink*

- name: Build example Telink (tl321x) Lighting App with OTA (LZMA), Shell, Factory Data
- name: Build example Telink (TL3218) Lighting App with OTA (LZMA), Factory Data
# Run test for master and all PRs
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --target 'telink-tl3218x-light-ota-compress-lzma-shell-factory-data' build"
"./scripts/build/build_examples.py --target 'telink-tl3218-light-ota-compress-lzma-factory-data' build"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
telink tl3218x light-app-ota-compress-lzma-shell-factory-data \
out/telink-tl3218x-light-ota-compress-lzma-shell-factory-data/zephyr/zephyr.elf \
telink tl3218 light-app-ota-compress-lzma-factory-data \
out/telink-tl3218-light-ota-compress-lzma-factory-data/zephyr/zephyr.elf \
/tmp/bloat_reports/

- name: clean out build output (keep tools)
run: rm -rf ./out/telink*

- name: Build example Telink (tl721x) Lighting App with OTA, Shell, Factory Data
- name: Build example Telink (TL7218) Lighting App with OTA, Shell, Factory Data
# Run test for master and all PRs
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --target 'telink-tl7218x-light-ota-shell-factory-data' build"
"./scripts/build/build_examples.py --target 'telink-tl7218-light-ota-shell-factory-data' build"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
telink tl7218x light-app-ota-shell-factory-data \
out/telink-tl7218x-light-ota-shell-factory-data/zephyr/zephyr.elf \
telink tl7218 light-app-ota-shell-factory-data \
out/telink-tl7218-light-ota-shell-factory-data/zephyr/zephyr.elf \
/tmp/bloat_reports/

- name: clean out build output (keep tools)
run: rm -rf ./out/telink*

- name: Build example Telink (B92) Light Switch App with OTA (LZMA), Shell, Factory Data
- name: Build example Telink (TL7218 retention) Light Switch App with OTA (LZMA), Factory Data
# Run test for master and s07641069 PRs
if: github.event.pull_request.number == null || github.event.pull_request.head.repo.full_name == 's07641069/connectedhomeip'
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --target 'telink-tl7218_retention-light-switch-ota-compress-lzma-factory-data' build"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
telink tl7218_retention light-switch-app-ota-compress-lzma-factory-data \
out/telink-tl7218_retention-light-switch-ota-compress-lzma-factory-data/zephyr/zephyr.elf \
/tmp/bloat_reports/

- name: Build example Telink (B92) Light Switch App with OTA (LZMA), Shell, Factory Data, 4Mb flash
# Run test for master and all PRs
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --target 'telink-tlsr9528a-light-switch-ota-compress-lzma-shell-factory-data' build"
"./scripts/build/build_examples.py --target 'telink-tlsr9528a-light-switch-ota-compress-lzma-shell-factory-data-4mb' build"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
telink tlsr9528a light-switch-app-ota-compress-lzma-shell-factory-data \
out/telink-tlsr9528a-light-switch-ota-compress-lzma-shell-factory-data/zephyr/zephyr.elf \
telink tlsr9528a light-switch-app-ota-compress-lzma-shell-factory-data-4mb \
out/telink-tlsr9528a-light-switch-ota-compress-lzma-shell-factory-data-4mb/zephyr/zephyr.elf \
s07641069 marked this conversation as resolved.
Show resolved Hide resolved
/tmp/bloat_reports/

- name: clean out build output
Expand Down Expand Up @@ -321,7 +342,6 @@ jobs:
- name: Build example Telink (W91) Window Covering App
# Run test for master and s07641069 PRs
if: github.event.pull_request.number == null || github.event.pull_request.head.repo.full_name == 's07641069/connectedhomeip'
continue-on-error: true
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --target 'telink-tlsr9118bdk40d-window-covering' build"
Expand Down
22 changes: 10 additions & 12 deletions config/telink/app/bootloader.conf
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,14 @@ CONFIG_BOOT_SWAP_USING_SCRATCH=n
# With disabled option the only image magic is validated
CONFIG_BOOT_VALIDATE_SLOT0=y

# Maximum number of image sectors supported by the bootloader.
# Maximum signed image size: 512 * 4096 = 2M Bytes
CONFIG_BOOT_MAX_IMG_SECTORS=512
# MCUBOOT log levels are:
# - OFF, LOG_LEVEL_ERR_OFF
# - ERROR, LOG_LEVEL_ERR
# - WARNING, LOG_LEVEL_WRN
# - INFO, LOG_LEVEL_INF
# - DEBUG, LOG_LEVEL_DBG
CONFIG_MCUBOOT_LOG_LEVEL_INF=y

# Sets log level for modules which don't specify it explicitly.
# When set to 0 it means log will not be activated for those modules.
# Levels are:
# - 0 OFF, do not write by default
# - 1 ERROR, default to only write LOG_LEVEL_ERR
# - 2 WARNING, default to write LOG_LEVEL_WRN
# - 3 INFO, default to write LOG_LEVEL_INFO
# - 4 DEBUG, default to write LOG_LEVEL_DBG
CONFIG_LOG_DEFAULT_LEVEL=3
# Reduced footprint
CONFIG_GPIO=n
s07641069 marked this conversation as resolved.
Show resolved Hide resolved
CONFIG_PICOLIBC=y
20 changes: 7 additions & 13 deletions config/telink/app/bootloader_compress_lzma.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,13 @@ CONFIG_BOOT_UPGRADE_ONLY=y
# With disabled option the only image magic is validated
CONFIG_BOOT_VALIDATE_SLOT0=y

# Maximum number of image sectors supported by the bootloader.
# Maximum signed image size: 512 * 4096 = 2M Bytes
CONFIG_BOOT_MAX_IMG_SECTORS=512

# Sets log level for modules which don't specify it explicitly.
# When set to 0 it means log will not be activated for those modules.
# Levels are:
# - 0 OFF, do not write by default
# - 1 ERROR, default to only write LOG_LEVEL_ERR
# - 2 WARNING, default to write LOG_LEVEL_WRN
# - 3 INFO, default to write LOG_LEVEL_INFO
# - 4 DEBUG, default to write LOG_LEVEL_DBG
CONFIG_LOG_DEFAULT_LEVEL=3
# MCUBOOT log levels are:
# - OFF, LOG_LEVEL_ERR_OFF
# - ERROR, LOG_LEVEL_ERR
# - WARNING, LOG_LEVEL_WRN
# - INFO, LOG_LEVEL_INF
# - DEBUG, LOG_LEVEL_DBG
CONFIG_MCUBOOT_LOG_LEVEL_INF=y

# LZMA used sys_heap based allocators
CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=78000
Expand Down
23 changes: 5 additions & 18 deletions config/telink/app/enable-gnu-std.cmake
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
#
# Copyright (c) 2021 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

add_library(gnu17 INTERFACE)
target_compile_options(gnu17 INTERFACE $<$<COMPILE_LANGUAGE:CXX>:-std=gnu++17> $<$<COMPILE_LANGUAGE:CXX>:-Wno-register> -D_DEFAULT_SOURCE)
target_link_libraries(app PRIVATE gnu17)
target_compile_options(gnu17
INTERFACE
$<$<COMPILE_LANGUAGE:CXX>:-std=gnu++17>
-D_DEFAULT_SOURCE)
target_link_libraries(app PRIVATE gnu17)
4 changes: 2 additions & 2 deletions config/telink/chip-module/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ matter_add_cxxflags("${ZEPHYR_CFLAGS_CC}")
zephyr_get_gnu_cpp_standard(ZEPHYR_GNU_CPP_STD)
matter_add_cxxflags(${ZEPHYR_GNU_CPP_STD})

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

# Set up custom OpenThread configuration

Expand Down Expand Up @@ -174,7 +174,7 @@ add_dependencies(process_binaries ${ZEPHYR_FINAL_EXECUTABLE})
# Define 'build_mcuboot' target for building the MCUBoot bootloader
# ==============================================================================

if (CONFIG_BOOTLOADER_MCUBOOT AND (CONFIG_SOC_SERIES_RISCV_TELINK_B9X OR CONFIG_SOC_SERIES_RISCV_TELINK_TLX))
if (CONFIG_BOOTLOADER_MCUBOOT AND (CONFIG_SOC_RISCV_TELINK_B9X OR CONFIG_SOC_RISCV_TELINK_TLX))
add_custom_target(build_mcuboot ALL
COMMAND
west build -b ${BASE_BOARD} -d build_mcuboot ${ZEPHYR_BASE}/../bootloader/mcuboot/boot/zephyr
Expand Down
11 changes: 1 addition & 10 deletions config/telink/chip-module/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ config BOOTLOADER_MCUBOOT
bool
select IMG_MANAGER
select STREAM_FLASH
select STREAM_FLASH_ERASE
select TELINK_W91_N22_MATTER_OTA_LAYOUT if BOARD_TLSR9118BDK40D

config CHIP_OTA_REQUESTOR_BUFFER_SIZE
Expand Down Expand Up @@ -225,15 +224,7 @@ config CHIP_ENABLE_PM_DURING_BLE
help
Enable PM during BLE operation.

config CHIP_OPENTHREAD_TX_POWER
int "OpenThread Transmission power"
range -30 9
default 0
help
OpenThread Transmission power in dBm.

config SHELL_BACKEND_SERIAL_RX_RING_BUFFER_SIZE
int
default 255 if SHELL_BACKEND_SERIAL

config CHIP_ENABLE_POWER_ON_FACTORY_RESET
Expand All @@ -252,5 +243,5 @@ config CHIP_TASK_STACK_SIZE

config CHIP_USE_MARS_SENSOR
bool "Use Mars board sensor"
depends on SOC_SERIES_RISCV_TELINK_B9X && (BOARD_TLSR9518ADK80D || BOARD_TLSR9518ADK80D_RETENTION)
depends on SOC_RISCV_TELINK_B9X && (BOARD_TLSR9518ADK80D || BOARD_TLSR9518ADK80D_RETENTION)
default n
Loading
Loading