From 353f4dfc17427557b2fb0a96b1d34c6fad6c59ab Mon Sep 17 00:00:00 2001 From: Dmytro Huz <75682372+interfer@users.noreply.github.com> Date: Tue, 1 Oct 2024 23:26:06 +0300 Subject: [PATCH] [Telink] Add w91 dual core OTA, board versions & Update builds to docker version 81 (#35778) * [Telink] Added W91 v2.1 board configuration * [Telink] removed config for crypto HW acceleration alternatives options removed from config CONFIG_TELINK_B9X_MBEDTLS_HW_ACCELERATION MBEDTLS_AES_ALT MBEDTLS_ECP_ALT * [Telink] fixed status-led for Lighting app related to PWM pull: [Telink] Lighting app build with disabled CONFIG_PWM #35621 * [Telink] removed v2 definition for W91 Only left board and board_v1 * [Telink] minor review fixes * [Telink] Remove all partitions instead of one by one * [Telink] Change N22 Image offset & size * [Telink] OTA multi image in single slot * [Telink] use corect key * [Telink] Update test revision and add W91 continue-on-error * [Telink] First verision of python script for process binaries * [Telink] update readme files * [Telink] Improve process binaries script * [Telink] Use merged.bin always * [Telink] Update Zephyr rev for build test * [Telink] Fix code-lints & Spelling errors * [Telink] Update Zephyr rev for build test * [Telink] set correct order for set env * [Telink] Clean up merged.bin from previuse build * [Telink] Fix CI build * [Telink] Update Zephyr rev for build test * Restyled by autopep8 * [Telink] Add debug prints to check fill gap issue * [Telink] Fix issue with enabled Factory Data only * Restyled by autopep8 * [Telink] Update builds to docker version 81 * [Telink] disable debug part * [Telink] Update NXP to docker version 81 * merge conflict resolve issue fix --------- Co-authored-by: Alex Tsitsiura Co-authored-by: Restyled.io --- .github/workflows/bloat_check.yaml | 2 +- .github/workflows/build.yaml | 10 +- .github/workflows/chef.yaml | 10 +- .github/workflows/doxygen.yaml | 2 +- .github/workflows/examples-ameba.yaml | 2 +- .github/workflows/examples-asr.yaml | 2 +- .github/workflows/examples-bouffalolab.yaml | 2 +- .github/workflows/examples-cc13xx_26xx.yaml | 2 +- .github/workflows/examples-cc32xx.yaml | 2 +- .github/workflows/examples-efr32.yaml | 2 +- .github/workflows/examples-esp32.yaml | 4 +- .github/workflows/examples-infineon.yaml | 2 +- .github/workflows/examples-linux-arm.yaml | 2 +- .github/workflows/examples-linux-imx.yaml | 2 +- .../workflows/examples-linux-standalone.yaml | 2 +- .../examples-linux-tv-casting-app.yaml | 2 +- .github/workflows/examples-mw320.yaml | 2 +- .github/workflows/examples-nrfconnect.yaml | 2 +- .github/workflows/examples-nuttx.yaml | 2 +- .github/workflows/examples-nxp.yaml | 8 +- .github/workflows/examples-openiotsdk.yaml | 2 +- .github/workflows/examples-qpg.yaml | 2 +- .github/workflows/examples-stm32.yaml | 2 +- .github/workflows/examples-telink.yaml | 7 +- .github/workflows/examples-tizen.yaml | 2 +- .github/workflows/full-android.yaml | 2 +- .github/workflows/fuzzing-build.yaml | 2 +- .github/workflows/java-tests.yaml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/minimal-build.yaml | 4 +- .github/workflows/qemu.yaml | 4 +- .github/workflows/release_artifacts.yaml | 4 +- .github/workflows/smoketest-android.yaml | 2 +- .github/workflows/tests.yaml | 4 +- .github/workflows/unit_integration_test.yaml | 2 +- .github/workflows/zap_regeneration.yaml | 2 +- .github/workflows/zap_templates.yaml | 2 +- config/telink/chip-module/CMakeLists.txt | 85 ++++---------- config/telink/chip-module/Kconfig | 11 +- config/telink/chip-module/Kconfig.defaults | 9 +- .../air-quality-sensor-app/telink/README.md | 8 +- examples/all-clusters-app/ameba/README.md | 4 +- examples/all-clusters-app/telink/README.md | 8 +- .../all-clusters-minimal-app/ameba/README.md | 4 +- .../all-clusters-minimal-app/telink/README.md | 8 +- examples/bridge-app/telink/README.md | 8 +- examples/contact-sensor-app/telink/README.md | 8 +- examples/light-switch-app/ameba/README.md | 4 +- examples/light-switch-app/telink/README.md | 8 +- examples/lighting-app/ameba/README.md | 4 +- examples/lighting-app/telink/README.md | 8 +- examples/lighting-app/telink/src/AppTask.cpp | 10 +- examples/lock-app/telink/README.md | 8 +- examples/ota-requestor-app/ameba/README.md | 4 +- examples/ota-requestor-app/telink/README.md | 8 +- examples/pigweed-app/ameba/README.md | 4 +- examples/platform/telink/common.cmake | 12 +- .../telink/common/src/AppTaskCommon.cpp | 2 +- examples/pump-app/telink/README.md | 8 +- examples/pump-controller-app/telink/README.md | 8 +- examples/smoke-co-alarm-app/telink/README.md | 8 +- .../telink/README.md | 8 +- examples/thermostat/telink/README.md | 8 +- examples/window-app/telink/README.md | 8 +- integrations/cloudbuild/chef.yaml | 8 +- integrations/cloudbuild/smoke-test.yaml | 14 +-- scripts/tools/telink/process_binaries.py | 110 ++++++++++++++++++ src/platform/telink/telink-mbedtls-config.h | 7 +- src/platform/telink/tlsr9118bdk40d.overlay | 39 ------- .../telink/tlsr9118bdk40d_3m_flash.overlay | 36 ------ .../telink/tlsr9118bdk40d_4m_flash.overlay | 39 +++++++ .../telink/tlsr9258a_2m_flash.overlay | 11 +- .../telink/tlsr9518adk80d_1m_flash.overlay | 11 +- .../telink/tlsr9518adk80d_2m_flash.overlay | 11 +- .../telink/tlsr9518adk80d_4m_flash.overlay | 11 +- .../telink/tlsr9528a_2m_flash.overlay | 11 +- .../telink/tlsr9528a_4m_flash.overlay | 21 ++-- 77 files changed, 380 insertions(+), 333 deletions(-) create mode 100755 scripts/tools/telink/process_binaries.py delete mode 100644 src/platform/telink/tlsr9118bdk40d.overlay delete mode 100644 src/platform/telink/tlsr9118bdk40d_3m_flash.overlay create mode 100644 src/platform/telink/tlsr9118bdk40d_4m_flash.overlay diff --git a/.github/workflows/bloat_check.yaml b/.github/workflows/bloat_check.yaml index 31630e10574c41..7ec2a6bf692011 100644 --- a/.github/workflows/bloat_check.yaml +++ b/.github/workflows/bloat_check.yaml @@ -34,7 +34,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build:80 + image: ghcr.io/project-chip/chip-build:81 steps: - name: Checkout diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d54f4e13b2bbb4..490d7e79d741d0 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -42,7 +42,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:80 + image: ghcr.io/project-chip/chip-build:81 volumes: - "/:/runner-root-volume" - "/tmp/log_output:/tmp/test_logs" @@ -138,7 +138,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:80 + image: ghcr.io/project-chip/chip-build:81 volumes: - "/:/runner-root-volume" - "/tmp/log_output:/tmp/test_logs" @@ -283,7 +283,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:80 + image: ghcr.io/project-chip/chip-build:81 volumes: - "/:/runner-root-volume" - "/tmp/log_output:/tmp/test_logs" @@ -346,7 +346,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:80 + image: ghcr.io/project-chip/chip-build:81 volumes: - "/:/runner-root-volume" - "/tmp/log_output:/tmp/test_logs" @@ -457,7 +457,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:80 + image: ghcr.io/project-chip/chip-build:81 volumes: - "/:/runner-root-volume" - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/chef.yaml b/.github/workflows/chef.yaml index 218ba5e5694653..ca3f42e47c24e5 100644 --- a/.github/workflows/chef.yaml +++ b/.github/workflows/chef.yaml @@ -35,7 +35,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:80 + image: ghcr.io/project-chip/chip-build:81 options: --user root steps: @@ -56,7 +56,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-esp32:80 + image: ghcr.io/project-chip/chip-build-esp32:81 options: --user root steps: @@ -77,7 +77,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-nrf-platform:80 + image: ghcr.io/project-chip/chip-build-nrf-platform:81 options: --user root steps: @@ -98,7 +98,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-telink:80 + image: ghcr.io/project-chip/chip-build-telink:81 options: --user root steps: @@ -110,7 +110,7 @@ jobs: 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 ab81a585fca6a83b30e1f4e58a021113d6a3acb8" + # run: scripts/run_in_build_env.sh "python3 scripts/tools/telink/update_zephyr.py 3ed7686a9378de6be1368c912f9a42f998bbfb18" - name: CI Examples Telink shell: bash run: | diff --git a/.github/workflows/doxygen.yaml b/.github/workflows/doxygen.yaml index 25e909af36bdce..e255ddce53977f 100644 --- a/.github/workflows/doxygen.yaml +++ b/.github/workflows/doxygen.yaml @@ -81,7 +81,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build-doxygen:80 + image: ghcr.io/project-chip/chip-build-doxygen:81 if: github.actor != 'restyled-io[bot]' diff --git a/.github/workflows/examples-ameba.yaml b/.github/workflows/examples-ameba.yaml index 863c1c7d0f999d..c2bb69cd6f2b4e 100644 --- a/.github/workflows/examples-ameba.yaml +++ b/.github/workflows/examples-ameba.yaml @@ -38,7 +38,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-ameba:80 + image: ghcr.io/project-chip/chip-build-ameba:81 options: --user root steps: diff --git a/.github/workflows/examples-asr.yaml b/.github/workflows/examples-asr.yaml index 89d4ad6cfef436..531709a3024844 100644 --- a/.github/workflows/examples-asr.yaml +++ b/.github/workflows/examples-asr.yaml @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-asr:80 + image: ghcr.io/project-chip/chip-build-asr:81 options: --user root steps: diff --git a/.github/workflows/examples-bouffalolab.yaml b/.github/workflows/examples-bouffalolab.yaml index 2c17e2b7c987b8..e49450f965a4e8 100644 --- a/.github/workflows/examples-bouffalolab.yaml +++ b/.github/workflows/examples-bouffalolab.yaml @@ -37,7 +37,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-bouffalolab:80 + image: ghcr.io/project-chip/chip-build-bouffalolab:81 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-cc13xx_26xx.yaml b/.github/workflows/examples-cc13xx_26xx.yaml index d6e767be81c701..80184cb4b438cf 100644 --- a/.github/workflows/examples-cc13xx_26xx.yaml +++ b/.github/workflows/examples-cc13xx_26xx.yaml @@ -41,7 +41,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-ti:80 + image: ghcr.io/project-chip/chip-build-ti:81 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-cc32xx.yaml b/.github/workflows/examples-cc32xx.yaml index f72ef85e440db8..537621bcf34b9d 100644 --- a/.github/workflows/examples-cc32xx.yaml +++ b/.github/workflows/examples-cc32xx.yaml @@ -40,7 +40,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-ti:80 + image: ghcr.io/project-chip/chip-build-ti:81 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml index 4dc32dfd991aff..75e492911022f9 100644 --- a/.github/workflows/examples-efr32.yaml +++ b/.github/workflows/examples-efr32.yaml @@ -40,7 +40,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-efr32:80 + image: ghcr.io/project-chip/chip-build-efr32:81 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-esp32.yaml b/.github/workflows/examples-esp32.yaml index 933f167ca56846..dc1446a93fb833 100644 --- a/.github/workflows/examples-esp32.yaml +++ b/.github/workflows/examples-esp32.yaml @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-esp32:80 + image: ghcr.io/project-chip/chip-build-esp32:81 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" @@ -126,7 +126,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-esp32:80 + image: ghcr.io/project-chip/chip-build-esp32:81 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-infineon.yaml b/.github/workflows/examples-infineon.yaml index 19c5981a452aba..9a3b4191c036a5 100644 --- a/.github/workflows/examples-infineon.yaml +++ b/.github/workflows/examples-infineon.yaml @@ -37,7 +37,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-infineon:80 + image: ghcr.io/project-chip/chip-build-infineon:81 env: # TODO: this should probably be part of the dockerfile itself CY_TOOLS_PATHS: /opt/Tools/ModusToolbox/tools_3.2 diff --git a/.github/workflows/examples-linux-arm.yaml b/.github/workflows/examples-linux-arm.yaml index 113dac70d1a195..f93e295011bd02 100644 --- a/.github/workflows/examples-linux-arm.yaml +++ b/.github/workflows/examples-linux-arm.yaml @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-crosscompile:80 + image: ghcr.io/project-chip/chip-build-crosscompile:81 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-linux-imx.yaml b/.github/workflows/examples-linux-imx.yaml index 832a4f3fd50f2b..f964f07f1e0918 100644 --- a/.github/workflows/examples-linux-imx.yaml +++ b/.github/workflows/examples-linux-imx.yaml @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-imx:80 + image: ghcr.io/project-chip/chip-build-imx:81 steps: - name: Checkout diff --git a/.github/workflows/examples-linux-standalone.yaml b/.github/workflows/examples-linux-standalone.yaml index dfa15c4c6da8b7..ff3762c2118d4c 100644 --- a/.github/workflows/examples-linux-standalone.yaml +++ b/.github/workflows/examples-linux-standalone.yaml @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:80 + image: ghcr.io/project-chip/chip-build:81 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-linux-tv-casting-app.yaml b/.github/workflows/examples-linux-tv-casting-app.yaml index 3a0b5cdaa31709..64000e45f45b48 100644 --- a/.github/workflows/examples-linux-tv-casting-app.yaml +++ b/.github/workflows/examples-linux-tv-casting-app.yaml @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:80 + image: ghcr.io/project-chip/chip-build:81 steps: - name: Checkout diff --git a/.github/workflows/examples-mw320.yaml b/.github/workflows/examples-mw320.yaml index b40aba28f2f9e7..45daa41dcef2d3 100644 --- a/.github/workflows/examples-mw320.yaml +++ b/.github/workflows/examples-mw320.yaml @@ -39,7 +39,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:80 + image: ghcr.io/project-chip/chip-build:81 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-nrfconnect.yaml b/.github/workflows/examples-nrfconnect.yaml index f717a7b4f7f84c..19fdeca62dc1a8 100644 --- a/.github/workflows/examples-nrfconnect.yaml +++ b/.github/workflows/examples-nrfconnect.yaml @@ -39,7 +39,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-nrf-platform:80 + image: ghcr.io/project-chip/chip-build-nrf-platform:81 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-nuttx.yaml b/.github/workflows/examples-nuttx.yaml index 9cd4c7fe35977c..6006cea181d98c 100644 --- a/.github/workflows/examples-nuttx.yaml +++ b/.github/workflows/examples-nuttx.yaml @@ -35,7 +35,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-nuttx:80 + image: ghcr.io/project-chip/chip-build-nuttx:81 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-nxp.yaml b/.github/workflows/examples-nxp.yaml index 13023b6bb06d42..c03b9a118c39fd 100644 --- a/.github/workflows/examples-nxp.yaml +++ b/.github/workflows/examples-nxp.yaml @@ -96,7 +96,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-nxp:80 + image: ghcr.io/project-chip/chip-build-nxp:81 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: @@ -157,7 +157,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-nxp:80 + image: ghcr.io/project-chip/chip-build-nxp:81 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: @@ -218,7 +218,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-nxp:80 + image: ghcr.io/project-chip/chip-build-nxp:81 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: @@ -279,7 +279,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-nxp-zephyr:80 + image: ghcr.io/project-chip/chip-build-nxp-zephyr:81 steps: - name: Checkout diff --git a/.github/workflows/examples-openiotsdk.yaml b/.github/workflows/examples-openiotsdk.yaml index 15897d7cefc654..95389cb157f5ee 100644 --- a/.github/workflows/examples-openiotsdk.yaml +++ b/.github/workflows/examples-openiotsdk.yaml @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-openiotsdk:80 + image: ghcr.io/project-chip/chip-build-openiotsdk:81 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" options: --privileged diff --git a/.github/workflows/examples-qpg.yaml b/.github/workflows/examples-qpg.yaml index e326019606a6b3..e0cf4c6ecf8a4b 100644 --- a/.github/workflows/examples-qpg.yaml +++ b/.github/workflows/examples-qpg.yaml @@ -39,7 +39,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:80 + image: ghcr.io/project-chip/chip-build:81 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-stm32.yaml b/.github/workflows/examples-stm32.yaml index 361e82b9308fa5..c0bc9af19a95bd 100644 --- a/.github/workflows/examples-stm32.yaml +++ b/.github/workflows/examples-stm32.yaml @@ -40,7 +40,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:80 + image: ghcr.io/project-chip/chip-build:81 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-telink.yaml b/.github/workflows/examples-telink.yaml index 7fb14e8b6b28d8..757f11254b530a 100644 --- a/.github/workflows/examples-telink.yaml +++ b/.github/workflows/examples-telink.yaml @@ -38,7 +38,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-telink:80 + image: ghcr.io/project-chip/chip-build-telink:81 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" @@ -57,7 +57,7 @@ jobs: 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 ab81a585fca6a83b30e1f4e58a021113d6a3acb8" + # run: scripts/run_in_build_env.sh "python3 scripts/tools/telink/update_zephyr.py 3ed7686a9378de6be1368c912f9a42f998bbfb18" - name: Build example Telink (B92 retention) Air Quality Sensor App run: | @@ -72,6 +72,7 @@ jobs: run: rm -rf ./out - name: Build example Telink (W91) All Clusters App + continue-on-error: true run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target 'telink-tlsr9118bdk40d-all-clusters' build" @@ -130,6 +131,7 @@ jobs: run: rm -rf ./out/telink* - name: Build example Telink (W91) Lighting App with OTA, Factory Data + continue-on-error: true run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target 'telink-tlsr9118bdk40d-light-ota-factory-data' build" @@ -262,6 +264,7 @@ jobs: run: rm -rf ./out - name: Build example Telink (W91) Window Covering App + continue-on-error: true run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target 'telink-tlsr9118bdk40d-window-covering' build" diff --git a/.github/workflows/examples-tizen.yaml b/.github/workflows/examples-tizen.yaml index 4c59fb5a02c805..8c6024ee1f57d9 100644 --- a/.github/workflows/examples-tizen.yaml +++ b/.github/workflows/examples-tizen.yaml @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-tizen:80 + image: ghcr.io/project-chip/chip-build-tizen:81 options: --user root volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/full-android.yaml b/.github/workflows/full-android.yaml index b30ad7b1e53bba..54561c68e28144 100644 --- a/.github/workflows/full-android.yaml +++ b/.github/workflows/full-android.yaml @@ -38,7 +38,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-android:80 + image: ghcr.io/project-chip/chip-build-android:81 volumes: - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/fuzzing-build.yaml b/.github/workflows/fuzzing-build.yaml index 58174f96888ac0..c37ca98e1a513e 100644 --- a/.github/workflows/fuzzing-build.yaml +++ b/.github/workflows/fuzzing-build.yaml @@ -33,7 +33,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:80 + image: ghcr.io/project-chip/chip-build:81 volumes: - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/java-tests.yaml b/.github/workflows/java-tests.yaml index 8c1f85367c13f5..cc6dbc90606446 100644 --- a/.github/workflows/java-tests.yaml +++ b/.github/workflows/java-tests.yaml @@ -42,7 +42,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build-java:80 + image: ghcr.io/project-chip/chip-build-java:81 options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=0 net.ipv6.conf.all.forwarding=0" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b16919eedc14a9..ddcfed3607af90 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -35,7 +35,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:80 + image: ghcr.io/project-chip/chip-build:81 steps: - name: Checkout diff --git a/.github/workflows/minimal-build.yaml b/.github/workflows/minimal-build.yaml index bf240521e06ca4..5e364f32d671d9 100644 --- a/.github/workflows/minimal-build.yaml +++ b/.github/workflows/minimal-build.yaml @@ -33,7 +33,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build-minimal:80 + image: ghcr.io/project-chip/chip-build-minimal:81 steps: - name: Checkout @@ -55,7 +55,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build-minimal:80 + image: ghcr.io/project-chip/chip-build-minimal:81 steps: - name: Checkout diff --git a/.github/workflows/qemu.yaml b/.github/workflows/qemu.yaml index 3b3aab6a2d15c7..f21903dd9fb542 100644 --- a/.github/workflows/qemu.yaml +++ b/.github/workflows/qemu.yaml @@ -40,7 +40,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-esp32-qemu:80 + image: ghcr.io/project-chip/chip-build-esp32-qemu:81 volumes: - "/tmp/log_output:/tmp/test_logs" @@ -78,7 +78,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-tizen-qemu:80 + image: ghcr.io/project-chip/chip-build-tizen-qemu:81 options: --user root volumes: - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/release_artifacts.yaml b/.github/workflows/release_artifacts.yaml index 9a9e5baac410b3..22cf6b335eaa12 100644 --- a/.github/workflows/release_artifacts.yaml +++ b/.github/workflows/release_artifacts.yaml @@ -32,7 +32,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build-esp32:80 + image: ghcr.io/project-chip/chip-build-esp32:81 steps: - name: Checkout @@ -64,7 +64,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build-efr32:80 + image: ghcr.io/project-chip/chip-build-efr32:81 steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/smoketest-android.yaml b/.github/workflows/smoketest-android.yaml index eb2e14f64848fa..7d0e124ca5656b 100644 --- a/.github/workflows/smoketest-android.yaml +++ b/.github/workflows/smoketest-android.yaml @@ -37,7 +37,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-android:80 + image: ghcr.io/project-chip/chip-build-android:81 volumes: - "/:/runner-root-volume" - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 9395f841a90c75..f10e569fb3b18b 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -49,7 +49,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build:80 + image: ghcr.io/project-chip/chip-build:81 options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1" @@ -451,7 +451,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build:80 + image: ghcr.io/project-chip/chip-build:81 options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=0 net.ipv6.conf.all.forwarding=0" diff --git a/.github/workflows/unit_integration_test.yaml b/.github/workflows/unit_integration_test.yaml index 87eb79e874a1ae..e593630fa58951 100644 --- a/.github/workflows/unit_integration_test.yaml +++ b/.github/workflows/unit_integration_test.yaml @@ -39,7 +39,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build:80 + image: ghcr.io/project-chip/chip-build:81 volumes: - "/:/runner-root-volume" - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/zap_regeneration.yaml b/.github/workflows/zap_regeneration.yaml index 72370f10592833..483b9486d1bdc6 100644 --- a/.github/workflows/zap_regeneration.yaml +++ b/.github/workflows/zap_regeneration.yaml @@ -30,7 +30,7 @@ jobs: runs-on: ubuntu-20.04 container: - image: ghcr.io/project-chip/chip-build:80 + image: ghcr.io/project-chip/chip-build:81 defaults: run: shell: sh diff --git a/.github/workflows/zap_templates.yaml b/.github/workflows/zap_templates.yaml index 017a41cb4f90fb..45a3611691a535 100644 --- a/.github/workflows/zap_templates.yaml +++ b/.github/workflows/zap_templates.yaml @@ -34,7 +34,7 @@ jobs: runs-on: ubuntu-20.04 container: - image: ghcr.io/project-chip/chip-build:80 + image: ghcr.io/project-chip/chip-build:81 defaults: run: shell: sh diff --git a/config/telink/chip-module/CMakeLists.txt b/config/telink/chip-module/CMakeLists.txt index d4c02aa5d621b8..bfc26ce5d96e56 100644 --- a/config/telink/chip-module/CMakeLists.txt +++ b/config/telink/chip-module/CMakeLists.txt @@ -152,6 +152,7 @@ matter_generate_args_tmp_file() # ============================================================================== # Build chip library # ============================================================================== + matter_build(chip LIB_SHELL ${CONFIG_CHIP_LIB_SHELL} DEVICE_INFO_EXAMPLE_PROVIDER ${CONFIG_CHIP_EXAMPLE_DEVICE_INFO_PROVIDER} @@ -159,60 +160,43 @@ matter_build(chip ) set_property(GLOBAL APPEND PROPERTY ZEPHYR_INTERFACE_LIBS chip) +include(${TELINK_COMMON}/common.cmake) + # ============================================================================== -# Define 'chip-ota-image' target for building CHIP OTA image +# Define 'process_binaries' target for collecting final binary to flash # ============================================================================== -include(${TELINK_COMMON}/common.cmake) - -set(BLOCK_SIZE "1024") +add_custom_target( + process_binaries ALL + COMMAND ${Python3_EXECUTABLE} ${CHIP_ROOT}/scripts/tools/telink/process_binaries.py + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} +) +add_dependencies(process_binaries ${ZEPHYR_FINAL_EXECUTABLE}) -if (CONFIG_BOOTLOADER_MCUBOOT) - dt_nodelabel(dts_partition_path NODELABEL "boot_partition") - dt_reg_size(mcuboot_size PATH ${dts_partition_path}) - math(EXPR boot_blocks "${mcuboot_size} / ${BLOCK_SIZE}" OUTPUT_FORMAT DECIMAL) +# ============================================================================== +# Define 'build_mcuboot' target for building the MCUBoot bootloader +# ============================================================================== +if (CONFIG_BOOTLOADER_MCUBOOT AND CONFIG_SOC_SERIES_RISCV_TELINK_B9X) add_custom_target(build_mcuboot ALL COMMAND west build -b ${BASE_BOARD} -d build_mcuboot ${ZEPHYR_BASE}/../bootloader/mcuboot/boot/zephyr -- -DOVERLAY_CONFIG=${GLOBAL_BOOT_CONF_OVERLAY_FILE} -DDTC_OVERLAY_FILE="${GLOBAL_BOOT_DTC_OVERLAY_FILE};${FLASH_DTC_OVERLAY_FILE};${USB_BOOT_DTC_OVERLAY_FILE};${MARS_BOOT_DTC_OVERLAY_FILE}" COMMAND - cp ${PROJECT_BINARY_DIR}/../modules/chip-module/build_mcuboot/zephyr/zephyr.bin ${PROJECT_BINARY_DIR}/zephyr.mcuboot.bin - ) - - add_custom_target(merge_mcuboot ALL - COMMAND - dd if=${PROJECT_BINARY_DIR}/zephyr.mcuboot.bin of=${PROJECT_BINARY_DIR}/zephyr.bin - COMMAND - dd if=${PROJECT_BINARY_DIR}/zephyr.signed.bin of=${PROJECT_BINARY_DIR}/zephyr.bin bs=${BLOCK_SIZE} seek=${boot_blocks} + cp ${PROJECT_BINARY_DIR}/../modules/chip-module/build_mcuboot/zephyr/zephyr.bin ${PROJECT_BINARY_DIR}/mcuboot.bin ) - - add_dependencies(merge_mcuboot ${ZEPHYR_FINAL_EXECUTABLE}) - - if (CONFIG_CHIP_OTA_IMAGE_BUILD) - chip_ota_image(chip-ota-image - INPUT_FILES ${PROJECT_BINARY_DIR}/zephyr.signed.bin - OUTPUT_FILE ${PROJECT_BINARY_DIR}/zephyr-ota.bin - ) - - add_dependencies(chip-ota-image ${ZEPHYR_FINAL_EXECUTABLE}) - endif() endif() -if (CONFIG_CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE) - dt_nodelabel(dts_partition_path NODELABEL "factory_partition") - dt_reg_addr(factory_size PATH ${dts_partition_path}) - math(EXPR factory_blocks "${factory_size} / ${BLOCK_SIZE}" OUTPUT_FORMAT DECIMAL) +# ============================================================================== +# Define 'chip-ota-image' target for building CHIP OTA image +# ============================================================================== - add_custom_target(merge_factory_data ALL - COMMAND - dd if=${PROJECT_BINARY_DIR}/factory/factory_data.bin of=${PROJECT_BINARY_DIR}/zephyr.bin bs=${BLOCK_SIZE} seek=${factory_blocks} +if (CONFIG_CHIP_OTA_IMAGE_BUILD) + chip_ota_image(chip-ota-image + INPUT_FILES ${PROJECT_BINARY_DIR}/zephyr.signed.bin + OUTPUT_FILE ${PROJECT_BINARY_DIR}/${CONFIG_CHIP_OTA_IMAGE_FILE_NAME} ) - if (CONFIG_CHIP_OTA_IMAGE_BUILD) - add_dependencies(merge_factory_data merge_mcuboot) - else() - add_dependencies(merge_factory_data ${ZEPHYR_FINAL_EXECUTABLE}) - endif() + add_dependencies(chip-ota-image process_binaries) endif() # ============================================================================== @@ -223,27 +207,4 @@ if (CONFIG_CHIP_FACTORY_DATA_BUILD) telink_generate_factory_data() endif() -if (CONFIG_SOC_SERIES_RISCV_TELINK_W91 AND CONFIG_TELINK_W91_FETCH_N22_BIN) - dt_nodelabel(flash_path NODELABEL "flash") - dt_reg_size(flash_size PATH ${flash_path}) - math(EXPR flash_blocks "${flash_size} / ${BLOCK_SIZE}" OUTPUT_FORMAT DECIMAL) - - add_custom_target(merge_n22 ALL - COMMAND - [ -f ${PROJECT_BINARY_DIR}/n22.bin ] && ( - dd if=/dev/zero bs=${BLOCK_SIZE} count=${flash_blocks} | tr '\\000' '\\377' > ${PROJECT_BINARY_DIR}/merged.bin && - dd if=${PROJECT_BINARY_DIR}/zephyr.bin of=${PROJECT_BINARY_DIR}/merged.bin conv=notrunc && - dd if=${PROJECT_BINARY_DIR}/n22.bin of=${PROJECT_BINARY_DIR}/merged.bin bs=${BLOCK_SIZE} seek=${flash_blocks} conv=notrunc - ) || true - ) - - if (CONFIG_CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE) - add_dependencies(merge_n22 merge_factory_data) - elseif (CONFIG_CHIP_OTA_IMAGE_BUILD) - add_dependencies(merge_n22 merge_mcuboot) - else() - add_dependencies(merge_n22 ${ZEPHYR_FINAL_EXECUTABLE}) - endif() -endif() - endif() # CONFIG_CHIP diff --git a/config/telink/chip-module/Kconfig b/config/telink/chip-module/Kconfig index d09f4534835ddf..7d9296bed5dfcc 100644 --- a/config/telink/chip-module/Kconfig +++ b/config/telink/chip-module/Kconfig @@ -1,5 +1,5 @@ # -# Copyright (c) 2023 Project CHIP Authors +# Copyright (c) 2023-2024 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. @@ -46,6 +46,7 @@ config BOOTLOADER_MCUBOOT 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 int "OTA Requestor image buffer size" @@ -123,9 +124,14 @@ config CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE default y help Enables merging generated factory data with the build target zephyr.bin file. - As a result, output file zephyr.bin will consist of all partitions including + As a result, output file merged.bin will consist of all partitions including factory data. +config TELINK_FACTORY_DATA_PARTITION_ADDR + hex "factory-data partition address" + default $(dt_node_reg_addr_hex,$(dt_nodelabel_path,factory_partition),0) + depends on CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE + # Use default certificates without generating or providing them config CHIP_FACTORY_DATA_USE_DEFAULT_CERTS bool "Use default certificates located in Matter repository" @@ -180,6 +186,7 @@ config CHIP_IPV4 config CHIP_BUTTON_MANAGER_IRQ_MODE bool "Use GPIO in an IRQ mode instead of polling the GPIO" + default y if BOARD_TLSR9118BDK40D default PM help Use GPIO in an IRQ mode to avoid button polling loop and extend the battery lifetime by waking up by GPIO event. diff --git a/config/telink/chip-module/Kconfig.defaults b/config/telink/chip-module/Kconfig.defaults index 80d07150f291d9..ed8172b1824584 100644 --- a/config/telink/chip-module/Kconfig.defaults +++ b/config/telink/chip-module/Kconfig.defaults @@ -180,7 +180,8 @@ config PWM endif # Board non-retention config -if BOARD_TLSR9118BDK40D || BOARD_TLSR9528A || BOARD_TLSR9258A || BOARD_TLSR9518ADK80D +if BOARD_TLSR9118BDK40D || BOARD_TLSR9118BDK40D_V1 || \ + BOARD_TLSR9528A || BOARD_TLSR9258A || BOARD_TLSR9518ADK80D config PWM default y endif @@ -192,6 +193,10 @@ config DYNAMIC_INTERRUPTS config CHIP_OTA_REQUESTOR default y +config MCUBOOT_SIGNATURE_KEY_FILE + default "bootloader/mcuboot/root-ec-p256.pem" if BOARD_TLSR9118BDK40D + depends on BOOTLOADER_MCUBOOT + # In current config/zephyr/Kconfig # next deprecated values are selected # warning: Deprecated symbol CPLUSPLUS is enabled. @@ -292,7 +297,7 @@ config NET_CONFIG_INIT_TIMEOUT config CHIP_WIFI bool "Enable Telink Wi-Fi support" - default y if BOARD_TLSR9118BDK40D + default y if BOARD_TLSR9118BDK40D || BOARD_TLSR9118BDK40D_V1 select WIFI_W91 select WIFI select NET_STATISTICS diff --git a/examples/air-quality-sensor-app/telink/README.md b/examples/air-quality-sensor-app/telink/README.md index e2c4b49a699991..c3d403f450ee45 100644 --- a/examples/air-quality-sensor-app/telink/README.md +++ b/examples/air-quality-sensor-app/telink/README.md @@ -138,10 +138,10 @@ feature for another Telink example: After build application with enabled OTA feature, use next binary files: -- zephyr.bin - main binary to flash PCB (Use at least 2MB PCB). -- zephyr-ota.bin - binary for OTA Provider +- merged.bin - main binary to flash PCB (Use at least 2MB PCB). +- matter.ota - binary for OTA Provider -All binaries has the same SW version. To test OTA “zephyr-ota.bin” should have +All binaries has the same SW version. To test OTA “matter.ota” should have higher SW version than base SW. Set CONFIG_CHIP_DEVICE_SOFTWARE_VERSION=2 in corresponding “prj.conf” configuration file. @@ -156,7 +156,7 @@ Usage of OTA: - Run the Linux OTA Provider with OTA image. ``` - ./chip-ota-provider-app -f zephyr-ota.bin + ./chip-ota-provider-app -f matter.ota ``` - Provision the Linux OTA Provider using chip-tool diff --git a/examples/all-clusters-app/ameba/README.md b/examples/all-clusters-app/ameba/README.md index 0569c919fc330e..9c442d6652e84f 100644 --- a/examples/all-clusters-app/ameba/README.md +++ b/examples/all-clusters-app/ameba/README.md @@ -27,11 +27,11 @@ The CHIP demo application is supported on - Pull docker image: - $ docker pull ghcr.io/project-chip/chip-build-ameba:76 + $ docker pull ghcr.io/project-chip/chip-build-ameba:81 - Run docker container: - $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:76 + $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:81 - Setup build environment: diff --git a/examples/all-clusters-app/telink/README.md b/examples/all-clusters-app/telink/README.md index 8404672d3134e6..b702fd6e3567db 100644 --- a/examples/all-clusters-app/telink/README.md +++ b/examples/all-clusters-app/telink/README.md @@ -140,10 +140,10 @@ feature for another Telink example: After build application with enabled OTA feature, use next binary files: -- zephyr.bin - main binary to flash PCB (Use at least 2MB PCB). -- zephyr-ota.bin - binary for OTA Provider +- merged.bin - main binary to flash PCB (Use at least 2MB PCB). +- matter.ota - binary for OTA Provider -All binaries has the same SW version. To test OTA “zephyr-ota.bin” should have +All binaries has the same SW version. To test OTA “matter.ota” should have higher SW version than base SW. Set CONFIG_CHIP_DEVICE_SOFTWARE_VERSION=2 in corresponding “prj.conf” configuration file. @@ -158,7 +158,7 @@ Usage of OTA: - Run the Linux OTA Provider with OTA image. ``` - ./chip-ota-provider-app -f zephyr-ota.bin + ./chip-ota-provider-app -f matter.ota ``` - Provision the Linux OTA Provider using chip-tool diff --git a/examples/all-clusters-minimal-app/ameba/README.md b/examples/all-clusters-minimal-app/ameba/README.md index c136008cb18456..b120d9c4bfebfa 100644 --- a/examples/all-clusters-minimal-app/ameba/README.md +++ b/examples/all-clusters-minimal-app/ameba/README.md @@ -27,13 +27,13 @@ The CHIP demo application is supported on - Pull docker image: ``` - $ docker pull ghcr.io/project-chip/chip-build-ameba:76 + $ docker pull ghcr.io/project-chip/chip-build-ameba:81 ``` - Run docker container: ``` - $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:76 + $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:81 ``` - Setup build environment: diff --git a/examples/all-clusters-minimal-app/telink/README.md b/examples/all-clusters-minimal-app/telink/README.md index f3a0646df97743..33ad1fb6cf9f8d 100644 --- a/examples/all-clusters-minimal-app/telink/README.md +++ b/examples/all-clusters-minimal-app/telink/README.md @@ -125,10 +125,10 @@ feature for another Telink example: After build application with enabled OTA feature, use next binary files: -- zephyr.bin - main binary to flash PCB (Use at least 2MB PCB). -- zephyr-ota.bin - binary for OTA Provider +- merged.bin - main binary to flash PCB (Use at least 2MB PCB). +- matter.ota - binary for OTA Provider -All binaries has the same SW version. To test OTA “zephyr-ota.bin” should have +All binaries has the same SW version. To test OTA “matter.ota” should have higher SW version than base SW. Set CONFIG_CHIP_DEVICE_SOFTWARE_VERSION=2 in corresponding “prj.conf” configuration file. @@ -143,7 +143,7 @@ Usage of OTA: - Run the Linux OTA Provider with OTA image. ``` - ./chip-ota-provider-app -f zephyr-ota.bin + ./chip-ota-provider-app -f matter.ota ``` - Provision the Linux OTA Provider using chip-tool diff --git a/examples/bridge-app/telink/README.md b/examples/bridge-app/telink/README.md index 7dc29dff9d1d58..00b050e93c945e 100644 --- a/examples/bridge-app/telink/README.md +++ b/examples/bridge-app/telink/README.md @@ -285,10 +285,10 @@ feature for another Telink example: After build application with enabled OTA feature, use next binary files: -- zephyr.bin - main binary to flash PCB (Use at least 2MB PCB). -- zephyr-ota.bin - binary for OTA Provider +- merged.bin - main binary to flash PCB (Use at least 2MB PCB). +- matter.ota - binary for OTA Provider -All binaries has the same SW version. To test OTA “zephyr-ota.bin” should have +All binaries has the same SW version. To test OTA “matter.ota” should have higher SW version than base SW. Set CONFIG_CHIP_DEVICE_SOFTWARE_VERSION=2 in corresponding “prj.conf” configuration file. @@ -303,7 +303,7 @@ Usage of OTA: - Run the Linux OTA Provider with OTA image. ``` - ./chip-ota-provider-app -f zephyr-ota.bin + ./chip-ota-provider-app -f matter.ota ``` - Provision the Linux OTA Provider using chip-tool diff --git a/examples/contact-sensor-app/telink/README.md b/examples/contact-sensor-app/telink/README.md index cbceff71361ccf..27d5721953c261 100755 --- a/examples/contact-sensor-app/telink/README.md +++ b/examples/contact-sensor-app/telink/README.md @@ -142,10 +142,10 @@ feature for another Telink example: After build application with enabled OTA feature, use next binary files: -- zephyr.bin - main binary to flash PCB (Use at least 2MB PCB). -- zephyr-ota.bin - binary for OTA Provider +- merged.bin - main binary to flash PCB (Use at least 2MB PCB). +- matter.ota - binary for OTA Provider -All binaries has the same SW version. To test OTA “zephyr-ota.bin” should have +All binaries has the same SW version. To test OTA “matter.ota” should have higher SW version than base SW. Set CONFIG_CHIP_DEVICE_SOFTWARE_VERSION=2 in corresponding “prj.conf” configuration file. @@ -160,7 +160,7 @@ Usage of OTA: - Run the Linux OTA Provider with OTA image. ``` - ./chip-ota-provider-app -f zephyr-ota.bin + ./chip-ota-provider-app -f matter.ota ``` - Provision the Linux OTA Provider using chip-tool diff --git a/examples/light-switch-app/ameba/README.md b/examples/light-switch-app/ameba/README.md index d24c9a54906553..a0d02751a830c1 100644 --- a/examples/light-switch-app/ameba/README.md +++ b/examples/light-switch-app/ameba/README.md @@ -26,11 +26,11 @@ The CHIP demo application is supported on - Pull docker image: - $ docker pull ghcr.io/project-chip/chip-build-ameba:76 + $ docker pull ghcr.io/project-chip/chip-build-ameba:81 - Run docker container: - $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:76 + $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:81 - Setup build environment: diff --git a/examples/light-switch-app/telink/README.md b/examples/light-switch-app/telink/README.md index c60dd6a27c3584..b2c75f1fc28fb9 100755 --- a/examples/light-switch-app/telink/README.md +++ b/examples/light-switch-app/telink/README.md @@ -263,10 +263,10 @@ feature for another Telink example: After build application with enabled OTA feature, use next binary files: -- zephyr.bin - main binary to flash PCB (Use at least 2MB PCB). -- zephyr-ota.bin - binary for OTA Provider +- merged.bin - main binary to flash PCB (Use at least 2MB PCB). +- matter.ota - binary for OTA Provider -All binaries has the same SW version. To test OTA “zephyr-ota.bin” should have +All binaries has the same SW version. To test OTA “matter.ota” should have higher SW version than base SW. Set CONFIG_CHIP_DEVICE_SOFTWARE_VERSION=2 in corresponding “prj.conf” configuration file. @@ -281,7 +281,7 @@ Usage of OTA: - Run the Linux OTA Provider with OTA image. ``` - ./chip-ota-provider-app -f zephyr-ota.bin + ./chip-ota-provider-app -f matter.ota ``` - Provision the Linux OTA Provider using chip-tool diff --git a/examples/lighting-app/ameba/README.md b/examples/lighting-app/ameba/README.md index 810aa6d1d0af5b..7527d02f725099 100644 --- a/examples/lighting-app/ameba/README.md +++ b/examples/lighting-app/ameba/README.md @@ -23,11 +23,11 @@ The CHIP demo application is supported on - Pull docker image: - $ docker pull ghcr.io/project-chip/chip-build-ameba:76 + $ docker pull ghcr.io/project-chip/chip-build-ameba:81 - Run docker container: - $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:76 + $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:81 - Setup build environment: diff --git a/examples/lighting-app/telink/README.md b/examples/lighting-app/telink/README.md index 0bf52ea12c28fd..1a142507652784 100644 --- a/examples/lighting-app/telink/README.md +++ b/examples/lighting-app/telink/README.md @@ -204,10 +204,10 @@ feature for another Telink example: After build application with enabled OTA feature, use next binary files: -- zephyr.bin - main binary to flash PCB (Use at least 2MB PCB). -- zephyr-ota.bin - binary for OTA Provider +- merged.bin - main binary to flash PCB (Use at least 2MB PCB). +- matter.ota - binary for OTA Provider -All binaries has the same SW version. To test OTA “zephyr-ota.bin” should have +All binaries has the same SW version. To test OTA “matter.ota” should have higher SW version than base SW. Set CONFIG_CHIP_DEVICE_SOFTWARE_VERSION=2 in corresponding “prj.conf” configuration file. @@ -222,7 +222,7 @@ Usage of OTA: - Run the Linux OTA Provider with OTA image. ``` - ./chip-ota-provider-app -f zephyr-ota.bin + ./chip-ota-provider-app -f matter.ota ``` - Provision the Linux OTA Provider using chip-tool diff --git a/examples/lighting-app/telink/src/AppTask.cpp b/examples/lighting-app/telink/src/AppTask.cpp index 63a5cb7d910e0c..9e419150712c3c 100644 --- a/examples/lighting-app/telink/src/AppTask.cpp +++ b/examples/lighting-app/telink/src/AppTask.cpp @@ -252,7 +252,11 @@ void AppTask::PowerOnFactoryResetTimerEvent(struct k_timer * timer) void AppTask::LinkLeds(LedManager & ledManager) { -#if (!CONFIG_PWM) - ledManager.linkLed(LedManager::EAppLed_App0, 0); -#endif // !CONFIG_PWM +#if CONFIG_CHIP_ENABLE_APPLICATION_STATUS_LED + ledManager.linkLed(LedManager::EAppLed_Status, 0); +#endif + +#if !CONFIG_PWM + ledManager.linkLed(LedManager::EAppLed_App0, 1); +#endif /* !CONFIG_PWM */ } diff --git a/examples/lock-app/telink/README.md b/examples/lock-app/telink/README.md index 8e0d605fd85dc6..9f6e8671ccbb3b 100755 --- a/examples/lock-app/telink/README.md +++ b/examples/lock-app/telink/README.md @@ -145,10 +145,10 @@ feature for another Telink example: After build application with enabled OTA feature, use next binary files: -- zephyr.bin - main binary to flash PCB (Use at least 2MB PCB). -- zephyr-ota.bin - binary for OTA Provider +- merged.bin - main binary to flash PCB (Use at least 2MB PCB). +- matter.ota - binary for OTA Provider -All binaries has the same SW version. To test OTA “zephyr-ota.bin” should have +All binaries has the same SW version. To test OTA “matter.ota” should have higher SW version than base SW. Set CONFIG_CHIP_DEVICE_SOFTWARE_VERSION=2 in corresponding “prj.conf” configuration file. @@ -163,7 +163,7 @@ Usage of OTA: - Run the Linux OTA Provider with OTA image. ``` - ./chip-ota-provider-app -f zephyr-ota.bin + ./chip-ota-provider-app -f matter.ota ``` - Provision the Linux OTA Provider using chip-tool diff --git a/examples/ota-requestor-app/ameba/README.md b/examples/ota-requestor-app/ameba/README.md index b3efb9db0a5b9d..1af661767dfd77 100644 --- a/examples/ota-requestor-app/ameba/README.md +++ b/examples/ota-requestor-app/ameba/README.md @@ -6,11 +6,11 @@ A prototype application that demonstrates OTA Requestor capabilities. - Pull docker image: - $ docker pull ghcr.io/project-chip/chip-build-ameba:76 + $ docker pull ghcr.io/project-chip/chip-build-ameba:81 - Run docker container: - $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:76 + $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:81 - Setup build environment: diff --git a/examples/ota-requestor-app/telink/README.md b/examples/ota-requestor-app/telink/README.md index d8590c6a0cc4d7..0c359b3af5ac01 100755 --- a/examples/ota-requestor-app/telink/README.md +++ b/examples/ota-requestor-app/telink/README.md @@ -134,10 +134,10 @@ feature for another Telink example: After build application with enabled OTA feature, use next binary files: -- zephyr.bin - main binary to flash PCB (Use at least 2MB PCB). -- zephyr-ota.bin - binary for OTA Provider +- merged.bin - main binary to flash PCB (Use at least 2MB PCB). +- matter.ota - binary for OTA Provider -All binaries has the same SW version. To test OTA “zephyr-ota.bin” should have +All binaries has the same SW version. To test OTA “matter.ota” should have higher SW version than base SW. Set CONFIG_CHIP_DEVICE_SOFTWARE_VERSION=2 in corresponding “prj.conf” configuration file. @@ -152,7 +152,7 @@ Usage of OTA: - Run the Linux OTA Provider with OTA image. ``` - ./chip-ota-provider-app -f zephyr-ota.bin + ./chip-ota-provider-app -f matter.ota ``` - Provision the Linux OTA Provider using chip-tool diff --git a/examples/pigweed-app/ameba/README.md b/examples/pigweed-app/ameba/README.md index acf8c4810bda8a..647809108e65ac 100644 --- a/examples/pigweed-app/ameba/README.md +++ b/examples/pigweed-app/ameba/README.md @@ -31,11 +31,11 @@ following features are available: - Pull docker image: - $ docker pull ghcr.io/project-chip/chip-build-ameba:76 + $ docker pull ghcr.io/project-chip/chip-build-ameba:81 - Run docker container: - $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:76 + $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:81 - Setup build environment: diff --git a/examples/platform/telink/common.cmake b/examples/platform/telink/common.cmake index 9b8149c7d02d6a..34ff2dbffdf471 100644 --- a/examples/platform/telink/common.cmake +++ b/examples/platform/telink/common.cmake @@ -14,10 +14,11 @@ # limitations under the License. string(REPLACE "_retention" "" BASE_BOARD ${BOARD}) +string(REGEX REPLACE "_v[0-9]+" "" BASE_BOARD ${BASE_BOARD}) if(NOT FLASH_SIZE) if(${BASE_BOARD} MATCHES "tlsr9118bdk40d") - set(FLASH_SIZE "3m") + set(FLASH_SIZE "4m") else() set(FLASH_SIZE "2m") endif() @@ -86,17 +87,20 @@ endif() set(GLOBAL_BOOT_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${BASE_BOARD}.overlay") if(NOT EXISTS "${GLOBAL_BOOT_DTC_OVERLAY_FILE}") - message(FATAL_ERROR "${GLOBAL_BOOT_DTC_OVERLAY_FILE} doesn't exist") + message(STATUS "${GLOBAL_BOOT_DTC_OVERLAY_FILE} doesn't exist") + unset(GLOBAL_BOOT_DTC_OVERLAY_FILE) endif() set(GLOBAL_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${BOARD}.overlay") if(NOT EXISTS "${GLOBAL_DTC_OVERLAY_FILE}") - message(FATAL_ERROR "${GLOBAL_DTC_OVERLAY_FILE} doesn't exist") + message(STATUS "${GLOBAL_DTC_OVERLAY_FILE} doesn't exist") + unset(GLOBAL_DTC_OVERLAY_FILE) endif() set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${BASE_BOARD}_${FLASH_SIZE}_flash.overlay") if(NOT EXISTS "${FLASH_DTC_OVERLAY_FILE}") - message(FATAL_ERROR "${FLASH_DTC_OVERLAY_FILE} doesn't exist") + message(STATUS "${FLASH_DTC_OVERLAY_FILE} doesn't exist") + unset(FLASH_DTC_OVERLAY_FILE) endif() if(DTC_OVERLAY_FILE) diff --git a/examples/platform/telink/common/src/AppTaskCommon.cpp b/examples/platform/telink/common/src/AppTaskCommon.cpp index 8b67c403a8194c..13036743a5db65 100644 --- a/examples/platform/telink/common/src/AppTaskCommon.cpp +++ b/examples/platform/telink/common/src/AppTaskCommon.cpp @@ -416,7 +416,7 @@ void AppTaskCommon::InitPwms() void AppTaskCommon::LinkPwms(PwmManager & pwmManager) { -#if CONFIG_BOARD_TLSR9118BDK40D // TLSR9118BDK40D EVK supports only 1 PWM channel connected to LED +#if CONFIG_BOARD_TLSR9118BDK40D_V1 && CONFIG_PWM // TLSR9118BDK40D_V1 EVK supports single LED PWM channel pwmManager.linkPwm(PwmManager::EAppPwm_Red, 0); #elif CONFIG_WS2812_STRIP pwmManager.linkPwm(PwmManager::EAppPwm_Red, 0); diff --git a/examples/pump-app/telink/README.md b/examples/pump-app/telink/README.md index 2a89b7514b1c98..0f3337f5c08a78 100755 --- a/examples/pump-app/telink/README.md +++ b/examples/pump-app/telink/README.md @@ -146,10 +146,10 @@ feature for another Telink example: After build application with enabled OTA feature, use next binary files: -- zephyr.bin - main binary to flash PCB (Use at least 2MB PCB). -- zephyr-ota.bin - binary for OTA Provider +- merged.bin - main binary to flash PCB (Use at least 2MB PCB). +- matter.ota - binary for OTA Provider -All binaries has the same SW version. To test OTA “zephyr-ota.bin” should have +All binaries has the same SW version. To test OTA “matter.ota” should have higher SW version than base SW. Set CONFIG_CHIP_DEVICE_SOFTWARE_VERSION=2 in corresponding “prj.conf” configuration file. @@ -164,7 +164,7 @@ Usage of OTA: - Run the Linux OTA Provider with OTA image. ``` - ./chip-ota-provider-app -f zephyr-ota.bin + ./chip-ota-provider-app -f matter.ota ``` - Provision the Linux OTA Provider using chip-tool diff --git a/examples/pump-controller-app/telink/README.md b/examples/pump-controller-app/telink/README.md index 529cc37e002bf5..3d1cb1f204f499 100755 --- a/examples/pump-controller-app/telink/README.md +++ b/examples/pump-controller-app/telink/README.md @@ -147,10 +147,10 @@ feature for another Telink example: After build application with enabled OTA feature, use next binary files: -- zephyr.bin - main binary to flash PCB (Use at least 2MB PCB). -- zephyr-ota.bin - binary for OTA Provider +- merged.bin - main binary to flash PCB (Use at least 2MB PCB). +- matter.ota - binary for OTA Provider -All binaries has the same SW version. To test OTA “zephyr-ota.bin” should have +All binaries has the same SW version. To test OTA “matter.ota” should have higher SW version than base SW. Set CONFIG_CHIP_DEVICE_SOFTWARE_VERSION=2 in corresponding “prj.conf” configuration file. @@ -165,7 +165,7 @@ Usage of OTA: - Run the Linux OTA Provider with OTA image. ``` - ./chip-ota-provider-app -f zephyr-ota.bin + ./chip-ota-provider-app -f matter.ota ``` - Provision the Linux OTA Provider using chip-tool diff --git a/examples/smoke-co-alarm-app/telink/README.md b/examples/smoke-co-alarm-app/telink/README.md index da8a084f4dfa4f..a2fce29d1b1fd3 100755 --- a/examples/smoke-co-alarm-app/telink/README.md +++ b/examples/smoke-co-alarm-app/telink/README.md @@ -144,10 +144,10 @@ feature for another Telink example: After build application with enabled OTA feature, use next binary files: -- zephyr.bin - main binary to flash PCB (Use at least 2MB PCB). -- zephyr-ota.bin - binary for OTA Provider +- merged.bin - main binary to flash PCB (Use at least 2MB PCB). +- matter.ota - binary for OTA Provider -All binaries has the same SW version. To test OTA “zephyr-ota.bin” should have +All binaries has the same SW version. To test OTA “matter.ota” should have higher SW version than base SW. Set CONFIG_CHIP_DEVICE_SOFTWARE_VERSION=2 in corresponding “prj.conf” configuration file. @@ -162,7 +162,7 @@ Usage of OTA: - Run the Linux OTA Provider with OTA image. ``` - ./chip-ota-provider-app -f zephyr-ota.bin + ./chip-ota-provider-app -f matter.ota ``` - Provision the Linux OTA Provider using chip-tool diff --git a/examples/temperature-measurement-app/telink/README.md b/examples/temperature-measurement-app/telink/README.md index 04668c02cb0fc8..7dc9287a54ca55 100644 --- a/examples/temperature-measurement-app/telink/README.md +++ b/examples/temperature-measurement-app/telink/README.md @@ -127,10 +127,10 @@ feature for another Telink example: After build application with enabled OTA feature, use next binary files: -- zephyr.bin - main binary to flash PCB (Use at least 2MB PCB). -- zephyr-ota.bin - binary for OTA Provider +- merged.bin - main binary to flash PCB (Use at least 2MB PCB). +- matter.ota - binary for OTA Provider -All binaries has the same SW version. To test OTA “zephyr-ota.bin” should have +All binaries has the same SW version. To test OTA “matter.ota” should have higher SW version than base SW. Set CONFIG_CHIP_DEVICE_SOFTWARE_VERSION=2 in corresponding “prj.conf” configuration file. @@ -145,7 +145,7 @@ Usage of OTA: - Run the Linux OTA Provider with OTA image. ``` - ./chip-ota-provider-app -f zephyr-ota.bin + ./chip-ota-provider-app -f matter.ota ``` - Provision the Linux OTA Provider using chip-tool diff --git a/examples/thermostat/telink/README.md b/examples/thermostat/telink/README.md index 1d6c66bb74cd7f..26856132994c5d 100755 --- a/examples/thermostat/telink/README.md +++ b/examples/thermostat/telink/README.md @@ -138,10 +138,10 @@ feature for another Telink example: After build application with enabled OTA feature, use next binary files: -- zephyr.bin - main binary to flash PCB (Use at least 2MB PCB). -- zephyr-ota.bin - binary for OTA Provider +- merged.bin - main binary to flash PCB (Use at least 2MB PCB). +- matter.ota - binary for OTA Provider -All binaries has the same SW version. To test OTA “zephyr-ota.bin” should have +All binaries has the same SW version. To test OTA “matter.ota” should have higher SW version than base SW. Set CONFIG_CHIP_DEVICE_SOFTWARE_VERSION=2 in corresponding “prj.conf” configuration file. @@ -156,7 +156,7 @@ Usage of OTA: - Run the Linux OTA Provider with OTA image. ``` - ./chip-ota-provider-app -f zephyr-ota.bin + ./chip-ota-provider-app -f matter.ota ``` - Provision the Linux OTA Provider using chip-tool diff --git a/examples/window-app/telink/README.md b/examples/window-app/telink/README.md index ee788a7b018f13..b40a12bf754eac 100644 --- a/examples/window-app/telink/README.md +++ b/examples/window-app/telink/README.md @@ -209,10 +209,10 @@ feature for another Telink example: After build application with enabled OTA feature, use next binary files: -- zephyr.bin - main binary to flash PCB (Use at least 2MB PCB). -- zephyr-ota.bin - binary for OTA Provider +- merged.bin - main binary to flash PCB (Use at least 2MB PCB). +- matter.ota - binary for OTA Provider -All binaries has the same SW version. To test OTA “zephyr-ota.bin” should have +All binaries has the same SW version. To test OTA “matter.ota” should have higher SW version than base SW. Set CONFIG_CHIP_DEVICE_SOFTWARE_VERSION=2 in corresponding “prj.conf” configuration file. @@ -227,7 +227,7 @@ Usage of OTA: - Run the Linux OTA Provider with OTA image. ``` - ./chip-ota-provider-app -f zephyr-ota.bin + ./chip-ota-provider-app -f matter.ota ``` - Provision the Linux OTA Provider using chip-tool diff --git a/integrations/cloudbuild/chef.yaml b/integrations/cloudbuild/chef.yaml index 8931f73d3f7931..fd34dab03f06d6 100644 --- a/integrations/cloudbuild/chef.yaml +++ b/integrations/cloudbuild/chef.yaml @@ -1,5 +1,5 @@ steps: - - name: "ghcr.io/project-chip/chip-build-vscode:76" + - name: "ghcr.io/project-chip/chip-build-vscode:81" entrypoint: "bash" args: - "-c" @@ -7,7 +7,7 @@ steps: git config --global --add safe.directory "*" python scripts/checkout_submodules.py --shallow --recursive --platform esp32 nrfconnect silabs linux android id: Submodules - - name: "ghcr.io/project-chip/chip-build-vscode:76" + - name: "ghcr.io/project-chip/chip-build-vscode:81" # NOTE: silabs boostrap is NOT done with the rest as it requests a conflicting # jinja2 version (asks for 3.1.3 when constraints.txt asks for 3.0.3) env: @@ -23,7 +23,7 @@ steps: - name: pwenv path: /pwenv timeout: 900s - - name: "ghcr.io/project-chip/chip-build-vscode:76" + - name: "ghcr.io/project-chip/chip-build-vscode:81" env: - PW_ENVIRONMENT_ROOT=/pwenv args: @@ -38,7 +38,7 @@ steps: - name: pwenv path: /pwenv - - name: "ghcr.io/project-chip/chip-build-vscode:76" + - name: "ghcr.io/project-chip/chip-build-vscode:81" env: - PW_ENVIRONMENT_ROOT=/pwenv args: diff --git a/integrations/cloudbuild/smoke-test.yaml b/integrations/cloudbuild/smoke-test.yaml index 92f64945060fcb..99bc5042ed9939 100644 --- a/integrations/cloudbuild/smoke-test.yaml +++ b/integrations/cloudbuild/smoke-test.yaml @@ -1,5 +1,5 @@ steps: - - name: "ghcr.io/project-chip/chip-build-vscode:78" + - name: "ghcr.io/project-chip/chip-build-vscode:81" entrypoint: "bash" args: - "-c" @@ -7,7 +7,7 @@ steps: git config --global --add safe.directory "*" python scripts/checkout_submodules.py --shallow --recursive --platform esp32 nrfconnect silabs linux android id: Submodules - - name: "ghcr.io/project-chip/chip-build-vscode:78" + - name: "ghcr.io/project-chip/chip-build-vscode:81" # NOTE: silabs boostrap is NOT done with the rest as it requests a conflicting # jinja2 version (asks for 3.1.3 when constraints.txt asks for 3.0.3) env: @@ -24,7 +24,7 @@ steps: path: /pwenv timeout: 900s - - name: "ghcr.io/project-chip/chip-build-vscode:78" + - name: "ghcr.io/project-chip/chip-build-vscode:81" id: ESP32 env: - PW_ENVIRONMENT_ROOT=/pwenv @@ -45,7 +45,7 @@ steps: volumes: - name: pwenv path: /pwenv - - name: "ghcr.io/project-chip/chip-build-vscode:78" + - name: "ghcr.io/project-chip/chip-build-vscode:81" id: NRFConnect env: - PW_ENVIRONMENT_ROOT=/pwenv @@ -66,7 +66,7 @@ steps: - name: pwenv path: /pwenv - - name: "ghcr.io/project-chip/chip-build-vscode:78" + - name: "ghcr.io/project-chip/chip-build-vscode:81" id: EFR32 env: - PW_ENVIRONMENT_ROOT=/pwenv @@ -88,7 +88,7 @@ steps: - name: pwenv path: /pwenv - - name: "ghcr.io/project-chip/chip-build-vscode:78" + - name: "ghcr.io/project-chip/chip-build-vscode:81" id: Linux env: - PW_ENVIRONMENT_ROOT=/pwenv @@ -141,7 +141,7 @@ steps: - name: pwenv path: /pwenv - - name: "ghcr.io/project-chip/chip-build-vscode:78" + - name: "ghcr.io/project-chip/chip-build-vscode:81" id: Android env: - PW_ENVIRONMENT_ROOT=/pwenv diff --git a/scripts/tools/telink/process_binaries.py b/scripts/tools/telink/process_binaries.py new file mode 100755 index 00000000000000..0f650e25427521 --- /dev/null +++ b/scripts/tools/telink/process_binaries.py @@ -0,0 +1,110 @@ +#!/usr/bin/env python3 + +# +# Copyright (c) 2024 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. +# + +import os +import subprocess +import sys + +ZEPHYR_BASE = os.environ.get('ZEPHYR_BASE') +if ZEPHYR_BASE is None: + raise EnvironmentError("ZEPHYR_BASE environment variable is not set") + +try: + from core import BuildConfiguration +except ImportError: + sys.path.append(os.path.abspath(os.path.join(ZEPHYR_BASE, 'scripts/west_commands/runners'))) + from core import BuildConfiguration + + +def merge_binaries(input_file1, input_file2, output_file, offset): + with open(output_file, 'r+b' if os.path.exists(output_file) else 'wb') as outfile: + # Merge input_file1 at offset 0 + with open(input_file1, 'rb') as infile1: + outfile.seek(0) + data1 = infile1.read() + outfile.write(data1) + print(f"Merged {len(data1)} bytes from {input_file1} into {output_file} at offset 0") + + # Fill gaps with 0xFF if necessary + current_size = outfile.tell() + if current_size < offset: + gap_size = offset - current_size + outfile.write(bytearray([0xFF] * gap_size)) + print(f"Filled gap of {gap_size} bytes with 0xFF in {output_file} to reach offset {offset}") + + # Merge input_file2 at the specified offset + with open(input_file2, 'rb') as infile2: + outfile.seek(offset) + data2 = infile2.read() + outfile.write(data2) + print(f"Merged {len(data2)} bytes from {input_file2} into {output_file} at offset {offset}") + + +# Obtain build configuration +build_conf = BuildConfiguration(os.path.join(os.getcwd(), os.pardir)) + +# Clean up merged.bin from previous build +if os.path.exists('merged.bin'): + os.remove('merged.bin') + +# Telink W91 dual-core SoC binary operations +if build_conf.getboolean('CONFIG_SOC_SERIES_RISCV_TELINK_W91'): + n22_partition_offset = build_conf['CONFIG_TELINK_W91_N22_PARTITION_ADDR'] + if build_conf.getboolean('CONFIG_BOOTLOADER_MCUBOOT'): + n22_partition_offset -= build_conf['CONFIG_FLASH_LOAD_OFFSET'] + + # Merge N22 core binary + merge_binaries('zephyr.bin', 'n22.bin', 'merged.bin', n22_partition_offset) + + # Sign the image if MCUBoot is used + if build_conf.getboolean('CONFIG_BOOTLOADER_MCUBOOT'): + sign_command = [ + 'python3', + os.path.join(ZEPHYR_BASE, '../bootloader/mcuboot/scripts/imgtool.py'), + 'sign', + '--version', '0.0.0+0', + '--align', '1', + '--header-size', str(build_conf['CONFIG_ROM_START_OFFSET']), + '--slot-size', str(build_conf['CONFIG_FLASH_LOAD_SIZE']), + '--key', os.path.join(ZEPHYR_BASE, '../', build_conf['CONFIG_MCUBOOT_SIGNATURE_KEY_FILE']), + 'merged.bin', + 'zephyr.signed.bin' + ] + try: + subprocess.run(sign_command, check=True) + os.remove('merged.bin') # Clean up merged.bin after signing + except subprocess.CalledProcessError as e: + raise RuntimeError(f"Error signing the image: {e}") + +# Merge MCUBoot binary if configured +if build_conf.getboolean('CONFIG_BOOTLOADER_MCUBOOT'): + merge_binaries('mcuboot.bin', 'zephyr.signed.bin', 'merged.bin', build_conf['CONFIG_FLASH_LOAD_OFFSET']) + +# Merge Factory Data binary if configured +if build_conf.getboolean('CONFIG_CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE'): + if os.path.exists('merged.bin'): + merge_binaries('merged.bin', 'factory/factory_data.bin', 'merged.bin', + build_conf['CONFIG_TELINK_FACTORY_DATA_PARTITION_ADDR']) + else: + # Initialize merged.bin with zephyr.bin since no base binary was created + merge_binaries('zephyr.bin', 'factory/factory_data.bin', 'merged.bin', + build_conf['CONFIG_TELINK_FACTORY_DATA_PARTITION_ADDR']) + +# Check if merged.bin was created by any enabled feature, otherwise symlink zephyr.bin +if not os.path.exists('merged.bin'): + os.symlink('zephyr.bin', 'merged.bin') diff --git a/src/platform/telink/telink-mbedtls-config.h b/src/platform/telink/telink-mbedtls-config.h index 921255d9425289..c9a79ee88f32fb 100644 --- a/src/platform/telink/telink-mbedtls-config.h +++ b/src/platform/telink/telink-mbedtls-config.h @@ -1,6 +1,6 @@ /* * - * Copyright (c) 2022 Project CHIP Authors + * Copyright (c) 2022-2024 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. @@ -37,11 +37,6 @@ #define MBEDTLS_X509_CREATE_C #define MBEDTLS_X509_CSR_WRITE_C -#ifdef CONFIG_TELINK_B9X_MBEDTLS_HW_ACCELERATION -#define MBEDTLS_AES_ALT -#define MBEDTLS_ECP_ALT -#endif - #undef MBEDTLS_ERROR_C #endif /* MBEDTLS_TSLR9_CONF_H */ diff --git a/src/platform/telink/tlsr9118bdk40d.overlay b/src/platform/telink/tlsr9118bdk40d.overlay deleted file mode 100644 index 3c44668724d796..00000000000000 --- a/src/platform/telink/tlsr9118bdk40d.overlay +++ /dev/null @@ -1,39 +0,0 @@ -/ { - /* Short TL_Key1 (J20 pin 11) to ground (J20 pin 25-35) */ - key_pool { - compatible = "gpio-keys"; - - inp { - gpios = <&gpio0 16 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, - <&gpio0 15 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; - }; - }; - - key_matrix { - compatible = "gpio-keys"; - - col { - gpios = <&gpio0 18 GPIO_ACTIVE_HIGH>, - <&gpio0 17 GPIO_ACTIVE_HIGH>; - }; - - row { - gpios = <&gpio0 16 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>, - <&gpio0 15 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>; - }; - }; - - led_pool{ - compatible = "gpio-leds"; - - out { - gpios = <&gpio0 19 GPIO_ACTIVE_HIGH>; - }; - }; - pwm_pool { - compatible = "pwm-leds"; - out { - pwms = <&pwm0 4 PWM_MSEC(1) PWM_POLARITY_NORMAL>; - }; - }; -}; \ No newline at end of file diff --git a/src/platform/telink/tlsr9118bdk40d_3m_flash.overlay b/src/platform/telink/tlsr9118bdk40d_3m_flash.overlay deleted file mode 100644 index 02cd3b6582c8e0..00000000000000 --- a/src/platform/telink/tlsr9118bdk40d_3m_flash.overlay +++ /dev/null @@ -1,36 +0,0 @@ -&flash { - reg = <0x80000000 0x300000>; - - partitions { - /delete-node/ partition@0; - /delete-node/ partition@20000; - /delete-node/ partition@88000; - /delete-node/ partition@f0000; - /delete-node/ partition@f4000; - /delete-node/ partition@fe000; - boot_partition: partition@0 { - label = "mcuboot"; - reg = <0x00000000 0x20000>; - }; - slot0_partition: partition@20000 { - label = "image-0"; - reg = <0x20000 0xe8000>; - }; - factory_partition: partition@108000 { - label = "factory-data"; - reg = <0x108000 0x1000>; - }; - storage_partition: partition@109000 { - label = "storage"; - reg = <0x109000 0xf000>; - }; - slot1_partition: partition@118000 { - label = "image-1"; - reg = <0x118000 0xe8000>; - }; - vendor_partition: partition@200000 { - label = "vendor-data"; - reg = <0x200000 0x100000>; - }; - }; -}; diff --git a/src/platform/telink/tlsr9118bdk40d_4m_flash.overlay b/src/platform/telink/tlsr9118bdk40d_4m_flash.overlay new file mode 100644 index 00000000000000..536872da60e9d6 --- /dev/null +++ b/src/platform/telink/tlsr9118bdk40d_4m_flash.overlay @@ -0,0 +1,39 @@ +&flash { + reg = <0x80000000 0x400000>; + + /delete-node/ partitions; + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x00000000 0x20000>; + }; + slot0_partition: partition@20000 { + label = "image-0"; + reg = <0x20000 0x1e7000>; // End address should be same as for n22_partition + }; + n22_partition: partition@140000 { // Don't change n22_partition + label = "image-n22"; + reg = <0x140000 0xc7000>; + }; + factory_partition: partition@207000 { + label = "factory-data"; + reg = <0x207000 0x1000>; + }; + storage_partition: partition@208000 { + label = "storage"; + reg = <0x208000 0xf000>; + }; + slot1_partition: partition@217000 { + label = "image-1"; + reg = <0x217000 0x1e7000>; + }; + vendor_partition: partition@3fe000 { + label = "vendor-data"; + reg = <0x3fe000 0x2000>; + }; + }; +}; diff --git a/src/platform/telink/tlsr9258a_2m_flash.overlay b/src/platform/telink/tlsr9258a_2m_flash.overlay index a87ebba57e874b..bdfc0a45709fc1 100644 --- a/src/platform/telink/tlsr9258a_2m_flash.overlay +++ b/src/platform/telink/tlsr9258a_2m_flash.overlay @@ -1,13 +1,12 @@ &flash { reg = <0x20000000 0x200000>; + /delete-node/ partitions; partitions { - /delete-node/ partition@0; - /delete-node/ partition@20000; - /delete-node/ partition@88000; - /delete-node/ partition@f0000; - /delete-node/ partition@f4000; - /delete-node/ partition@fe000; + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + boot_partition: partition@0 { label = "mcuboot"; reg = <0x00000000 0x13000>; diff --git a/src/platform/telink/tlsr9518adk80d_1m_flash.overlay b/src/platform/telink/tlsr9518adk80d_1m_flash.overlay index 3bbd690e8e9f97..ba55da341398f5 100644 --- a/src/platform/telink/tlsr9518adk80d_1m_flash.overlay +++ b/src/platform/telink/tlsr9518adk80d_1m_flash.overlay @@ -1,13 +1,12 @@ &flash { reg = <0x20000000 0x100000>; + /delete-node/ partitions; partitions { - /delete-node/ partition@0; - /delete-node/ partition@20000; - /delete-node/ partition@88000; - /delete-node/ partition@f0000; - /delete-node/ partition@f4000; - /delete-node/ partition@fe000; + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + boot_partition: partition@0 { label = "mcuboot"; reg = <0x00000000 0x19000>; diff --git a/src/platform/telink/tlsr9518adk80d_2m_flash.overlay b/src/platform/telink/tlsr9518adk80d_2m_flash.overlay index 1d54c867bbcb79..4fd5fd13086046 100644 --- a/src/platform/telink/tlsr9518adk80d_2m_flash.overlay +++ b/src/platform/telink/tlsr9518adk80d_2m_flash.overlay @@ -1,13 +1,12 @@ &flash { reg = <0x20000000 0x200000>; + /delete-node/ partitions; partitions { - /delete-node/ partition@0; - /delete-node/ partition@20000; - /delete-node/ partition@88000; - /delete-node/ partition@f0000; - /delete-node/ partition@f4000; - /delete-node/ partition@fe000; + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + boot_partition: partition@0 { label = "mcuboot"; reg = <0x00000000 0x19000>; diff --git a/src/platform/telink/tlsr9518adk80d_4m_flash.overlay b/src/platform/telink/tlsr9518adk80d_4m_flash.overlay index 77d5bac433966a..3df4e7a62a8d08 100644 --- a/src/platform/telink/tlsr9518adk80d_4m_flash.overlay +++ b/src/platform/telink/tlsr9518adk80d_4m_flash.overlay @@ -1,13 +1,12 @@ &flash { reg = <0x20000000 0x400000>; + /delete-node/ partitions; partitions { - /delete-node/ partition@0; - /delete-node/ partition@20000; - /delete-node/ partition@88000; - /delete-node/ partition@f0000; - /delete-node/ partition@f4000; - /delete-node/ partition@fe000; + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + boot_partition: partition@0 { label = "mcuboot"; reg = <0x00000000 0x19000>; diff --git a/src/platform/telink/tlsr9528a_2m_flash.overlay b/src/platform/telink/tlsr9528a_2m_flash.overlay index 98bc72b459dd24..35d72affa95023 100644 --- a/src/platform/telink/tlsr9528a_2m_flash.overlay +++ b/src/platform/telink/tlsr9528a_2m_flash.overlay @@ -1,13 +1,12 @@ &flash { reg = <0x20000000 0x200000>; + /delete-node/ partitions; partitions { - /delete-node/ partition@0; - /delete-node/ partition@20000; - /delete-node/ partition@88000; - /delete-node/ partition@f0000; - /delete-node/ partition@f4000; - /delete-node/ partition@fe000; + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + boot_partition: partition@0 { label = "mcuboot"; reg = <0x00000000 0x13000>; diff --git a/src/platform/telink/tlsr9528a_4m_flash.overlay b/src/platform/telink/tlsr9528a_4m_flash.overlay index ec88c5742a6568..9ab2890d4a58ff 100644 --- a/src/platform/telink/tlsr9528a_4m_flash.overlay +++ b/src/platform/telink/tlsr9528a_4m_flash.overlay @@ -1,13 +1,12 @@ &flash { reg = <0x20000000 0x400000>; + /delete-node/ partitions; partitions { - /delete-node/ partition@0; - /delete-node/ partition@20000; - /delete-node/ partition@88000; - /delete-node/ partition@f0000; - /delete-node/ partition@f4000; - /delete-node/ partition@fe000; + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + boot_partition: partition@0 { label = "mcuboot"; reg = <0x00000000 0x13000>; @@ -26,23 +25,23 @@ }; dac_keypair_partition: partition@3f6000 { label = "dac-keypair"; - reg = <0x3f6000 0x1000>; //store dac and key pair. + reg = <0x3f6000 0x1000>; // store dac and key pair. }; factory_partition: partition@3f7000 { label = "factory-data"; - reg = <0x3f7000 0x1000>; // factory data info + reg = <0x3f7000 0x1000>; // factory data info. }; secure_partition: partition@3f8000 { label = "secure"; - reg = <0x3f8000 0x4000>; //secure info ,reserved for secure boot .if not use , can be used by other way . + reg = <0x3f8000 0x4000>; // secure info, reserved for secure boot. if not use, can be used by other way. }; vendor_rfu_partition: partition@3fc000 { label = "vendor-rfu"; - reg = <0x3fc000 0x2000>;// reserved for chip extend. + reg = <0x3fc000 0x2000>; // reserved for chip extend. }; vendor_partition: partition@3fe000 { label = "vendor-data"; - reg = <0x3fe000 0x2000>;// mac and adc info. + reg = <0x3fe000 0x2000>; // mac and adc info. }; }; };