diff --git a/.github/workflows/examples-bl602.yaml b/.github/workflows/examples-bl602.yaml
deleted file mode 100644
index 56166d9e667756..00000000000000
--- a/.github/workflows/examples-bl602.yaml
+++ /dev/null
@@ -1,79 +0,0 @@
-# Copyright (c) 2020 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.
-
-name: Build example - BL602
-
-on:
- push:
- pull_request:
-
-concurrency:
- group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }}
- cancel-in-progress: true
-
-jobs:
- bl602:
- name: BL602
- timeout-minutes: 90
-
- runs-on: ubuntu-latest
- if: github.actor != 'restyled-io[bot]'
-
- container:
- image: connectedhomeip/chip-build:latest
- volumes:
- - "/tmp/bloat_reports:/tmp/bloat_reports"
- steps:
- - uses: Wandalen/wretry.action@v1.0.15
- name: Checkout
- with:
- action: actions/checkout@v3
- with: |
- token: ${{ github.token }}
- attempt_limit: 3
- attempt_delay: 2000
- - name: Checkout submodules
- run: scripts/checkout_submodules.py --shallow --platform bl602
-
- - name: Set up environment for size reports
- if: ${{ !env.ACT }}
- env:
- GH_CONTEXT: ${{ toJson(github) }}
- run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}"
-
- - name: Build example BL602 Lighting App
- timeout-minutes: 30
- run: |
- ./scripts/run_in_build_env.sh \
- "./scripts/build/build_examples.py --target bl602-light build"
-
- - name: Get Lighting size stats
- run: |
- .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py bl602 bl602 lighting-app \
- out/bl602-light/chip-bl602-lighting-example.out /tmp/bloat_reports/
-
- - name: Build example BL602 Lighting App with RPCs
- timeout-minutes: 30
- run: |
- scripts/examples/gn_bl602_example.sh lighting-app ./out/bl602-light-rpc 'import("//with_pw_rpc.gni")'
- .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py bl602 bl602+rpc lighting-app \
- out/bl602-light-rpc/chip-bl602-lighting-example.out /tmp/bloat_reports/
-
- - name: Uploading Size Reports
- uses: actions/upload-artifact@v2
- if: ${{ !env.ACT }}
- with:
- name: Size,BL602-Examples,${{ env.GH_EVENT_PR }},${{ env.GH_EVENT_HASH }},${{ env.GH_EVENT_PARENT }},${{ github.event_name }}
- path: |
- /tmp/bloat_reports/
diff --git a/.github/workflows/examples-bouffalolab.yaml b/.github/workflows/examples-bouffalolab.yaml
index 3b53d17b35d726..e34c54882624fc 100644
--- a/.github/workflows/examples-bouffalolab.yaml
+++ b/.github/workflows/examples-bouffalolab.yaml
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-name: Build example - Bouffalolab BL702
+name: Build example - BouffaloLab
on:
push:
@@ -23,6 +23,62 @@ concurrency:
cancel-in-progress: true
jobs:
+ bl602:
+ name: BL602
+ timeout-minutes: 90
+
+ runs-on: ubuntu-latest
+ if: github.actor != 'restyled-io[bot]'
+
+ container:
+ image: connectedhomeip/chip-build:latest
+ volumes:
+ - "/tmp/bloat_reports:/tmp/bloat_reports"
+ steps:
+ - uses: Wandalen/wretry.action@v1.0.15
+ name: Checkout
+ with:
+ action: actions/checkout@v3
+ with: |
+ token: ${{ github.token }}
+ attempt_limit: 3
+ attempt_delay: 2000
+ - name: Checkout submodules
+ run: scripts/checkout_submodules.py --shallow --platform bl602
+
+ - name: Set up environment for size reports
+ if: ${{ !env.ACT }}
+ env:
+ GH_CONTEXT: ${{ toJson(github) }}
+ run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}"
+
+ - name: Build example BL602 Lighting App
+ timeout-minutes: 30
+ run: |
+ ./scripts/run_in_build_env.sh \
+ "./scripts/build/build_examples.py --target bouffalolab-bl602-iot-matter-v1-light build"
+
+ - name: Get Lighting size stats
+ run: |
+ .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py bl602 bl602 lighting-app \
+ out/bouffalolab-bl602-iot-matter-v1-light/chip-bl602-lighting-example.out /tmp/bloat_reports/
+
+ - name: Build example BL602 Lighting App with RPCs
+ timeout-minutes: 30
+ run: |
+ ./scripts/run_in_build_env.sh \
+ "./scripts/build/build_examples.py --target bouffalolab-bl602-iot-matter-v1-light-115200-rpc build"
+ .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py bl602 bl602+rpc lighting-app \
+ out/bouffalolab-bl602-iot-matter-v1-light-115200-rpc/chip-bl602-lighting-example.out /tmp/bloat_reports/
+
+ - name: Uploading Size Reports
+ uses: actions/upload-artifact@v2
+ if: ${{ !env.ACT }}
+ with:
+ name: Size,BL602-Examples,${{ env.GH_EVENT_PR }},${{ env.GH_EVENT_HASH }},${{ env.GH_EVENT_PARENT }},${{ github.event_name }}
+ path: |
+ /tmp/bloat_reports/
+
bl702:
name: BL702
timeout-minutes: 90
@@ -52,21 +108,22 @@ jobs:
GH_CONTEXT: ${{ toJson(github) }}
run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}"
+
- name: Build example BL702 Lighting App
timeout-minutes: 30
run: |
./scripts/run_in_build_env.sh \
- "./scripts/build/build_examples.py --target bouffalolab-bl706-iot-dvk-light build"
+ "./scripts/build/build_examples.py --target bouffalolab-xt-zb6-devkit-light build"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py bl702 bl702 lighting-app \
- out/bouffalolab-bl706-iot-dvk-light/chip-bl702-lighting-example.out /tmp/bloat_reports/
+ out/bouffalolab-xt-zb6-devkit-light/chip-bl702-lighting-example.out /tmp/bloat_reports/
- name: Build example BL702 Lighting App with RPCs
timeout-minutes: 30
run: |
./scripts/run_in_build_env.sh \
- "./scripts/build/build_examples.py --target bouffalolab-bl706-iot-dvk-light-rpc build"
+ "./scripts/build/build_examples.py --target bouffalolab-xt-zb6-devkit-light-115200-rpc build"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py bl702 bl702+rpc lighting-app \
- out/bouffalolab-bl706-iot-dvk-light-rpc/chip-bl702-lighting-example.out /tmp/bloat_reports/
+ out/bouffalolab-xt-zb6-devkit-light-115200-rpc/chip-bl702-lighting-example.out /tmp/bloat_reports/
- name: Uploading Size Reports
uses: actions/upload-artifact@v2
diff --git a/examples/lighting-app/bouffalolab/bl602/BUILD.gn b/examples/lighting-app/bouffalolab/bl602/BUILD.gn
index a00a5a47503269..f6a9513561d049 100644
--- a/examples/lighting-app/bouffalolab/bl602/BUILD.gn
+++ b/examples/lighting-app/bouffalolab/bl602/BUILD.gn
@@ -43,13 +43,10 @@ declare_args() {
# OTA periodic query timeout in seconds
ota_periodic_query_timeout = 86400
-}
-show_qr_code = false
+ board = "BL602-IoT-Matter-V1"
-# BL-HWC-G1 (No LCD)
-if (bl602_board == "BL-HWC-G1" || bl602_board == "IOT_DVK_3S") {
- show_qr_code = false
+ baudrate = 2000000
}
bl602_sdk("sdk") {
@@ -68,6 +65,7 @@ bl602_sdk("sdk") {
"CONFIG_PSM_EASYFLASH_SIZE=16384",
"CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE=${setupPinCode}",
"OTA_PERIODIC_QUERY_TIMEOUT=${ota_periodic_query_timeout}",
+ "CHIP_UART_BAUDRATE=${baudrate}",
]
if (chip_enable_pw_rpc) {
@@ -107,16 +105,10 @@ bl602_executable("lighting_app") {
include_dirs = [ "include" ]
- if (bl602_board == "IOT_DVK_3S") {
- defines = [ "BOARD_ID=0" ]
- } else {
+ if ("BL602-IoT-Matter-V1" == board || "BL602-IOT-DVK-3S" == board) {
defines = [ "BOARD_ID=1" ]
- }
-
- if (show_qr_code) {
- sources += [ "${examples_plat_dir}/display/lcd.c" ]
-
- defines += [ "DISPLAY_ENABLED" ]
+ } else {
+ defines = [ "BOARD_ID=0" ]
}
if (chip_enable_pw_rpc) {
diff --git a/examples/lighting-app/bouffalolab/bl602/README.md b/examples/lighting-app/bouffalolab/bl602/README.md
index 1c66c73ecc5c83..cbf2b90d62c90c 100644
--- a/examples/lighting-app/bouffalolab/bl602/README.md
+++ b/examples/lighting-app/bouffalolab/bl602/README.md
@@ -1,10 +1,14 @@
# BL602
This example functions as a wifi light bulb device type, with on/off
-capabilities. The steps were verified on BL602-IoT-Matter-V1 board.
+capabilities. The steps were verified on following boards:
+
+- BL602-IoT-Matter-V1, [here](https://www.amazon.com/dp/B0B9ZVGXD8) to
+ purchase.
+- BL602-NIGHT-LIGHT
+
+## BL602-IoT-Matter-V1 board
-BL602-IoT-Matter-V1 board and
-[purchase link](https://www.amazon.com/dp/B0B9ZVGXD8):
## Initial setup
@@ -12,7 +16,7 @@ BL602-IoT-Matter-V1 board and
The steps in this document were validated on Ubuntu 18.04 and 20.04.
- Install dependencies as specified in the connectedhomeip repository:
- [Building Matter](https://github.com/project-chip/connectedhomeip/blob/interop_testing_te9/docs/guides/BUILDING.md).
+ [Building Matter](https://github.com/project-chip/connectedhomeip/blob/master/docs/guides/BUILDING.md).
- Install other dependencies:
```
@@ -31,20 +35,42 @@ The steps in this document were validated on Ubuntu 18.04 and 20.04.
source ./scripts/activate.sh
```
-## Build the image and flash the board
+ > Note, Bouffalolab flash tool, `bflb-iot-tool`, imports under this
+ > environment. If not, please try `scripts/bootstrap.sh` for matter
+ > environment update.
+
+## Build CHIP BL602 Lighting App example
- Build the
[lighting-app](https://github.com/project-chip/connectedhomeip/tree/master/examples/lighting-app/bouffalolab/bl602)
```
- ./scripts/build/build_examples.py --target bl602-light build
+ ./scripts/build/build_examples.py --target bouffalolab-bl602-iot-matter-v1-light build
+ ./scripts/build/build_examples.py --target bouffalolab-bl602-night-light-light build
```
-- Build the lighting-app with Pigweed RPC:
+- Build target name with `-115200` appended for UART baudrate 115200 command
+ enabled as following commands.
+ ```shell
+ ./scripts/build/build_examples.py --target bouffalolab-bl602-iot-matter-v1-light-115200 build
```
- ./scripts/examples/gn_bl602_example.sh lighting-app ./out/bl602-light 'import("//with_pw_rpc.gni")'
- ```
+
+ > UART baudrate is 2000000 by default.
+
+- Build target name with `-rpc` appended for rpc enabled as following
+ commands.
+ `shell ./scripts/build/build_examples.py --target bouffalolab-xt-zb6-devkit-light-rpc build`
+ > For multiple build options, such as UART baudrate 115200 + rpc, please try
+ > build command as
+ > `./scripts/build/build_examples.py --target bouffalolab-xt-zb6-devkit-light-rpc-115200 build`
+
+## Download image
+
+After building gets done, a python `chip-bl602-lighting-example.flash.py` will
+generated under build output folder. Such as
+chip-bl602-lighting-example.flash.py for lighting-app example. Please check
+`help` option of script for more detail.
- Connect the board to your flashing station (MacOS, Ubuntu, Windows).
@@ -54,25 +80,14 @@ The steps in this document were validated on Ubuntu 18.04 and 20.04.
- Press the RESET button and release it.
- Release the BOOT button.
-- The device should present itself as a USB serial device on your computer.
- You may look it up in /dev/ttyACM0
+- Enter build out folder, download image as following execution under build
+ output folder:
+ ```shell
+ ./chip-bl602-lighting-example.flash.py --port /dev/tty.usbserial-3
```
- ls -la /dev/tty*
- ```
-
- If the device is at /dev/ttyACM0, flash the board using the following
- commands:
-
- ```
- cd third_party/bouffalolab/repo/tools/flash_tool
- ./bflb_iot_tool-ubuntu --chipname=BL602 --baudrate=115200 --port=/dev/ttyACM0 --pt=chips/bl602/partition/partition_cfg_4M.toml --dts=chips/bl602/device_tree/bl_factory_params_IoTKitA_40M.dts --firmware=../../../../../out/bl602-light/chip-bl602-lighting-example.bin
- ```
-
- ```
- If you want to erase previous network information in flash, you can add --erase parameters to the bflb_iot_tool-ubuntu18 command. For Windows and MacOS, replace bflb_iot_tool-ubuntu18 with bflb_iot_tool.exe and bflb_iot_tool-macos, respectively.
- ```
+ > Note, where `/dev/tty.usbserial-3` is UART port of device.
## Validate the example
@@ -80,7 +95,7 @@ The steps in this document were validated on Ubuntu 18.04 and 20.04.
`/dev/ttyACM0`:
```
-picocom -b 115200 /dev/ttyACM0
+picocom -b 2000000 /dev/ttyACM0
```
2.To reset the board, press the RESET button, and you will see the log in the
diff --git a/examples/lighting-app/bouffalolab/bl602/include/CHIPProjectConfig.h b/examples/lighting-app/bouffalolab/bl602/include/CHIPProjectConfig.h
index d36ef3e7326b4d..db99b4c1a72ef7 100644
--- a/examples/lighting-app/bouffalolab/bl602/include/CHIPProjectConfig.h
+++ b/examples/lighting-app/bouffalolab/bl602/include/CHIPProjectConfig.h
@@ -68,7 +68,7 @@
* TODO: 3R
*/
//#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0xF001
-#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x8001
+#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x8005
/**
* CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION
diff --git a/examples/lighting-app/bouffalolab/bl702/BUILD.gn b/examples/lighting-app/bouffalolab/bl702/BUILD.gn
index 1101a90630c0d4..8243bb9924a97f 100644
--- a/examples/lighting-app/bouffalolab/bl702/BUILD.gn
+++ b/examples/lighting-app/bouffalolab/bl702/BUILD.gn
@@ -43,7 +43,7 @@ declare_args() {
# Monitor & log memory usage at runtime.
enable_heap_monitoring = false
- board = "BL706-IoT-DVK"
+ board = "XT-ZB6-DevKit"
module_type = "BL706C-22"
enable_psram = true
baudrate = 2000000
@@ -95,13 +95,16 @@ bl702_executable("lighting_app") {
defines += [ "CFG_USE_PSRAM=1" ]
}
- if ("BL706-NIGHT-LIGHT" == board) {
- defines += [ "APP_BOARD_LED_STATUS=0" ]
+ if ("BL706C-22" == module_type) {
+ defines += [ "BOARD_BTN_BOOT_PIN" ]
+ }
+
+ if ("XT-ZB6-DevKit" == board) {
+ defines += [ "XT_ZB6_DevKit" ]
+ } else if ("BL706-NIGHT-LIGHT" == board) {
defines += [ "BL706_NIGHT_LIGHT" ]
- defines += [ "APP_BOARD_BTN=0" ]
} else if ("BL702-IoT-DVK" == board || "BL706-IoT-DVK" == board) {
- defines += [ "APP_BOARD_LED_STATUS=1" ]
- defines += [ "APP_BOARD_BTN=1" ]
+ defines += [ "BL706_IOT_DVK" ]
}
sources = [
diff --git a/examples/lighting-app/bouffalolab/bl702/README.md b/examples/lighting-app/bouffalolab/bl702/README.md
index f02b1b84758f86..09f709643268bc 100644
--- a/examples/lighting-app/bouffalolab/bl702/README.md
+++ b/examples/lighting-app/bouffalolab/bl702/README.md
@@ -7,12 +7,11 @@ This example is powered by BL706 and functions as a Thread light bulb device
type, with on/off, level and color capabilities. The steps were verified with
following boards:
- - BL706-IoT-DVK
- - BL706-NIGHT-LIGHT
+- `XT-ZB6-DevKit`
+- `BL706-IoT-DVK`
+- `BL706-NIGHT-LIGHT`
-## Build
-
-### Prerequisite
+## Prerequisite
- Clone connectedhomeip github repo and update all submodule;
- Install all tools (likely already present for CHIP developers).
@@ -24,143 +23,106 @@ following boards:
```shell
source scripts/bootstrap.sh
```
- > Note, `scripts/bootstrap.sh` only installs `bflb-iot-tool` under
- > connectedhomeip build context.
+ > Note, `bflb-iot-tool` is only installed under connectedhomeip build
+ > context by matter environment setup `scripts/bootstrap.sh`.
- Others, please execute the following script before any build commands
- executed; and `bflb-iot-tool` will import under this environment.
+ executed; and `bflb-iot-tool` imports under this environment.
```shell
source scripts/activate.sh
```
## Build CHIP BL702 Lighting App example
-- Build with script `gn_bouffalolab_example.sh` under root folder of
- connectedhomeip repo
+- Build for `XT-ZB6-DevKit` and BL706-NIGHT-LIGHT as following commands.
- - Command format:
+ ```shell
+ ./scripts/build/build_examples.py --target bouffalolab-xt-zb6-devkit-light build
+ ./scripts/build/build_examples.py --target bouffalolab-bl706-night-light-light build
+ ```
- ```shell
- ./scripts/examples/gn_bouffalolab_example.sh