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

Develop dual fix dual mode #353

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions .github/workflows/chef.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ jobs:
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 8b29ee6b118ebe6eeec3224dbe343474e11403d8"
- 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 d11c4e0b8c816b4d15b13c6736ec49b9a99618de"
- name: CI Examples Telink
shell: bash
run: |
Expand Down
237 changes: 7 additions & 230 deletions .github/workflows/examples-telink.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,77 +57,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 8b29ee6b118ebe6eeec3224dbe343474e11403d8"

- name: Build example Telink (B92 retention) Air Quality Sensor 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'
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --target 'telink-tlsr9528a_retention-air-quality-sensor' build"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
telink tlsr9528a_retention air-quality-sensor-app \
out/telink-tlsr9528a_retention-air-quality-sensor/zephyr/zephyr.elf \
/tmp/bloat_reports/

- name: clean out build output
run: rm -rf ./out

- 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"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
telink tlsr9118bdk40d all-clusters-app \
out/telink-tlsr9118bdk40d-all-clusters/zephyr/zephyr.elf \
/tmp/bloat_reports/

- name: clean out build output
run: rm -rf ./out

- name: Build example Telink (B92) All Clusters Minimal 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'
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --target 'telink-tlsr9528a-all-clusters-minimal' build"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
telink tlsr9528a all-clusters-minimal-app \
out/telink-tlsr9528a-all-clusters-minimal/zephyr/zephyr.elf \
/tmp/bloat_reports/

- name: clean out build output
run: rm -rf ./out

- name: Build example Telink (B95) Bridge App
# Run test for master and all PRs
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --target 'telink-tlsr9258a-bridge' build"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
telink tlsr9258a bridge-app \
out/telink-tlsr9258a-bridge/zephyr/zephyr.elf \
/tmp/bloat_reports/

- name: clean out build output
run: rm -rf ./out

- name: Build example Telink (B92 retention) Contact Sensor App
# Run test for master and all PRs
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --target 'telink-tlsr9528a_retention-contact-sensor' build"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
telink tlsr9528a_retention contact-sensor-app \
out/telink-tlsr9528a_retention-contact-sensor/zephyr/zephyr.elf \
/tmp/bloat_reports/

- name: clean out build output
run: rm -rf ./out
- name: Update Zephyr to specific revision (for developers purpose)
run: scripts/run_in_build_env.sh "python3 scripts/tools/telink/update_zephyr.py d11c4e0b8c816b4d15b13c6736ec49b9a99618de"

- name: Build tools required for Factory Data
# Run test for master and all PRs
Expand All @@ -140,33 +71,6 @@ jobs:
- name: clean out build output (keep tools)
run: rm -rf ./out/telink*

- 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"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
telink tlsr9118bdk40d lighting-app-ota-factory-data \
out/telink-tlsr9118bdk40d-light-ota-factory-data/zephyr/zephyr.elf \
/tmp/bloat_reports/

- 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
# Run test for master and all PRs
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-light-ota-rpc-factory-data-4mb' build"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
telink tlsr9518adk80d lighting-app-ota-rpc-factory-data-4mb \
out/telink-tlsr9518adk80d-light-ota-rpc-factory-data-4mb/zephyr/zephyr.elf \
/tmp/bloat_reports/

- 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
# Run test for master and all PRs
run: |
Expand All @@ -180,144 +84,17 @@ jobs:
- 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 (B92) 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-tlsr9528a-light-switch-ota-compress-lzma-shell-factory-data' build"
"./scripts/build/build_examples.py --target 'telink-tlsr9528a-light-ota-4mb-shell-factory-data' 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-app-ota-4mb-shell-factory-data \
out/telink-tlsr9528a-light-ota-4mb-shell-factory-data/zephyr/zephyr.elf \
/tmp/bloat_reports/

- name: clean out build output
run: rm -rf ./out

- name: Build example Telink (B92) Lock App with DFU
# 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-tlsr9528a-lock-dfu' build"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
telink tlsr9528a lock-app-dfu \
out/telink-tlsr9528a-lock-dfu/zephyr/zephyr.elf \
/tmp/bloat_reports/

- name: clean out build output
run: rm -rf ./out

- name: Build example Telink (B95) OTA Requestor 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'
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --target 'telink-tlsr9258a-ota-requestor' build"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
telink tlsr9258a ota-requestor-app \
out/telink-tlsr9258a-ota-requestor/zephyr/zephyr.elf \
/tmp/bloat_reports/

- name: clean out build output
run: rm -rf ./out

- name: Build example Telink (B91 USB) Pump 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'
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-pump-usb' build"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
telink tlsr9518adk80d pump-app-usb \
out/telink-tlsr9518adk80d-pump-usb/zephyr/zephyr.elf \
/tmp/bloat_reports/

- name: clean out build output
run: rm -rf ./out

- name: Build example Telink (B91) Pump Controller 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'
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-pump-controller' build"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
telink tlsr9518adk80d pump-controller-app \
out/telink-tlsr9518adk80d-pump-controller/zephyr/zephyr.elf \
/tmp/bloat_reports/

- name: clean out build output
run: rm -rf ./out

- name: Build example Telink (B91) Shell 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'
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-shell' build"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
telink tlsr9518adk80d shell \
out/telink-tlsr9518adk80d-shell/zephyr/zephyr.elf \
/tmp/bloat_reports/

- name: clean out build output
run: rm -rf ./out

- name: Build example Telink (B92 retention) Smoke CO Alarm 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'
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --target 'telink-tlsr9528a_retention-smoke-co-alarm' build"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
telink tlsr9528a_retention smoke_co_alarm-app \
out/telink-tlsr9528a_retention-smoke-co-alarm/zephyr/zephyr.elf \
/tmp/bloat_reports/

