Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bouffalolab] Update bflb-iot-tool version and flash script #29379

Merged
merged 5 commits into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 57 additions & 21 deletions examples/lighting-app/bouffalolab/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ The steps were verified on `Bouffalo Lab` BL602 and BL706 development board.
- `BL602-NIGHT-LIGHT`
- `XT-ZB6-DevKit`
- `BL706-NIGHT-LIGHT`
- `BL704L-DVK`
- `BL706DK`
- `BL704LDK`

> Warning: Changing the PID may cause compilation problems, we recommend leaving
> it as the default while using this example.
> Warning: Changing the VID/PID may cause compilation problems, we recommend
> leaving it as the default while using this example.

## BL602

Expand All @@ -24,10 +25,17 @@ BL602/BL604 is combo chip-set for Wi-Fi 802.11b/g/n and BLE 5.0 base-band/MAC.

<img src="../../platform/bouffalolab/doc/chart/BL602-IoT-Matter_V1.png" style="zoom:25%;" />

## BL706
## BL70x

BL702/BL706 is combo chip-set for BLE and IEEE 802.15.4/ZigBee/Thread. In some
cases, e.g. in SDK, we use BL702 as a general name for BL702/BL706 family.
BL70x is combo chip-set for BLE and IEEE 802.15.4/ZigBee/Thread.

- BL702/BL706 has 14dbm tx power and is recommended for routing devices. SDK
uses BL702 as a general name.
- BL702L/BL704L is designed for low power application. SDK uses BL702L as a
general name.

BL70x has fully certified with all Thread 1.3 features, included Thread `SSED`
and Thread Border Router with `DUA manager`.

### `XT-ZB6-DevKit`

Expand All @@ -47,12 +55,12 @@ Mac OS.
git clone https://github.com/project-chip/connectedhomeip.git
cd connectedhomeip
git submodule update --init --recursive
source ./scripts/activate.sh
source ./scripts/activate.sh -p bouffalolab
```

> After environment setup Bouffalolab flash tool, `bflb-iot-tool`, imports
> under this environment. If not, please try `scripts/bootstrap.sh` for
> matter environment update.
> After environment setup `Bouffalo Lab` flash tool, `bflb-iot-tool`,
> imports under this environment. If not, please try
> `scripts/bootstrap.sh -p bouffalolab` for matter environment update.

- Setup build environment for `Bouffalo Lab` SoC

Expand All @@ -72,15 +80,17 @@ Mac OS.

## Build CHIP Lighting App example

The following steps take examples for BL602 develop board `BL602-IoT-Matter-V1`,
BL706 develop board `XT-ZB6-DevKit` and BL704L DVK board `BL704L-DVK`
The following steps take examples for `BL602-IoT-Matter-V1` bl602 board, BL706
develop `XT-ZB6-DevKit` and `BL706DK` bl706 board, and `BL704LDK` BL704L board .

- Build lighting app with UART baudrate 2000000

```
./scripts/build/build_examples.py --target bouffalolab-bl602-iot-matter-v1-light build
./scripts/build/build_examples.py --target bouffalolab-xt-zb6-devkit-light build
./scripts/build/build_examples.py --target bouffalolab-bl704l-dvk-light build
./scripts/build/build_examples.py --target bouffalolab-bl704ldk-light build
./scripts/build/build_examples.py --target bouffalolab-bl706dk-light-ethernet build
./scripts/build/build_examples.py --target bouffalolab-bl706dk-light-wifi build
```

- Build lighting app with UART baudrate 115200
Expand All @@ -97,14 +107,39 @@ BL706 develop board `XT-ZB6-DevKit` and BL704L DVK board `BL704L-DVK`
./scripts/build/build_examples.py --target bouffalolab-xt-zb6-devkit-light-rpc build
```

### Build options with build_examples.py

- `-shell`, enable UART command line
- `-115200`, set UART baudrate to 115200 for log and command line
- `-rpc`, enable Pigweed RPC feature
- `-cdc`, enable USB CDC feature, only support for BL706, and can't work with
Ethernet Board
- `-resetCnt`, enable feature to do factory reset when continues power cycle
is greater than 3
- `-mfd`, enable Matter factory data feature, which load factory data from
`DTS` region and `MFD` partition
- Please contact to `Bouffalo Lab` for Matter factory data support.
- `-mfdtest`, enable Matter factory data module, but only load factory data
from `FactoryDataProvider.cpp` file.
- `-wifi`, to specify that connectivity Wi-Fi is enabled for Matter
application.
- `-ethernet`, to specify that connectivity Ethernet is enabled for Matter
application.
- `-thread`, to specify that connectivity Thread is enabled for Matter
application.
- `-fp`, to specify to enable frame pointer feature to print call stack when
hit an exception for debug purpose.

## Download image

- Using script `*.flash.py`.

After building gets done, python script
`chip-bl602-lighting-example.flash.py` or
`chip-bl702-lighting-example.flash.py` will generate under build output
folder for BL602 or BL702 building.
After building gets done, python script `*.flash.py` will generate under
build output folder, such as

- `chip-bl602-lighting-example.flash.py` for BL602
- `chip-bl702-lighting-example.flash.py` for BL702
- `chip-bl702l-lighting-example.flash.py` for BL702L

> Note 1, `*.flash.py` should be ran under Matter build environment; if
> python module `bflb_iot_tool` is not found, please try to do
Expand All @@ -126,12 +161,13 @@ BL706 develop board `XT-ZB6-DevKit` and BL704L DVK board `BL704L-DVK`
- Type following command for image download. Please set serial port
accordingly, here we use /dev/ttyACM0 as a serial port example.

