Skip to content

Commit 9a75125

Browse files
s07641069andriy-bilynskyyrestyled-commits
authored
[Telink] Add B92 (tlsr9528a) SoC support & Update Telink image to 10 (#28841)
* [Telink] Add tlsr9528a (B92) to CI * [Telink] Remove set board by default (Readme files needs to be updated) * [Telink] use B9X instead of B91 * [Telink] Add tlsr9528a (B92) DTS overlay * [Telink] temporarry disable BLE for Jenkins * [Telink] Use Zephyr sys_reboot instead of HAL version * Revert "[Telink] temporarry disable BLE for Jenkins" This reverts commit 066b0a2. * [Telink] use B9X instead of B91 * [Telink] Set correct BOOT_MAX_IMG_SECTORS for B92 * [Telink] Adopt to latest master chnages * [Telink] Add info how to build B9X * [Telink] Update partitions * [Telink] Reset default CONFIG_SETTINGS_NVS_SECTOR_SIZE_MULT * [Telink] Support USB dongle * [Telink] Update Telink image to 10 * Restyled * [Telink] Change bootloader log level * [Telink] Add Chef example to CI * [Telink] Use B9X * [Telink] Add chef bundle function * Restyled by autopep8 * [Telink] Divide CI apps between two SoCs --------- Co-authored-by: Andrii Bilynskyi <andrii.bilynskyi@telink-semi.com> Co-authored-by: Restyled.io <commits@restyled.io>
1 parent 0e7d3b7 commit 9a75125

File tree

59 files changed

+590
-259
lines changed

Some content is hidden

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

59 files changed

+590
-259
lines changed

.github/workflows/chef.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,24 @@ jobs:
8989
shell: bash
9090
run: |
9191
./scripts/run_in_build_env.sh "./examples/chef/chef.py --ci -t nrfconnect"
92+
93+
chef_telink:
94+
name: Chef - Telink CI Examples
95+
runs-on: ubuntu-latest
96+
if: github.actor != 'restyled-io[bot]'
97+
98+
container:
99+
image: ghcr.io/project-chip/chip-build-telink:10
100+
options: --user root
101+
102+
steps:
103+
- name: Checkout
104+
uses: actions/checkout@v3
105+
- name: Checkout submodules & Bootstrap
106+
uses: ./.github/actions/checkout-submodules-and-bootstrap
107+
with:
108+
platform: telink
109+
- name: CI Examples Telink
110+
shell: bash
111+
run: |
112+
./scripts/run_in_build_env.sh "./examples/chef/chef.py --ci -t telink"

.github/workflows/examples-telink.yaml

+45-72
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2022 Project CHIP Authors
1+
# Copyright (c) 2022-2023 Project CHIP Authors
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -36,7 +36,7 @@ jobs:
3636
if: github.actor != 'restyled-io[bot]'
3737

3838
container:
39-
image: ghcr.io/project-chip/chip-build-telink:1
39+
image: ghcr.io/project-chip/chip-build-telink:10
4040
volumes:
4141
- "/tmp/bloat_reports:/tmp/bloat_reports"
4242

@@ -54,7 +54,7 @@ jobs:
5454
with:
5555
gh-context: ${{ toJson(github) }}
5656

57-
- name: Build example Telink All Clusters App
57+
- name: Build example Telink (B91) All Clusters App
5858
run: |
5959
./scripts/run_in_build_env.sh \
6060
"./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-all-clusters' build"
@@ -66,19 +66,19 @@ jobs:
6666
- name: clean out build output
6767
run: rm -rf ./out
6868

69-
- name: Build example Telink All Clusters Minimal App
69+
- name: Build example Telink (B92) All Clusters Minimal App
7070
run: |
7171
./scripts/run_in_build_env.sh \
72-
"./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-all-clusters-minimal' build"
72+
"./scripts/build/build_examples.py --target 'telink-tlsr9528a-all-clusters-minimal' build"
7373
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
74-
telink tlsr9518adk80d all-clusters-minimal-app \
75-
out/telink-tlsr9518adk80d-all-clusters-minimal/zephyr/zephyr.elf \
74+
telink tlsr9528a all-clusters-minimal-app \
75+
out/telink-tlsr9528a-all-clusters-minimal/zephyr/zephyr.elf \
7676
/tmp/bloat_reports/
7777
7878
- name: clean out build output
7979
run: rm -rf ./out
8080

81-
- name: Build example Telink Bridge App
81+
- name: Build example Telink (B91) Bridge App
8282
run: |
8383
./scripts/run_in_build_env.sh \
8484
"./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-bridge' build"
@@ -90,70 +90,43 @@ jobs:
9090
- name: clean out build output
9191
run: rm -rf ./out
9292

93-
- name: Build example Telink Contact Sensor App
93+
- name: Build example Telink (B92) Contact Sensor App
9494
run: |
9595
./scripts/run_in_build_env.sh \
96-
"./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-contact-sensor' build"
96+
"./scripts/build/build_examples.py --target 'telink-tlsr9528a-contact-sensor' build"
9797
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
98-
telink tlsr9518adk80d contact-sensor-app \
99-
out/telink-tlsr9518adk80d-contact-sensor/zephyr/zephyr.elf \
98+
telink tlsr9528a contact-sensor-app \
99+
out/telink-tlsr9528a-contact-sensor/zephyr/zephyr.elf \
100100
/tmp/bloat_reports/
101101
102102
- name: clean out build output
103103
run: rm -rf ./out
104104

105-
- name: Build example Telink Lighting App
106-
run: |
107-
./scripts/run_in_build_env.sh \
108-
"./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-light' build"
109-
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
110-
telink tlsr9518adk80d lighting-app \
111-
out/telink-tlsr9518adk80d-light/zephyr/zephyr.elf \
112-
/tmp/bloat_reports/
113-
114-
- name: clean out build output
115-
run: rm -rf ./out
116-
117-
- name: Build example Telink Lighting App with RPC
118-
run: |
119-
./scripts/run_in_build_env.sh \
120-
"./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-light-rpc' build"
121-
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
122-
telink tlsr9518adk80d lighting-app-rpc \
123-
out/telink-tlsr9518adk80d-light-rpc/zephyr/zephyr.elf \
124-
/tmp/bloat_reports/
125-
126-
- name: clean out build output
127-
run: rm -rf ./out
128-
129-
- name: Build example Telink Lighting App with Shell
105+
- name: Build example Telink (B91) Lighting App with RPC, Shell and Factory Data
130106
run: |
107+
./scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform linux
108+
./scripts/build/gn_gen.sh
109+
./scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE chip-cert chip-tool spake2p"
131110
./scripts/run_in_build_env.sh \
132-
"./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-light-shell' build"
111+
"./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-light-rpc-shell-factory-data' build"
133112
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
134-
telink tlsr9518adk80d lighting-app-shell \
135-
out/telink-tlsr9518adk80d-light-shell/zephyr/zephyr.elf \
113+
telink tlsr9518adk80d lighting-app-rpc-shell-factory-data \
114+
out/telink-tlsr9518adk80d-light-rpc-shell-factory-data/zephyr/zephyr.elf \
136115
/tmp/bloat_reports/
137116
138-
- name: clean out build output
139-
run: rm -rf ./out
140-
141-
- name: Build example Telink Lighting App with Factory Data
117+
- name: Build example Telink (B92) Lighting App with RPC, Shell and Factory Data
142118
run: |
143-
./scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform linux
144-
./scripts/build/gn_gen.sh
145-
./scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE chip-cert chip-tool spake2p"
146119
./scripts/run_in_build_env.sh \
147-
"./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-light-factory-data' build"
120+
"./scripts/build/build_examples.py --target 'telink-tlsr9528a-light-rpc-shell-factory-data' build"
148121
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
149-
telink tlsr9518adk80d lighting-app-factory-data \
150-
out/telink-tlsr9518adk80d-light-factory-data/zephyr/zephyr.elf \
122+
telink tlsr9528a lighting-app-rpc-shell-factory-data \
123+
out/telink-tlsr9528a-light-rpc-shell-factory-data/zephyr/zephyr.elf \
151124
/tmp/bloat_reports/
152125
153126
- name: clean out build output
154127
run: rm -rf ./out
155128

156-
- name: Build example Telink Light Switch App
129+
- name: Build example Telink (B91) Light Switch App
157130
run: |
158131
./scripts/run_in_build_env.sh \
159132
"./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-light-switch' build"
@@ -165,19 +138,19 @@ jobs:
165138
- name: clean out build output
166139
run: rm -rf ./out
167140

168-
- name: Build example Telink Lock App
141+
- name: Build example Telink (B92) Lock App
169142
run: |
170143
./scripts/run_in_build_env.sh \
171-
"./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-lock' build"
144+
"./scripts/build/build_examples.py --target 'telink-tlsr9528a-lock' build"
172145
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
173-
telink tlsr9518adk80d lock-app \
174-
out/telink-tlsr9518adk80d-lock/zephyr/zephyr.elf \
146+
telink tlsr9528a lock-app \
147+
out/telink-tlsr9528a-lock/zephyr/zephyr.elf \
175148
/tmp/bloat_reports/
176149
177150
- name: clean out build output
178151
run: rm -rf ./out
179152

180-
- name: Build example Telink OTA Requestor App
153+
- name: Build example Telink (B91) OTA Requestor App
181154
run: |
182155
./scripts/run_in_build_env.sh \
183156
"./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-ota-requestor' build"
@@ -189,19 +162,19 @@ jobs:
189162
- name: clean out build output
190163
run: rm -rf ./out
191164

192-
- name: Build example Telink Pump App
165+
- name: Build example Telink (B92) Pump App
193166
run: |
194167
./scripts/run_in_build_env.sh \
195-
"./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-pump' build"
168+
"./scripts/build/build_examples.py --target 'telink-tlsr9528a-pump' build"
196169
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
197-
telink tlsr9518adk80d pump-app \
198-
out/telink-tlsr9518adk80d-pump/zephyr/zephyr.elf \
170+
telink tlsr9528a pump-app \
171+
out/telink-tlsr9528a-pump/zephyr/zephyr.elf \
199172
/tmp/bloat_reports/
200173
201174
- name: clean out build output
202175
run: rm -rf ./out
203176

204-
- name: Build example Telink Pump Controller App
177+
- name: Build example Telink (B91) Pump Controller App
205178
run: |
206179
./scripts/run_in_build_env.sh \
207180
"./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-pump-controller' build"
@@ -213,7 +186,7 @@ jobs:
213186
- name: clean out build output
214187
run: rm -rf ./out
215188

216-
- name: Build example Telink Shell App
189+
- name: Build example Telink (B91) Shell App
217190
run: |
218191
./scripts/run_in_build_env.sh \
219192
"./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-shell' build"
@@ -225,31 +198,31 @@ jobs:
225198
- name: clean out build output
226199
run: rm -rf ./out
227200

228-
- name: Build example Telink Smoke CO Alarm App
201+
- name: Build example Telink (B92) Smoke CO Alarm App
229202
run: |
230203
./scripts/run_in_build_env.sh \
231-
"./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-smoke-co-alarm' build"
204+
"./scripts/build/build_examples.py --target 'telink-tlsr9528a-smoke-co-alarm' build"
232205
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
233-
telink tlsr9518adk80d smoke_co_alarm-app \
234-
out/telink-tlsr9518adk80d-smoke-co-alarm/zephyr/zephyr.elf \
206+
telink tlsr9528a smoke_co_alarm-app \
207+
out/telink-tlsr9528a-smoke-co-alarm/zephyr/zephyr.elf \
235208
/tmp/bloat_reports/
236209
237210
- name: clean out build output
238211
run: rm -rf ./out
239212

240-
- name: Build example Telink Temperature Measurement App
213+
- name: Build example Telink (B92) Temperature Measurement App
241214
run: |
242215
./scripts/run_in_build_env.sh \
243-
"./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-temperature-measurement' build"
216+
"./scripts/build/build_examples.py --target 'telink-tlsr9528a-temperature-measurement' build"
244217
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
245-
telink tlsr9518adk80d temperature-measurement-app \
246-
out/telink-tlsr9518adk80d-temperature-measurement/zephyr/zephyr.elf \
218+
telink tlsr9528a temperature-measurement-app \
219+
out/telink-tlsr9528a-temperature-measurement/zephyr/zephyr.elf \
247220
/tmp/bloat_reports/
248221
249222
- name: clean out build output
250223
run: rm -rf ./out
251224

252-
- name: Build example Telink Thermostat App
225+
- name: Build example Telink (B91) Thermostat App
253226
run: |
254227
./scripts/run_in_build_env.sh \
255228
"./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-thermostat' build"
@@ -261,7 +234,7 @@ jobs:
261234
- name: clean out build output
262235
run: rm -rf ./out
263236

264-
- name: Build example Telink Window Covering App
237+
- name: Build example Telink (B91) Window Covering App
265238
run: |
266239
./scripts/run_in_build_env.sh \
267240
"./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-window-covering' build"

config/telink/app/bootloader.conf

+19-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
# Enable this option in case if restoring the slot0 partition is expected from slot1
1818
# partition in case if slot0 is not bootable or damaged
19-
CONFIG_BOOT_BOOTSTRAP=n
19+
CONFIG_BOOT_BOOTSTRAP=y
2020

2121
# Enable this option in case if SWAP_MOVE logic need to be used
2222
CONFIG_BOOT_SWAP_USING_MOVE=y
@@ -28,3 +28,21 @@ CONFIG_BOOT_SWAP_USING_SCRATCH=n
2828
# Enable this option in case if the whole slot0 image need to be validated
2929
# With disabled option the only image magic is validated
3030
CONFIG_BOOT_VALIDATE_SLOT0=y
31+
32+
# Maximum number of image sectors supported by the bootloader.
33+
CONFIG_BOOT_MAX_IMG_SECTORS=4096
34+
35+
# Sets log level for modules which don't specify it explicitly.
36+
# When set to 0 it means log will not be activated for those modules.
37+
# Levels are:
38+
# - 0 OFF, do not write by default
39+
# - 1 ERROR, default to only write LOG_LEVEL_ERR
40+
# - 2 WARNING, default to write LOG_LEVEL_WRN
41+
# - 3 INFO, default to write LOG_LEVEL_INFO
42+
# - 4 DEBUG, default to write LOG_LEVEL_DBG
43+
CONFIG_LOG_DEFAULT_LEVEL=1
44+
45+
# USB DFU configuration
46+
CONFIG_USB_DFU_WILL_DETACH=n
47+
CONFIG_BOOT_USB_DFU_GPIO=y
48+
CONFIG_MCUBOOT_INDICATION_LED=y

config/telink/app/zephyr.conf

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2021 Project CHIP Authors
2+
# Copyright (c) 2021-2023 Project CHIP Authors
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -111,22 +111,22 @@ CONFIG_OPENTHREAD_EXTERNAL_HEAP=y
111111
# Config dynamic interrupts to have posibility to switch between BLE/Thread radio drivers
112112
CONFIG_DYNAMIC_INTERRUPTS=y
113113

114-
# Set multiplicator of Name Value Storage (NVS) as 16 to reach NVS sector size 4096
115-
# nvs_sector_size = flash_page_size * mult = 256 * 16 = 4096
116-
CONFIG_SETTINGS_NVS_SECTOR_SIZE_MULT=16
114+
# Set multiplicator of Name Value Storage (NVS) as 1 to reach NVS sector size 4KB
115+
# nvs_sector_size = flash_page_size * mult = 4KB * 1 = 4KB
116+
CONFIG_SETTINGS_NVS_SECTOR_SIZE_MULT=1
117117

118118
# Enable NVS lookup cache
119119
CONFIG_NVS_LOOKUP_CACHE=y
120120
CONFIG_NVS_LOOKUP_CACHE_SIZE=2048
121121

122122
# Reboot system when fault happened
123-
CONFIG_TELINK_B91_REBOOT_ON_FAULT=y
123+
CONFIG_TELINK_B9X_REBOOT_ON_FAULT=y
124124

125125
# Shell settings
126126
CONFIG_SHELL=n
127127

128128
# BLE MAC address
129-
CONFIG_B91_BLE_CTRL_MAC_FLASH_ADDR=0x1FE000
129+
CONFIG_B9X_BLE_CTRL_MAC_FLASH_ADDR=0x1FE000
130130

131131
# getopt version
132132
CONFIG_GETOPT_LONG=y

config/telink/chip-module/CMakeLists.txt

+14-3
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,17 @@ set_property(GLOBAL APPEND PROPERTY ZEPHYR_INTERFACE_LIBS chip)
137137
# Define 'chip-ota-image' target for building CHIP OTA image
138138
# ==============================================================================
139139

140+
141+
if(${TLNK_USB_DONGLE} MATCHES y)
142+
if(EXISTS "${CHIP_ROOT}/src/platform/telink/${BOARD}_usb_boot.overlay")
143+
set(USB_BOOT_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${BOARD}_usb_boot.overlay")
144+
else()
145+
unset(USB_BOOT_DTC_OVERLAY_FILE)
146+
endif()
147+
else()
148+
unset(USB_BOOT_DTC_OVERLAY_FILE)
149+
endif()
150+
140151
if(EXISTS "${CHIP_ROOT}/src/platform/telink/${BOARD}.overlay")
141152
set(GLOBAL_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${BOARD}.overlay")
142153
else()
@@ -153,14 +164,14 @@ if (CONFIG_CHIP_OTA_IMAGE_BUILD)
153164
add_custom_target(build_mcuboot ALL
154165
COMMAND
155166
west build -b ${BOARD} -d build_mcuboot ${ZEPHYR_BASE}/../bootloader/mcuboot/boot/zephyr
156-
-- -DOVERLAY_CONFIG=${GLOBAL_BOOTLOADER_CONF_OVERLAY_FILE} -DDTC_OVERLAY_FILE=${GLOBAL_DTC_OVERLAY_FILE}
167+
-- -DOVERLAY_CONFIG=${GLOBAL_BOOTLOADER_CONF_OVERLAY_FILE} -DDTC_OVERLAY_FILE="${GLOBAL_DTC_OVERLAY_FILE};${USB_BOOT_DTC_OVERLAY_FILE}"
157168
)
158169

159170
add_custom_target(merge_mcuboot ALL
160171
COMMAND
161172
dd if=${PROJECT_BINARY_DIR}/../modules/chip-module/build_mcuboot/zephyr/zephyr.bin of=${PROJECT_BINARY_DIR}/zephyr.bin
162173
COMMAND
163-
dd if=${PROJECT_BINARY_DIR}/zephyr.signed.bin of=${PROJECT_BINARY_DIR}/zephyr.bin bs=1024 seek=76
174+
dd if=${PROJECT_BINARY_DIR}/zephyr.signed.bin of=${PROJECT_BINARY_DIR}/zephyr.bin bs=1024 seek=100
164175
)
165176

166177
chip_ota_image(chip-ota-image
@@ -175,7 +186,7 @@ endif()
175186
if (CONFIG_CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE)
176187
add_custom_target(merge_factory_data ALL
177188
COMMAND
178-
dd if=${PROJECT_BINARY_DIR}/factory/factory_data.bin of=${PROJECT_BINARY_DIR}/zephyr.bin bs=1024 seek=1040
189+
dd if=${PROJECT_BINARY_DIR}/factory/factory_data.bin of=${PROJECT_BINARY_DIR}/zephyr.bin bs=1024 seek=1052
179190
)
180191
if (CONFIG_CHIP_OTA_IMAGE_BUILD)
181192
add_dependencies(merge_factory_data merge_mcuboot)

examples/all-clusters-app/telink/CMakeLists.txt

-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
#
1616
cmake_minimum_required(VERSION 3.13.1)
1717

18-
set(BOARD tlsr9518adk80d)
19-
2018
get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH)
2119
get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH)
2220
get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH)

0 commit comments

Comments
 (0)