- name: clean out build output
run: rm -rf ./out

- name: Build example Telink (B91 Mars) Temperature Measurement App with OTA
# 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-tlsr9518adk80d-temperature-measurement-mars-ota' build"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
telink tlsr9518adk80d temperature-measurement-app-mars-ota \
out/telink-tlsr9518adk80d-temperature-measurement-mars-ota/zephyr/zephyr.elf \
/tmp/bloat_reports/

- name: clean out build output
run: rm -rf ./out

- name: Build example Telink (B91) Thermostat 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'
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-thermostat' build"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
telink tlsr9518adk80d thermostat \
out/telink-tlsr9518adk80d-thermostat/zephyr/zephyr.elf \
/tmp/bloat_reports/

- name: clean out build output
run: rm -rf ./out

- 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"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
telink tlsr9118bdk40d window-covering \
out/telink-tlsr9118bdk40d-window-covering/zephyr/zephyr.elf \
/tmp/bloat_reports/

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

- name: Uploading Size Reports
Expand Down
6 changes: 3 additions & 3 deletions config/telink/app/bootloader.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
# limitations under the License.
#

# Enable this option in case if restoring the slot0 partition is expected from slot1
# Enable this option in case if restoring the slot0 partition is expected from slot1
# partition in case if slot0 is not bootable or damaged
CONFIG_BOOT_BOOTSTRAP=y
CONFIG_BOOT_BOOTSTRAP=n

# Enable this option in case if SWAP_MOVE logic need to be used
CONFIG_BOOT_SWAP_USING_MOVE=y
Expand All @@ -27,7 +27,7 @@ CONFIG_BOOT_SWAP_USING_SCRATCH=n

# Enable this option in case if the whole slot0 image need to be validated
# With disabled option the only image magic is validated
CONFIG_BOOT_VALIDATE_SLOT0=y
CONFIG_BOOT_VALIDATE_SLOT0=n

# Maximum number of image sectors supported by the bootloader.
# Maximum signed image size: 512 * 4096 = 2M Bytes
Expand Down
5 changes: 5 additions & 0 deletions config/telink/chip-module/Kconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,11 @@ config NVS_LOOKUP_CACHE_SIZE
default 400 if SOC_RISCV_TELINK_TL321X
default 2048 if !PM

config COMPRESS_LZMA
depends on CHIP_OTA_REQUESTOR
default y if SOC_RISCV_TELINK_TL321X
default n

# Set multiplicator of Name Value Storage (NVS) as 1 to reach NVS sector size 4KB
# nvs_sector_size = flash_page_size * mult = 4KB * 1 = 4KB
config SETTINGS_NVS_SECTOR_SIZE_MULT
Expand Down
2 changes: 1 addition & 1 deletion examples/chef/chef.py
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ def main() -> int:
shell.run_cmd("make is")
elif options.build_target == "telink":
shell.run_cmd(f"cd {_CHEF_SCRIPT_PATH}/telink")
telink_build_cmds = ["west build -b tlsr9518adk80d"]
telink_build_cmds = ["west build -b tl3218x"]
if options.do_clean:
telink_build_cmds.append("-p always")
if options.do_rpc:
Expand Down
8 changes: 8 additions & 0 deletions examples/lighting-app/telink/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ CHIP_ERROR AppTask::Init(void)
SetExampleButtonCallbacks(LightingActionEventHandler);
InitCommonParts();

if(sBoot_zb){
/* Switch from the touch link, need to restore previous values */
sfixture_on = user_para.onoff;
sBrightness = user_para.lightness;
sAppTask.UpdateClusterState();
printk("Matter: Updated ZB On/Off state and brightness.\n");
}

Protocols::InteractionModel::Status status;

app::DataModel::Nullable<uint8_t> brightness;
Expand Down
26 changes: 26 additions & 0 deletions examples/platform/telink/common/include/AppTaskCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,31 @@

#include <credentials/examples/DeviceAttestationCredsExample.h>

#include <zephyr/device.h>
#include <zephyr/drivers/flash.h>
#include <zephyr/storage/flash_map.h>
#include <zephyr/sys/reboot.h>

#define USER_INIT_VAL 0xff
#define USER_ZB_SW_VAL 0xaa
#define USER_MATTER_PAIR_VAL 0x55
#define USER_PARA_MAC_OFFSET 0x100
#define USER_PARTITION user_para_partition
#define USER_PARTITION_DEVICE FIXED_PARTITION_DEVICE(USER_PARTITION)
#define USER_PARTITION_OFFSET FIXED_PARTITION_OFFSET(USER_PARTITION)
#define USER_PARTITION_SIZE FIXED_PARTITION_SIZE(USER_PARTITION)

typedef struct{
uint8_t val ;
uint8_t rfu;
uint8_t onoff;
uint8_t lightness;
}user_para_t;

extern user_para_t user_para;
extern uint8_t para_lightness;
extern uint8_t sBoot_zb;

#include <cstdint>

using namespace ::chip;
Expand Down Expand Up @@ -97,6 +122,7 @@ class AppTaskCommon
virtual void LinkButtons(ButtonManager & buttonManager);

static void FactoryResetTimerTimeoutCallback(k_timer * timer);
static void DnssTimerTimeoutCallback(k_timer * timer);
static void FactoryResetTimerEventHandler(AppEvent * aEvent);
static void FactoryResetButtonEventHandler(void);
static void FactoryResetHandler(AppEvent * aEvent);
Expand Down
Loading
Loading