diff --git a/.github/workflows/chef.yaml b/.github/workflows/chef.yaml index 76bbb9cf6da05c..c7268985a200fd 100644 --- a/.github/workflows/chef.yaml +++ b/.github/workflows/chef.yaml @@ -89,3 +89,24 @@ jobs: shell: bash run: | ./scripts/run_in_build_env.sh "./examples/chef/chef.py --ci -t nrfconnect" + + chef_telink: + name: Chef - Telink CI Examples + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build-telink:10 + options: --user root + + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: telink + - name: CI Examples Telink + shell: bash + run: | + ./scripts/run_in_build_env.sh "./examples/chef/chef.py --ci -t telink" diff --git a/.github/workflows/examples-telink.yaml b/.github/workflows/examples-telink.yaml index 07b5ddc9a10f08..f7ddf8dc340e1d 100644 --- a/.github/workflows/examples-telink.yaml +++ b/.github/workflows/examples-telink.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Project CHIP Authors +# Copyright (c) 2022-2023 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. @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-telink:1 + image: ghcr.io/project-chip/chip-build-telink:10 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" @@ -54,7 +54,7 @@ jobs: with: gh-context: ${{ toJson(github) }} - - name: Build example Telink All Clusters App + - name: Build example Telink (B91) All Clusters App run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-all-clusters' build" @@ -66,19 +66,19 @@ jobs: - name: clean out build output run: rm -rf ./out - - name: Build example Telink All Clusters Minimal App + - name: Build example Telink (B92) All Clusters Minimal App run: | ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-all-clusters-minimal' build" + "./scripts/build/build_examples.py --target 'telink-tlsr9528a-all-clusters-minimal' build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9518adk80d all-clusters-minimal-app \ - out/telink-tlsr9518adk80d-all-clusters-minimal/zephyr/zephyr.elf \ + 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 Bridge App + - name: Build example Telink (B91) Bridge App run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-bridge' build" @@ -90,70 +90,43 @@ jobs: - name: clean out build output run: rm -rf ./out - - name: Build example Telink Contact Sensor App + - name: Build example Telink (B92) Contact Sensor App run: | ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-contact-sensor' build" + "./scripts/build/build_examples.py --target 'telink-tlsr9528a-contact-sensor' build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9518adk80d contact-sensor-app \ - out/telink-tlsr9518adk80d-contact-sensor/zephyr/zephyr.elf \ + telink tlsr9528a contact-sensor-app \ + out/telink-tlsr9528a-contact-sensor/zephyr/zephyr.elf \ /tmp/bloat_reports/ - name: clean out build output run: rm -rf ./out - - name: Build example Telink Lighting App - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-light' build" - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9518adk80d lighting-app \ - out/telink-tlsr9518adk80d-light/zephyr/zephyr.elf \ - /tmp/bloat_reports/ - - - name: clean out build output - run: rm -rf ./out - - - name: Build example Telink Lighting App with RPC - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-light-rpc' build" - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9518adk80d lighting-app-rpc \ - out/telink-tlsr9518adk80d-light-rpc/zephyr/zephyr.elf \ - /tmp/bloat_reports/ - - - name: clean out build output - run: rm -rf ./out - - - name: Build example Telink Lighting App with Shell + - name: Build example Telink (B91) Lighting App with RPC, Shell and Factory Data run: | + ./scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform linux + ./scripts/build/gn_gen.sh + ./scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE chip-cert chip-tool spake2p" ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-light-shell' build" + "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-light-rpc-shell-factory-data' build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9518adk80d lighting-app-shell \ - out/telink-tlsr9518adk80d-light-shell/zephyr/zephyr.elf \ + telink tlsr9518adk80d lighting-app-rpc-shell-factory-data \ + out/telink-tlsr9518adk80d-light-rpc-shell-factory-data/zephyr/zephyr.elf \ /tmp/bloat_reports/ - - name: clean out build output - run: rm -rf ./out - - - name: Build example Telink Lighting App with Factory Data + - name: Build example Telink (B92) Lighting App with RPC, Shell and Factory Data run: | - ./scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform linux - ./scripts/build/gn_gen.sh - ./scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE chip-cert chip-tool spake2p" ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-light-factory-data' build" + "./scripts/build/build_examples.py --target 'telink-tlsr9528a-light-rpc-shell-factory-data' build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9518adk80d lighting-app-factory-data \ - out/telink-tlsr9518adk80d-light-factory-data/zephyr/zephyr.elf \ + telink tlsr9528a lighting-app-rpc-shell-factory-data \ + out/telink-tlsr9528a-light-rpc-shell-factory-data/zephyr/zephyr.elf \ /tmp/bloat_reports/ - name: clean out build output run: rm -rf ./out - - name: Build example Telink Light Switch App + - name: Build example Telink (B91) Light Switch App run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-light-switch' build" @@ -165,19 +138,19 @@ jobs: - name: clean out build output run: rm -rf ./out - - name: Build example Telink Lock App + - name: Build example Telink (B92) Lock App run: | ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-lock' build" + "./scripts/build/build_examples.py --target 'telink-tlsr9528a-lock' build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9518adk80d lock-app \ - out/telink-tlsr9518adk80d-lock/zephyr/zephyr.elf \ + telink tlsr9528a lock-app \ + out/telink-tlsr9528a-lock/zephyr/zephyr.elf \ /tmp/bloat_reports/ - name: clean out build output run: rm -rf ./out - - name: Build example Telink OTA Requestor App + - name: Build example Telink (B91) OTA Requestor App run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-ota-requestor' build" @@ -189,19 +162,19 @@ jobs: - name: clean out build output run: rm -rf ./out - - name: Build example Telink Pump App + - name: Build example Telink (B92) Pump App run: | ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-pump' build" + "./scripts/build/build_examples.py --target 'telink-tlsr9528a-pump' build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9518adk80d pump-app \ - out/telink-tlsr9518adk80d-pump/zephyr/zephyr.elf \ + telink tlsr9528a pump-app \ + out/telink-tlsr9528a-pump/zephyr/zephyr.elf \ /tmp/bloat_reports/ - name: clean out build output run: rm -rf ./out - - name: Build example Telink Pump Controller App + - name: Build example Telink (B91) Pump Controller App run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-pump-controller' build" @@ -213,7 +186,7 @@ jobs: - name: clean out build output run: rm -rf ./out - - name: Build example Telink Shell App + - name: Build example Telink (B91) Shell App run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-shell' build" @@ -225,31 +198,31 @@ jobs: - name: clean out build output run: rm -rf ./out - - name: Build example Telink Smoke CO Alarm App + - name: Build example Telink (B92) Smoke CO Alarm App run: | ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-smoke-co-alarm' build" + "./scripts/build/build_examples.py --target 'telink-tlsr9528a-smoke-co-alarm' build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9518adk80d smoke_co_alarm-app \ - out/telink-tlsr9518adk80d-smoke-co-alarm/zephyr/zephyr.elf \ + telink tlsr9528a smoke_co_alarm-app \ + out/telink-tlsr9528a-smoke-co-alarm/zephyr/zephyr.elf \ /tmp/bloat_reports/ - name: clean out build output run: rm -rf ./out - - name: Build example Telink Temperature Measurement App + - name: Build example Telink (B92) Temperature Measurement App run: | ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-temperature-measurement' build" + "./scripts/build/build_examples.py --target 'telink-tlsr9528a-temperature-measurement' build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9518adk80d temperature-measurement-app \ - out/telink-tlsr9518adk80d-temperature-measurement/zephyr/zephyr.elf \ + telink tlsr9528a temperature-measurement-app \ + out/telink-tlsr9528a-temperature-measurement/zephyr/zephyr.elf \ /tmp/bloat_reports/ - name: clean out build output run: rm -rf ./out - - name: Build example Telink Thermostat App + - name: Build example Telink (B91) Thermostat App run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-thermostat' build" @@ -261,7 +234,7 @@ jobs: - name: clean out build output run: rm -rf ./out - - name: Build example Telink Window Covering App + - name: Build example Telink (B91) Window Covering App run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-window-covering' build" diff --git a/config/telink/app/bootloader.conf b/config/telink/app/bootloader.conf index 5fb0182690cdaa..2098bc7072cb3d 100644 --- a/config/telink/app/bootloader.conf +++ b/config/telink/app/bootloader.conf @@ -16,7 +16,7 @@ # 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=n +CONFIG_BOOT_BOOTSTRAP=y # Enable this option in case if SWAP_MOVE logic need to be used CONFIG_BOOT_SWAP_USING_MOVE=y @@ -28,3 +28,21 @@ 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 + +# Maximum number of image sectors supported by the bootloader. +CONFIG_BOOT_MAX_IMG_SECTORS=4096 + +# Sets log level for modules which don't specify it explicitly. +# When set to 0 it means log will not be activated for those modules. +# Levels are: +# - 0 OFF, do not write by default +# - 1 ERROR, default to only write LOG_LEVEL_ERR +# - 2 WARNING, default to write LOG_LEVEL_WRN +# - 3 INFO, default to write LOG_LEVEL_INFO +# - 4 DEBUG, default to write LOG_LEVEL_DBG +CONFIG_LOG_DEFAULT_LEVEL=1 + +# USB DFU configuration +CONFIG_USB_DFU_WILL_DETACH=n +CONFIG_BOOT_USB_DFU_GPIO=y +CONFIG_MCUBOOT_INDICATION_LED=y diff --git a/config/telink/app/zephyr.conf b/config/telink/app/zephyr.conf index 6948ce36b083d3..47c2b88f91aa3a 100644 --- a/config/telink/app/zephyr.conf +++ b/config/telink/app/zephyr.conf @@ -1,5 +1,5 @@ # -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2021-2023 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. @@ -111,22 +111,22 @@ CONFIG_OPENTHREAD_EXTERNAL_HEAP=y # Config dynamic interrupts to have posibility to switch between BLE/Thread radio drivers CONFIG_DYNAMIC_INTERRUPTS=y -# Set multiplicator of Name Value Storage (NVS) as 16 to reach NVS sector size 4096 -# nvs_sector_size = flash_page_size * mult = 256 * 16 = 4096 -CONFIG_SETTINGS_NVS_SECTOR_SIZE_MULT=16 +# 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=1 # Enable NVS lookup cache CONFIG_NVS_LOOKUP_CACHE=y CONFIG_NVS_LOOKUP_CACHE_SIZE=2048 # Reboot system when fault happened -CONFIG_TELINK_B91_REBOOT_ON_FAULT=y +CONFIG_TELINK_B9X_REBOOT_ON_FAULT=y # Shell settings CONFIG_SHELL=n # BLE MAC address -CONFIG_B91_BLE_CTRL_MAC_FLASH_ADDR=0x1FE000 +CONFIG_B9X_BLE_CTRL_MAC_FLASH_ADDR=0x1FE000 # getopt version CONFIG_GETOPT_LONG=y diff --git a/config/telink/chip-module/CMakeLists.txt b/config/telink/chip-module/CMakeLists.txt index 26f0d58612abe8..bfb38cb5172c69 100644 --- a/config/telink/chip-module/CMakeLists.txt +++ b/config/telink/chip-module/CMakeLists.txt @@ -137,6 +137,17 @@ set_property(GLOBAL APPEND PROPERTY ZEPHYR_INTERFACE_LIBS chip) # Define 'chip-ota-image' target for building CHIP OTA image # ============================================================================== + +if(${TLNK_USB_DONGLE} MATCHES y) + if(EXISTS "${CHIP_ROOT}/src/platform/telink/${BOARD}_usb_boot.overlay") + set(USB_BOOT_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${BOARD}_usb_boot.overlay") + else() + unset(USB_BOOT_DTC_OVERLAY_FILE) + endif() +else() + unset(USB_BOOT_DTC_OVERLAY_FILE) +endif() + if(EXISTS "${CHIP_ROOT}/src/platform/telink/${BOARD}.overlay") set(GLOBAL_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${BOARD}.overlay") else() @@ -153,14 +164,14 @@ if (CONFIG_CHIP_OTA_IMAGE_BUILD) add_custom_target(build_mcuboot ALL COMMAND west build -b ${BOARD} -d build_mcuboot ${ZEPHYR_BASE}/../bootloader/mcuboot/boot/zephyr - -- -DOVERLAY_CONFIG=${GLOBAL_BOOTLOADER_CONF_OVERLAY_FILE} -DDTC_OVERLAY_FILE=${GLOBAL_DTC_OVERLAY_FILE} + -- -DOVERLAY_CONFIG=${GLOBAL_BOOTLOADER_CONF_OVERLAY_FILE} -DDTC_OVERLAY_FILE="${GLOBAL_DTC_OVERLAY_FILE};${USB_BOOT_DTC_OVERLAY_FILE}" ) add_custom_target(merge_mcuboot ALL COMMAND dd if=${PROJECT_BINARY_DIR}/../modules/chip-module/build_mcuboot/zephyr/zephyr.bin of=${PROJECT_BINARY_DIR}/zephyr.bin COMMAND - dd if=${PROJECT_BINARY_DIR}/zephyr.signed.bin of=${PROJECT_BINARY_DIR}/zephyr.bin bs=1024 seek=76 + dd if=${PROJECT_BINARY_DIR}/zephyr.signed.bin of=${PROJECT_BINARY_DIR}/zephyr.bin bs=1024 seek=100 ) chip_ota_image(chip-ota-image @@ -175,7 +186,7 @@ endif() if (CONFIG_CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE) add_custom_target(merge_factory_data ALL COMMAND - dd if=${PROJECT_BINARY_DIR}/factory/factory_data.bin of=${PROJECT_BINARY_DIR}/zephyr.bin bs=1024 seek=1040 + dd if=${PROJECT_BINARY_DIR}/factory/factory_data.bin of=${PROJECT_BINARY_DIR}/zephyr.bin bs=1024 seek=1052 ) if (CONFIG_CHIP_OTA_IMAGE_BUILD) add_dependencies(merge_factory_data merge_mcuboot) diff --git a/examples/all-clusters-app/telink/CMakeLists.txt b/examples/all-clusters-app/telink/CMakeLists.txt index aacc82ddc06b25..7ca03211176776 100644 --- a/examples/all-clusters-app/telink/CMakeLists.txt +++ b/examples/all-clusters-app/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) diff --git a/examples/all-clusters-app/telink/Readme.md b/examples/all-clusters-app/telink/Readme.md index e05afa4e3a1e30..3684a8cf432eb2 100644 --- a/examples/all-clusters-app/telink/Readme.md +++ b/examples/all-clusters-app/telink/Readme.md @@ -11,31 +11,32 @@ creating your own application. 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/all-clusters-minimal-app/telink/CMakeLists.txt b/examples/all-clusters-minimal-app/telink/CMakeLists.txt index 410f305c3b317a..d852f1534d0d73 100644 --- a/examples/all-clusters-minimal-app/telink/CMakeLists.txt +++ b/examples/all-clusters-minimal-app/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) diff --git a/examples/all-clusters-minimal-app/telink/Readme.md b/examples/all-clusters-minimal-app/telink/Readme.md index 66eda43b732c9b..96d8dfc751ccf1 100644 --- a/examples/all-clusters-minimal-app/telink/Readme.md +++ b/examples/all-clusters-minimal-app/telink/Readme.md @@ -11,31 +11,32 @@ for creating your own application. 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/bridge-app/telink/CMakeLists.txt b/examples/bridge-app/telink/CMakeLists.txt index 46953af249d8b7..58ed38fd93ba89 100644 --- a/examples/bridge-app/telink/CMakeLists.txt +++ b/examples/bridge-app/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) diff --git a/examples/bridge-app/telink/README.md b/examples/bridge-app/telink/README.md index 7fe72ca3e5fa26..159516fcf9e476 100644 --- a/examples/bridge-app/telink/README.md +++ b/examples/bridge-app/telink/README.md @@ -88,31 +88,32 @@ defined: 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/bridge-app/telink/prj.conf b/examples/bridge-app/telink/prj.conf index 72b6dce7e2866c..ec4db478cf33b4 100644 --- a/examples/bridge-app/telink/prj.conf +++ b/examples/bridge-app/telink/prj.conf @@ -66,5 +66,5 @@ CONFIG_CHIP_CERTIFICATION_DECLARATION_STORAGE=n CONFIG_PM=n # Custom RF power values -CONFIG_B91_BLE_CTRL_RF_POWER_P9P11DBM=y +CONFIG_B9X_BLE_CTRL_RF_POWER_P9P11DBM=y CONFIG_OPENTHREAD_DEFAULT_TX_POWER=9 diff --git a/examples/chef/chef.py b/examples/chef/chef.py index 7e1b6238c69484..841eed2001cf6b 100755 --- a/examples/chef/chef.py +++ b/examples/chef/chef.py @@ -248,6 +248,25 @@ def bundle_esp32(device_name: str) -> None: shutil.copy(src_item, dest_item) +def bundle_telink(device_name: str) -> None: + zephyr_exts = ["elf", "map", "bin"] + telink_root = os.path.join(_CHEF_SCRIPT_PATH, + "telink", + "build", + "zephyr") + sub_dir = os.path.join(_CD_STAGING_DIR, device_name) + os.mkdir(sub_dir) + for zephyr_ext in zephyr_exts: + input_base = f"zephyr.{zephyr_ext}" + output_base = f"{device_name}.{zephyr_ext}" + src_item = os.path.join(telink_root, input_base) + if zephyr_ext == "bin": + dest_item = os.path.join(sub_dir, output_base) + else: + dest_item = os.path.join(_CD_STAGING_DIR, output_base) + shutil.copy(src_item, dest_item) + + def main() -> int: check_python_version() diff --git a/examples/chef/telink/prj.conf b/examples/chef/telink/prj.conf index d83c730a8f61e2..2aa9402f0f1881 100755 --- a/examples/chef/telink/prj.conf +++ b/examples/chef/telink/prj.conf @@ -68,5 +68,5 @@ CONFIG_CHIP_CERTIFICATION_DECLARATION_STORAGE=n CONFIG_PM=n # Custom RF power values -CONFIG_B91_BLE_CTRL_RF_POWER_P9P11DBM=y +CONFIG_B9X_BLE_CTRL_RF_POWER_P9P11DBM=y CONFIG_OPENTHREAD_DEFAULT_TX_POWER=9 diff --git a/examples/contact-sensor-app/telink/CMakeLists.txt b/examples/contact-sensor-app/telink/CMakeLists.txt index 3f6a32566a3bba..2a6e63cbc284da 100755 --- a/examples/contact-sensor-app/telink/CMakeLists.txt +++ b/examples/contact-sensor-app/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) diff --git a/examples/contact-sensor-app/telink/README.md b/examples/contact-sensor-app/telink/README.md index ec755135003da3..21c3c045f23f2d 100755 --- a/examples/contact-sensor-app/telink/README.md +++ b/examples/contact-sensor-app/telink/README.md @@ -9,31 +9,32 @@ You can use this example as a reference for creating your own application. 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/light-switch-app/telink/CMakeLists.txt b/examples/light-switch-app/telink/CMakeLists.txt index 18a5f83ac1ebbf..d05508812f04e9 100755 --- a/examples/light-switch-app/telink/CMakeLists.txt +++ b/examples/light-switch-app/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) diff --git a/examples/light-switch-app/telink/README.md b/examples/light-switch-app/telink/README.md index 6b44caa1e0ba50..6e0cda2bcbf644 100755 --- a/examples/light-switch-app/telink/README.md +++ b/examples/light-switch-app/telink/README.md @@ -14,31 +14,32 @@ creating your own application. 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/lighting-app/telink/CMakeLists.txt b/examples/lighting-app/telink/CMakeLists.txt index 16f6dfb4244663..986338c723651b 100644 --- a/examples/lighting-app/telink/CMakeLists.txt +++ b/examples/lighting-app/telink/CMakeLists.txt @@ -15,12 +15,27 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) +set(ignoreMe "${TLNK_USB_DONGLE}") + +if(${TLNK_USB_DONGLE} MATCHES y) + if(EXISTS "${CHIP_ROOT}/src/platform/telink/${BOARD}_usb.overlay") + set(USB_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${BOARD}_usb.overlay") + else() + unset(USB_DTC_OVERLAY_FILE) + endif() + if(EXISTS "${CHIP_ROOT}/src/platform/telink/${BOARD}_usb.conf") + set(USB_CONF_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${BOARD}_usb.conf") + else() + unset(USB_CONF_OVERLAY_FILE) + endif() +else() + unset(USB_CONF_OVERLAY_FILE) +endif() + if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD}.overlay") set(LOCAL_DTC_OVERLAY_FILE "${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD}.overlay") else() @@ -35,14 +50,14 @@ endif() if(DTC_OVERLAY_FILE) set(DTC_OVERLAY_FILE - "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" + "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${USB_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" CACHE STRING "" FORCE ) else() - set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) + set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${USB_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) endif() -set(CONF_FILE ${CHIP_ROOT}/config/telink/app/zephyr.conf prj.conf) +set(CONF_FILE ${CHIP_ROOT}/config/telink/app/zephyr.conf ${USB_CONF_OVERLAY_FILE} prj.conf) # Load NCS/Zephyr build system list(APPEND ZEPHYR_EXTRA_MODULES ${CHIP_ROOT}/config/telink/chip-module) diff --git a/examples/lighting-app/telink/README.md b/examples/lighting-app/telink/README.md index 286f289303500f..e774a8b1ecf87a 100644 --- a/examples/lighting-app/telink/README.md +++ b/examples/lighting-app/telink/README.md @@ -12,31 +12,32 @@ a reference for creating your own application. 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/lighting-app/telink/prj.conf b/examples/lighting-app/telink/prj.conf index 71a134523d33c8..141f820ae003dc 100644 --- a/examples/lighting-app/telink/prj.conf +++ b/examples/lighting-app/telink/prj.conf @@ -66,5 +66,5 @@ CONFIG_CHIP_CERTIFICATION_DECLARATION_STORAGE=n CONFIG_PM=n # Custom RF power values -CONFIG_B91_BLE_CTRL_RF_POWER_P9P11DBM=y +CONFIG_B9X_BLE_CTRL_RF_POWER_P9P11DBM=y CONFIG_OPENTHREAD_DEFAULT_TX_POWER=9 \ No newline at end of file diff --git a/examples/lock-app/telink/CMakeLists.txt b/examples/lock-app/telink/CMakeLists.txt index 98b3e5de27e567..66f5e432f96d92 100755 --- a/examples/lock-app/telink/CMakeLists.txt +++ b/examples/lock-app/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) diff --git a/examples/lock-app/telink/README.md b/examples/lock-app/telink/README.md index 466e053b2a9944..b215fa543839dc 100755 --- a/examples/lock-app/telink/README.md +++ b/examples/lock-app/telink/README.md @@ -12,31 +12,32 @@ a reference for creating your own application. 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/ota-requestor-app/telink/CMakeLists.txt b/examples/ota-requestor-app/telink/CMakeLists.txt index f9dcafa515b74a..5d88c0c504121f 100644 --- a/examples/ota-requestor-app/telink/CMakeLists.txt +++ b/examples/ota-requestor-app/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) diff --git a/examples/ota-requestor-app/telink/Readme.md b/examples/ota-requestor-app/telink/Readme.md index b072547d9e5a27..c04bbfcb463550 100755 --- a/examples/ota-requestor-app/telink/Readme.md +++ b/examples/ota-requestor-app/telink/Readme.md @@ -5,31 +5,32 @@ 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/platform/telink/common/src/AppTaskCommon.cpp b/examples/platform/telink/common/src/AppTaskCommon.cpp index 3a831ea0ef8fce..969f3c14638ae3 100644 --- a/examples/platform/telink/common/src/AppTaskCommon.cpp +++ b/examples/platform/telink/common/src/AppTaskCommon.cpp @@ -202,8 +202,8 @@ class PlatformMgrDelegate : public DeviceLayer::PlatformManagerDelegate }; #if CONFIG_CHIP_LIB_SHELL -#include #include +#include static int cmd_telink_reboot(const struct shell * shell, size_t argc, char ** argv) { @@ -211,7 +211,7 @@ static int cmd_telink_reboot(const struct shell * shell, size_t argc, char ** ar ARG_UNUSED(argv); shell_print(shell, "Performing board reboot..."); - sys_reboot(); + sys_reboot(0); return 0; } diff --git a/examples/platform/telink/common/src/mainCommon.cpp b/examples/platform/telink/common/src/mainCommon.cpp index 63c41b3a211982..d88a6a981dd985 100644 --- a/examples/platform/telink/common/src/mainCommon.cpp +++ b/examples/platform/telink/common/src/mainCommon.cpp @@ -23,10 +23,18 @@ #include +#ifdef CONFIG_USB_DEVICE_STACK +#include +#endif /* CONFIG_USB_DEVICE_STACK */ + #ifdef CONFIG_CHIP_PW_RPC #include "Rpc.h" #endif +#ifdef CONFIG_BOOTLOADER_MCUBOOT +#include +#endif /* CONFIG_BOOTLOADER_MCUBOOT */ + LOG_MODULE_REGISTER(app, CONFIG_CHIP_APP_LOG_LEVEL); using namespace ::chip; @@ -94,6 +102,10 @@ static void FactoryResetOnBoot(void) int main(void) { +#if defined(CONFIG_USB_DEVICE_STACK) && !defined(CONFIG_CHIP_PW_RPC) + usb_enable(NULL); +#endif /* CONFIG_USB_DEVICE_STACK */ + CHIP_ERROR err = CHIP_NO_ERROR; #ifdef CONFIG_CHIP_PW_RPC @@ -143,6 +155,21 @@ int main(void) goto exit; } +#ifdef CONFIG_BOOTLOADER_MCUBOOT + if (mcuboot_swap_type() == BOOT_SWAP_TYPE_REVERT) + { + int img_confirmation = boot_write_img_confirmed(); + if (img_confirmation) + { + LOG_ERR("Image not confirmed %d. Will be reverted!", img_confirmation); + } + else + { + LOG_INF("Image confirmed"); + } + } +#endif /* CONFIG_BOOTLOADER_MCUBOOT */ + err = GetAppTask().StartApp(); exit: diff --git a/examples/platform/telink/pw_sys_io/sys_io_telink.cc b/examples/platform/telink/pw_sys_io/sys_io_telink.cc index ff40aeadd6e583..4241e191110cea 100644 --- a/examples/platform/telink/pw_sys_io/sys_io_telink.cc +++ b/examples/platform/telink/pw_sys_io/sys_io_telink.cc @@ -22,17 +22,28 @@ #include #include -#ifdef CONFIG_USB +#ifdef CONFIG_USB_DEVICE_STACK #include + +static bool output_enable = false; + +static void usb_dc_status_change(enum usb_dc_status_code cb_status, const uint8_t * param) +{ + (void) param; + if (cb_status == USB_DC_CONFIGURED) + { + output_enable = true; + } +} #endif extern "C" void pw_sys_io_Init() { int err; -#ifdef CONFIG_USB - err = usb_enable(nullptr); - assert(err == 0); +#ifdef CONFIG_USB_DEVICE_STACK + output_enable = false; + (void) usb_enable(usb_dc_status_change); #endif err = console_init(); @@ -54,6 +65,10 @@ Status ReadByte(std::byte * dest) Status WriteByte(std::byte b) { +#ifdef CONFIG_USB_DEVICE_STACK + if (!output_enable) + return Status::FailedPrecondition(); +#endif return console_putchar(static_cast(b)) < 0 ? Status::FailedPrecondition() : OkStatus(); } diff --git a/examples/pump-app/telink/CMakeLists.txt b/examples/pump-app/telink/CMakeLists.txt index 03f3012008517b..70886f44fa82b4 100755 --- a/examples/pump-app/telink/CMakeLists.txt +++ b/examples/pump-app/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) diff --git a/examples/pump-app/telink/README.md b/examples/pump-app/telink/README.md index 8b0dbda6b2add5..3500672a41720f 100755 --- a/examples/pump-app/telink/README.md +++ b/examples/pump-app/telink/README.md @@ -13,31 +13,32 @@ reference for creating your own pump application. 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/pump-controller-app/telink/CMakeLists.txt b/examples/pump-controller-app/telink/CMakeLists.txt index d5eeb88ee6d202..d45b4c8018bb77 100755 --- a/examples/pump-controller-app/telink/CMakeLists.txt +++ b/examples/pump-controller-app/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) diff --git a/examples/pump-controller-app/telink/README.md b/examples/pump-controller-app/telink/README.md index 1e17a923ff896f..ab73fabc6346af 100755 --- a/examples/pump-controller-app/telink/README.md +++ b/examples/pump-controller-app/telink/README.md @@ -14,31 +14,32 @@ your own pump application. 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/shell/telink/CMakeLists.txt b/examples/shell/telink/CMakeLists.txt index debe82e67ee2cd..0c95e739097f63 100755 --- a/examples/shell/telink/CMakeLists.txt +++ b/examples/shell/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) get_filename_component(APP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/.. REALPATH) diff --git a/examples/shell/telink/README.md b/examples/shell/telink/README.md index ffbfce8a1867d3..d4a3c43e875180 100755 --- a/examples/shell/telink/README.md +++ b/examples/shell/telink/README.md @@ -9,31 +9,32 @@ You can use this example as a reference for creating your own application. 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/shell/telink/prj.conf b/examples/shell/telink/prj.conf index 3abb915e850fcd..7814bceb6be45c 100755 --- a/examples/shell/telink/prj.conf +++ b/examples/shell/telink/prj.conf @@ -69,5 +69,5 @@ CONFIG_CHIP_CERTIFICATION_DECLARATION_STORAGE=n CONFIG_PM=n # Custom RF power values -CONFIG_B91_BLE_CTRL_RF_POWER_P9P11DBM=y +CONFIG_B9X_BLE_CTRL_RF_POWER_P9P11DBM=y CONFIG_OPENTHREAD_DEFAULT_TX_POWER=9 diff --git a/examples/smoke-co-alarm-app/telink/CMakeLists.txt b/examples/smoke-co-alarm-app/telink/CMakeLists.txt index d6fa3994a89962..6df4292b041645 100755 --- a/examples/smoke-co-alarm-app/telink/CMakeLists.txt +++ b/examples/smoke-co-alarm-app/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) diff --git a/examples/smoke-co-alarm-app/telink/README.md b/examples/smoke-co-alarm-app/telink/README.md index 02f78a25560065..20d4672b5688df 100755 --- a/examples/smoke-co-alarm-app/telink/README.md +++ b/examples/smoke-co-alarm-app/telink/README.md @@ -9,31 +9,32 @@ You can use this example as a reference for creating your own application. 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/smoke-co-alarm-app/telink/prj.conf b/examples/smoke-co-alarm-app/telink/prj.conf index 637c9bf1d752e1..819051b9b1cf05 100755 --- a/examples/smoke-co-alarm-app/telink/prj.conf +++ b/examples/smoke-co-alarm-app/telink/prj.conf @@ -66,5 +66,5 @@ CONFIG_CHIP_CERTIFICATION_DECLARATION_STORAGE=n CONFIG_PM=y # Custom RF power values -CONFIG_B91_BLE_CTRL_RF_POWER_P9P11DBM=y +CONFIG_B9X_BLE_CTRL_RF_POWER_P9P11DBM=y CONFIG_OPENTHREAD_DEFAULT_TX_POWER=9 diff --git a/examples/temperature-measurement-app/telink/CMakeLists.txt b/examples/temperature-measurement-app/telink/CMakeLists.txt index 022eef1d319bce..35e0815a19f083 100644 --- a/examples/temperature-measurement-app/telink/CMakeLists.txt +++ b/examples/temperature-measurement-app/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) diff --git a/examples/temperature-measurement-app/telink/README.md b/examples/temperature-measurement-app/telink/README.md index 964c0f27d39b2f..ac6fec9325e39c 100644 --- a/examples/temperature-measurement-app/telink/README.md +++ b/examples/temperature-measurement-app/telink/README.md @@ -13,31 +13,32 @@ creating your own application. 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/temperature-measurement-app/telink/prj.conf b/examples/temperature-measurement-app/telink/prj.conf index 63deb05cbddfcb..fe19cab9f70ad2 100644 --- a/examples/temperature-measurement-app/telink/prj.conf +++ b/examples/temperature-measurement-app/telink/prj.conf @@ -66,5 +66,5 @@ CONFIG_CHIP_CERTIFICATION_DECLARATION_STORAGE=n CONFIG_PM=y # Custom RF power values -CONFIG_B91_BLE_CTRL_RF_POWER_P9P11DBM=y +CONFIG_B9X_BLE_CTRL_RF_POWER_P9P11DBM=y CONFIG_OPENTHREAD_DEFAULT_TX_POWER=9 diff --git a/examples/thermostat/telink/CMakeLists.txt b/examples/thermostat/telink/CMakeLists.txt index 63744747849bfe..58b4c58485a57f 100755 --- a/examples/thermostat/telink/CMakeLists.txt +++ b/examples/thermostat/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) diff --git a/examples/thermostat/telink/Readme.md b/examples/thermostat/telink/Readme.md index fdd4730c6f831a..905217a94a1ab8 100755 --- a/examples/thermostat/telink/Readme.md +++ b/examples/thermostat/telink/Readme.md @@ -9,31 +9,32 @@ You can use this example as a reference for creating your own application. 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/window-app/telink/CMakeLists.txt b/examples/window-app/telink/CMakeLists.txt index ef7801e3728e6c..d4ca74d955d2db 100644 --- a/examples/window-app/telink/CMakeLists.txt +++ b/examples/window-app/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) diff --git a/examples/window-app/telink/README.md b/examples/window-app/telink/README.md index 9fef8eaa8972b1..7445e330a496d2 100644 --- a/examples/window-app/telink/README.md +++ b/examples/window-app/telink/README.md @@ -12,31 +12,32 @@ for creating your own application. 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/window-app/telink/prj.conf b/examples/window-app/telink/prj.conf index 753040f73c6086..2a65b939cf343c 100644 --- a/examples/window-app/telink/prj.conf +++ b/examples/window-app/telink/prj.conf @@ -65,5 +65,5 @@ CONFIG_CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE=n CONFIG_PM=y # Custom RF power values -CONFIG_B91_BLE_CTRL_RF_POWER_P9P11DBM=y +CONFIG_B9X_BLE_CTRL_RF_POWER_P9P11DBM=y CONFIG_OPENTHREAD_DEFAULT_TX_POWER=9 diff --git a/integrations/cloudbuild/build-all.yaml b/integrations/cloudbuild/build-all.yaml index a1a8a1832d8726..dc66ec8eda7eb1 100644 --- a/integrations/cloudbuild/build-all.yaml +++ b/integrations/cloudbuild/build-all.yaml @@ -163,6 +163,7 @@ steps: --target qpg-qpg6105-light --target qpg-qpg6105-shell --target telink-tlsr9518adk80d-light + --target telink-tlsr9528a-light --target tizen-arm-light build --create-archives /workspace/artifacts/ diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index 7f8f3812b95e01..0414a7e820fce7 100755 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -674,8 +674,11 @@ def BuildGenioTarget(): def BuildTelinkTarget(): target = BuildTarget('telink', TelinkBuilder) - target.AppendFixedTargets( - [TargetPart('tlsr9518adk80d', board=TelinkBoard.TLSR9518ADK80D)]) + + target.AppendFixedTargets([ + TargetPart('tlsr9518adk80d', board=TelinkBoard.TLSR9518ADK80D), + TargetPart('tlsr9528a', board=TelinkBoard.TLSR9528A), + ]) target.AppendFixedTargets([ TargetPart('all-clusters', app=TelinkApp.ALL_CLUSTERS), diff --git a/scripts/build/builders/telink.py b/scripts/build/builders/telink.py index f023207146712c..754bc077f46254 100644 --- a/scripts/build/builders/telink.py +++ b/scripts/build/builders/telink.py @@ -108,10 +108,13 @@ def AppNamePrefix(self): class TelinkBoard(Enum): TLSR9518ADK80D = auto() + TLSR9528A = auto() def GnArgName(self): if self == TelinkBoard.TLSR9518ADK80D: return 'tlsr9518adk80d' + elif self == TelinkBoard.TLSR9528A: + return 'tlsr9528a' else: raise Exception('Unknown board type: %r' % self) @@ -122,7 +125,7 @@ def __init__(self, root, runner, app: TelinkApp = TelinkApp, - board: TelinkBoard = TelinkBoard.TLSR9518ADK80D, + board: TelinkBoard = TelinkBoard, enable_shell: bool = False, enable_rpcs: bool = False, enable_factory_data: bool = False): diff --git a/scripts/build/testdata/all_targets_linux_x64.txt b/scripts/build/testdata/all_targets_linux_x64.txt index 44ca9c3fe2480d..7e945289bcb21c 100644 --- a/scripts/build/testdata/all_targets_linux_x64.txt +++ b/scripts/build/testdata/all_targets_linux_x64.txt @@ -22,5 +22,5 @@ nrf-native-posix-64-tests qpg-qpg6105-{lock,light,shell,persistent-storage} stm32-stm32wb5mm-dk-light tizen-arm-{all-clusters,all-clusters-minimal,chip-tool,light,tests}[-no-ble][-no-thread][-no-wifi][-asan][-ubsan] -telink-tlsr9518adk80d-{all-clusters,all-clusters-minimal,bridge,contact-sensor,light,light-switch,lock,ota-requestor,pump,pump-controller,shell,smoke-co-alarm,temperature-measurement,thermostat,window-covering}[-shell][-rpc][-factory-data] +telink-{tlsr9518adk80d,tlsr9528a}-{all-clusters,all-clusters-minimal,bridge,contact-sensor,light,light-switch,lock,ota-requestor,pump,pump-controller,shell,smoke-co-alarm,temperature-measurement,thermostat,window-covering}[-shell][-rpc][-factory-data] openiotsdk-{shell,lock}[-mbedtls][-psa] diff --git a/scripts/tools/telink/mfg_tool.py b/scripts/tools/telink/mfg_tool.py index 286648c37185d8..3725707d7c9c78 100644 --- a/scripts/tools/telink/mfg_tool.py +++ b/scripts/tools/telink/mfg_tool.py @@ -642,7 +642,7 @@ def base64_str(s): return base64.b64decode(s) basic_args.add_argument('--part_number', type=str, required=False, help='Provide human-readable product number') part_gen_args = parser.add_argument_group('Partition generator options') - part_gen_args.add_argument('--offset', type=allow_any_int, default=0x104000, + part_gen_args.add_argument('--offset', type=allow_any_int, default=0x107000, help='Partition offset - an address in devices NVM memory, where factory data will be stored') part_gen_args.add_argument('--size', type=allow_any_int, default=0x1000, help='The maximum partition size') diff --git a/scripts/tools/telink/readme.md b/scripts/tools/telink/readme.md index 1ee492c2ffc695..37e0418342436d 100644 --- a/scripts/tools/telink/readme.md +++ b/scripts/tools/telink/readme.md @@ -188,7 +188,7 @@ You can try one of these factory partition FW on developing stage. > [v1.0-branch](https://github.com/telink-semi/zephyr/blob/telink_matter_v1.0-branch/boards/riscv/tlsr9518adk80d/tlsr9518adk80d.dts) > is `0xF4000` and for > [master branch](https://github.com/telink-semi/zephyr/blob/telink_matter/boards/riscv/tlsr9518adk80d/tlsr9518adk80d.dts) - > is `0x104000`. You can check the `factory_partition` reg at + > is `0x107000`. You can check the `factory_partition` reg at > `tlsr9518adk80d.dts` for details. For example, the `factory_data_bin` with serial number diff --git a/src/platform/Zephyr/ThreadStackManagerImpl.h b/src/platform/Zephyr/ThreadStackManagerImpl.h index d9a9020dfadf5c..1345a9ba27bc5a 100644 --- a/src/platform/Zephyr/ThreadStackManagerImpl.h +++ b/src/platform/Zephyr/ThreadStackManagerImpl.h @@ -29,9 +29,9 @@ #include #include -#if !CONFIG_SOC_SERIES_RISCV_TELINK_B91 +#if !CONFIG_SOC_SERIES_RISCV_TELINK_B9X #include -#endif // !CONFIG_SOC_SERIES_RISCV_TELINK_B91 +#endif // !CONFIG_SOC_SERIES_RISCV_TELINK_B9X #include diff --git a/src/platform/telink/ThreadStackManagerImpl.h b/src/platform/telink/ThreadStackManagerImpl.h index 508382332072c6..d1040542f3c616 100644 --- a/src/platform/telink/ThreadStackManagerImpl.h +++ b/src/platform/telink/ThreadStackManagerImpl.h @@ -29,9 +29,9 @@ #include #include -#if !CONFIG_SOC_SERIES_RISCV_TELINK_B91 +#if !CONFIG_SOC_SERIES_RISCV_TELINK_B9X #include -#endif // !CONFIG_SOC_SERIES_RISCV_TELINK_B91 +#endif // !CONFIG_SOC_SERIES_RISCV_TELINK_B9X #include diff --git a/src/platform/telink/tlsr9518adk80d.overlay b/src/platform/telink/tlsr9518adk80d.overlay index 22b5ac801ac974..32fbb3f5661809 100644 --- a/src/platform/telink/tlsr9518adk80d.overlay +++ b/src/platform/telink/tlsr9518adk80d.overlay @@ -61,16 +61,16 @@ &pinctrl { pwm_ch0_pb4_default: pwm_ch0_pb4_default { - pinmux = ; + pinmux = ; }; pwm_ch1_pb5_default: pwm_ch1_pb5_default { - pinmux = ; + pinmux = ; }; pwm_ch2_pe2_default: pwm_ch2_pe2_default { - pinmux = ; + pinmux = ; }; pwm_ch3_pe0_default: pwm_ch3_pe0_default { - pinmux = ; + pinmux = ; }; }; @@ -83,30 +83,30 @@ partitions { /delete-node/ partition@0; - /delete-node/ partition@18000; - /delete-node/ partition@84000; + /delete-node/ partition@20000; + /delete-node/ partition@88000; /delete-node/ partition@f0000; /delete-node/ partition@f4000; boot_partition: partition@0 { label = "mcuboot"; - reg = <0x00000000 0x13000>; + reg = <0x00000000 0x19000>; }; - slot0_partition: partition@13000 { + slot0_partition: partition@19000 { label = "image-0"; - reg = <0x13000 0xf1000>; + reg = <0x19000 0xee000>; }; - factory_partition: partition@104000 { + factory_partition: partition@107000 { label = "factory-data"; - reg = <0x104000 0x1000>; + reg = <0x107000 0x1000>; }; - storage_partition: partition@105000 { + storage_partition: partition@108000 { label = "storage"; - reg = <0x105000 0x8000>; + reg = <0x108000 0x8000>; }; - slot1_partition: partition@10d000 { + slot1_partition: partition@110000 { label = "image-1"; - reg = <0x10d000 0xf1000>; + reg = <0x110000 0xee000>; }; /* region <0x1fe000 0x2000> is reserved for Telink B91 SDK's data */ }; -}; \ No newline at end of file +}; diff --git a/src/platform/telink/tlsr9518adk80d_usb.conf b/src/platform/telink/tlsr9518adk80d_usb.conf new file mode 100644 index 00000000000000..3e0b1849d2969c --- /dev/null +++ b/src/platform/telink/tlsr9518adk80d_usb.conf @@ -0,0 +1,4 @@ +CONFIG_USB_DEVICE_STACK=y +CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=n +CONFIG_USB_CDC_ACM_LOG_LEVEL_OFF=y +CONFIG_CHIP_BUTTON_MANAGER_IRQ_MODE=y diff --git a/src/platform/telink/tlsr9518adk80d_usb.overlay b/src/platform/telink/tlsr9518adk80d_usb.overlay new file mode 100644 index 00000000000000..f2523794a0d110 --- /dev/null +++ b/src/platform/telink/tlsr9518adk80d_usb.overlay @@ -0,0 +1,99 @@ +/ { + chosen { + zephyr,console = &cdc_acm_uart0; + zephyr,shell-uart = &cdc_acm_uart0; + }; + + keys { + /delete-node/ button_1; + /delete-node/ button_2; + /delete-node/ button_3; + /delete-node/ button_4; + + key_1: button_1 { + gpios = <&gpiob 2 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + }; + key_2: button_2 { + gpios = <&gpioc 3 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + }; + key_3: button_3 { + gpios = <&gpioc 4 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + }; + key_4: button_4 { + gpios = <&gpiob 3 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + }; + }; + + pwm_leds { + /delete-node/ pwm_led_0; + /delete-node/ pwm_led_1; + /delete-node/ pwm_led_2; + /delete-node/ pwm_led_3; + + pwm_led0: pwm_led_0 { + pwms = <&pwm0 2 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + label = "PWM LED Blue"; + }; + pwm_led1: pwm_led_1 { + pwms = <&pwm0 5 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + label = "PWM LED Green"; + }; + pwm_led2: pwm_led_2 { + pwms = <&pwm0 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + label = "PWM LED Red"; + }; + pwm_led3: pwm_led_3 { + pwms = <&pwm0 3 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + label = "PWM IDENTIFY LED White"; + }; + }; + + aliases { + system-state-led = &led_yellow; + }; + + leds { + led_yellow: led_yellow { + gpios = <&gpiob 5 GPIO_ACTIVE_HIGH>; + label = "LED Yellow"; + }; + }; +}; + +&pinctrl { + pwm_ch2_pb7_default: pwm_ch2_pb7_default { + pinmux = ; + }; + pwm_ch5_pb0_default: pwm_ch5_pb0_default { + pinmux = ; + }; + pwm_ch0_pb4_default: pwm_ch0_pb4_default { + pinmux = ; + }; + pwm_ch3_pb1_default: pwm_ch3_pb1_default { + pinmux = ; + }; +}; + +&pwm0 { + pinctrl-0 = <&pwm_ch2_pb7_default &pwm_ch5_pb0_default &pwm_ch0_pb4_default &pwm_ch3_pb1_default>; +}; + + +&zephyr_udc0 { + cdc_acm_uart0: cdc_acm_uart0 { + compatible = "zephyr,cdc-acm-uart"; + }; +}; + +&uart0 { + pinctrl-0 = <&uart0_tx_pa3_default &uart0_rx_pa4_default>; +}; + +&gpiob { + interrupts = <37 1>; +}; + +&gpioc { + interrupts = <38 1>; +}; diff --git a/src/platform/telink/tlsr9518adk80d_usb_boot.overlay b/src/platform/telink/tlsr9518adk80d_usb_boot.overlay new file mode 100644 index 00000000000000..7eeb3a96eb6e50 --- /dev/null +++ b/src/platform/telink/tlsr9518adk80d_usb_boot.overlay @@ -0,0 +1,23 @@ +/ { + leds { + /delete-node/ led_0; + + led_blue: led_0 { + gpios = <&gpiob 7 GPIO_ACTIVE_HIGH>; + label = "LED Blue"; + }; + }; + + keys { + /delete-node/ button_dfu; + + key_dfu: button_dfu { + label = "USB DFU"; + gpios = <&gpiob 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + }; + }; +}; + +&uart0 { + pinctrl-0 = <&uart0_tx_pa3_default &uart0_rx_pa4_default>; +}; diff --git a/src/platform/telink/tlsr9528a.overlay b/src/platform/telink/tlsr9528a.overlay new file mode 100644 index 00000000000000..996981e6834b0b --- /dev/null +++ b/src/platform/telink/tlsr9528a.overlay @@ -0,0 +1,112 @@ +/ { + aliases { + system-state-led = &led_red; + pwm-led0 = &pwm_led0; + pwm-led1 = &pwm_led1; + pwm-led2 = &pwm_led2; + pwm-led3 = &pwm_led3; + }; + + pwm_leds { + /delete-node/ pwm_led_0; + pwm_led0: pwm_led_0 { + pwms = <&pwm0 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + label = "PWM LED Blue"; + }; + pwm_led1: pwm_led_1 { + pwms = <&pwm0 3 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + label = "PWM LED Green"; + }; + pwm_led2: pwm_led_2 { + pwms = <&pwm0 2 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + label = "PWM LED Red"; + }; + pwm_led3: pwm_led_3 { + pwms = <&pwm0 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + label = "PWM IDENTIFY LED Green"; + }; + }; + + keys { + /delete-node/ button_1; + /delete-node/ button_3; + compatible = "gpio-keys"; + key_1: button_1 { + gpios = <&gpiod 2 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + }; + key_2: button_2 { + gpios = <&gpiod 7 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + }; + key_3: button_3 { + gpios = <&gpiod 6 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + }; + key_4: button_4 { + gpios = <&gpiof 6 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + }; + + key_matrix_col1: key_matrix_col1 { + gpios = <&gpiod 6 GPIO_ACTIVE_HIGH>; + }; + key_matrix_col2: key_matrix_col2 { + gpios = <&gpiof 6 GPIO_ACTIVE_HIGH>; + }; + key_matrix_row1: key_matrix_row1 { + gpios = <&gpiod 2 GPIO_PULL_DOWN>; + }; + key_matrix_row2: key_matrix_row2 { + gpios = <&gpiod 7 GPIO_PULL_DOWN>; + }; + }; +}; + +&pinctrl { + pwm_ch0_pd0_default: pwm_ch0_pd0_default { + pinmux = ; + }; + pwm_ch1_pd1_default: pwm_ch1_pd1_default { + pinmux = ; + }; + pwm_ch2_pe2_default: pwm_ch2_pe2_default { + pinmux = ; + }; + pwm_ch3_pe0_default: pwm_ch3_pe0_default { + pinmux = ; + }; +}; + +&pwm0 { + pinctrl-0 = <&pwm_ch0_pd0_default &pwm_ch1_pd1_default &pwm_ch2_pe2_default &pwm_ch3_pe0_default>; +}; + +&flash { + reg = <0x20000000 0x200000>; + + partitions { + /delete-node/ partition@0; + /delete-node/ partition@20000; + /delete-node/ partition@88000; + /delete-node/ partition@f0000; + /delete-node/ partition@f4000; + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x00000000 0x19000>; + }; + slot0_partition: partition@19000 { + label = "image-0"; + reg = <0x19000 0xee000>; + }; + factory_partition: partition@107000 { + label = "factory-data"; + reg = <0x107000 0x1000>; + }; + storage_partition: partition@108000 { + label = "storage"; + reg = <0x108000 0x8000>; + }; + slot1_partition: partition@110000 { + label = "image-1"; + reg = <0x110000 0xee000>; + }; + /* region <0x1fe000 0x2000> is reserved for Telink B92 SDK's data */ + }; +};