- `bl602-iot-matter-v1` and `bl704l-dvk` without additional build
options
- `bl602-iot-matter-v1`, `xt-zb6-devkit` and `bl704ldk` without
additional build options

```shell
./out/bouffalolab-bl602-iot-matter-v1-light/chip-bl602-lighting-example.flash.py --port /dev/ttyACM0
./out/bouffalolab-bl704l-dvk-light/chip-bl702l-lighting-example.flash.py --port /dev/ttyACM0
./out/bouffalolab-xt-zb6-devkit-light/chip-bl702-lighting-example.flash.py --port /dev/ttyACM0
./out/bouffalolab-bl704ldk-light/chip-bl702l-lighting-example.flash.py --port /dev/ttyACM0
```

- `xt-zb6-devkit` with 115200 baudrate setting
Expand All @@ -146,7 +182,7 @@ BL706 develop board `XT-ZB6-DevKit` and BL704L DVK board `BL704L-DVK`
```shell
./out/bouffalolab-bl602-iot-matter-v1-light/chip-bl602-lighting-example.flash.py --port /dev/ttyACM0 --erase
./out/bouffalolab-xt-zb6-devkit-light-115200/chip-bl702-lighting-example.flash.py --port /dev/ttyACM0 --erase
./out/bouffalolab-bl704l-dvk-light/chip-bl702l-lighting-example.flash.py --port /dev/ttyACM0 --erase
./out/bouffalolab-bl704ldk-light/chip-bl702l-lighting-example.flash.py --port /dev/ttyACM0 --erase
```

> Note, better to append --erase option to download image for BL602
Expand Down
1 change: 1 addition & 0 deletions scripts/build/build/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,7 @@ def BuildBouffalolabTarget():
target.AppendModifier('wifi', enable_wifi=True)
target.AppendModifier('thread', enable_thread=True)
target.AppendModifier('fp', enable_frame_ptr=True)
target.AppendModifier('memmonitor', enable_heap_monitoring=True)

return target

Expand Down
11 changes: 6 additions & 5 deletions scripts/build/builders/bouffalolab.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ def __init__(self,
enable_ethernet: bool = False,
enable_wifi: bool = False,
enable_thread: bool = False,
enable_frame_ptr: bool = False
enable_frame_ptr: bool = False,
enable_heap_monitoring: bool = False
):

if 'BL602' == module_type:
Expand Down Expand Up @@ -137,19 +138,16 @@ def __init__(self,

# hardware connectivity support check
if bouffalo_chip == "bl602":

if enable_ethernet or enable_thread:
raise Exception('SoC %s doesn\'t support connectivity Ethernet/Thread.' % bouffalo_chip)

elif bouffalo_chip == "bl702":

self.argsOpt.append('module_type=\"{}\"'.format(module_type))
if board != BouffalolabBoard.BL706DK:
if enable_ethernet or enable_wifi:
raise Exception('Board %s doesn\'t support connectivity Ethernet/Wi-Fi.' % board)

elif bouffalo_chip == "bl702l":

if enable_ethernet or enable_wifi:
raise Exception('SoC %s doesn\'t support connectivity Ethernet/Wi-Fi currently.' % bouffalo_chip)

Expand Down Expand Up @@ -203,6 +201,8 @@ def __init__(self,
else:
self.argsOpt.append("enable_debug_frame_ptr=false")

self.argsOpt.append("enable_heap_monitoring={}".format(str(enable_heap_monitoring).lower()))

try:
self.argsOpt.append('bouffalolab_sdk_root="%s"' % os.environ['BOUFFALOLAB_SDK_ROOT'])
except KeyError as err:
Expand Down Expand Up @@ -261,4 +261,5 @@ def PostBuildCommand(self):
os.system("cp " + ota_images_image + " " + ota_images_dev_image)

logging.info("PostBuild:")
logging.info("Bouffalo Lab OTA format image: " + self.app.AppNamePrefix(self.chip_name) + ".bin.xz.hash is generated.")
logging.info("Bouffalo Lab OTA format image without signature: " +
self.app.AppNamePrefix(self.chip_name) + ".bin.xz.hash is generated.")
2 changes: 1 addition & 1 deletion scripts/build/testdata/all_targets_linux_x64.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ameba-amebad-{all-clusters,all-clusters-minimal,light,light-switch,pigweed}
asr-{asr582x,asr595x,asr550x}-{all-clusters,all-clusters-minimal,lighting,light-switch,lock,bridge,temperature-measurement,thermostat,ota-requestor,dishwasher,refrigerator}[-ota][-shell][-no_logging][-factory][-rotating_id][-rio]
android-{arm,arm64,x86,x64,androidstudio-arm,androidstudio-arm64,androidstudio-x86,androidstudio-x64}-{chip-tool,chip-test,tv-server,tv-casting-app,java-matter-controller,virtual-device-app}[-no-debug]
bouffalolab-{bl602-iot-matter-v1,bl602-night-light,xt-zb6-devkit,bl706-night-light,bl706dk,bl704ldk}-light[-shell][-115200][-rpc][-cdc][-resetcnt][-rotating_device_id][-mfd][-mfdtest][-ethernet][-wifi][-thread][-fp]
bouffalolab-{bl602-iot-matter-v1,bl602-night-light,xt-zb6-devkit,bl706-night-light,bl706dk,bl704ldk}-light[-shell][-115200][-rpc][-cdc][-resetcnt][-rotating_device_id][-mfd][-mfdtest][-ethernet][-wifi][-thread][-fp][-memmonitor]
cc32xx-lock
ti-cc13x2x7_26x2x7-{lighting,lock,pump,pump-controller}[-mtd]
ti-cc13x4_26x4-{all-clusters,lighting,lock,pump,pump-controller}[-mtd][-ftd]
Expand Down
Loading
Loading