Skip to content

Commit

Permalink
[Bouffalolab] Use Openthread stack under Bouffalo Lab SDK by default
Browse files Browse the repository at this point in the history
  • Loading branch information
wy-hh committed Oct 19, 2023
1 parent 6b64a80 commit 50420cc
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 16 deletions.
2 changes: 2 additions & 0 deletions examples/lighting-app/bouffalolab/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ develop `XT-ZB6-DevKit` and `BL706DK` bl706 board, and `BL704LDK` BL704L board .
application.
- `-thread`, to specify that connectivity Thread is enabled for Matter
application.
- `-mot`, to specify to use openthread stack under `third_party/openthread/repo`
- Without `-mot` specified, Matter Thread will use openthread stack under Bouffalo Lab SDK
- `-fp`, to specify to enable frame pointer feature to print call stack when
hit an exception for debug purpose.

Expand Down
8 changes: 4 additions & 4 deletions examples/lighting-app/bouffalolab/bl702/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,14 @@ bouffalolab_executable("lighting_app") {
if (chip_openthread_ftd) {
defines += [ "CHIP_DEVICE_CONFIG_THREAD_FTD=1" ]
deps += [
"${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd",
"${chip_root}/third_party/openthread/repo:libopenthread-ftd",
"${openthread_root}:libopenthread-cli-ftd",
"${openthread_root}:libopenthread-ftd",
]
} else {
defines += [ "CHIP_DEVICE_CONFIG_THREAD_FTD=0" ]
deps += [
"${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd",
"${chip_root}/third_party/openthread/repo:libopenthread-mtd",
"${openthread_root}:libopenthread-cli-mtd",
"${openthread_root}:libopenthread-mtd",
]
}
}
Expand Down
8 changes: 4 additions & 4 deletions examples/lighting-app/bouffalolab/bl702l/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,14 @@ bouffalolab_executable("lighting_app") {
if (chip_openthread_ftd) {
defines += [ "CHIP_DEVICE_CONFIG_THREAD_FTD=1" ]
deps += [
"${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd",
"${chip_root}/third_party/openthread/repo:libopenthread-ftd",
"${openthread_root}:libopenthread-cli-ftd",
"${openthread_root}:libopenthread-ftd",
]
} else {
defines += [ "CHIP_DEVICE_CONFIG_THREAD_FTD=0" ]
deps += [
"${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd",
"${chip_root}/third_party/openthread/repo:libopenthread-mtd",
"${openthread_root}:libopenthread-cli-mtd",
"${openthread_root}:libopenthread-mtd",
]
}
}
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 @@ -655,6 +655,7 @@ def BuildBouffalolabTarget():
target.AppendModifier('thread', enable_thread=True)
target.AppendModifier('fp', enable_frame_ptr=True)
target.AppendModifier('memmonitor', enable_heap_monitoring=True)
target.AppendModifier('mot', use_matter_openthread=True)

return target

Expand Down
5 changes: 4 additions & 1 deletion scripts/build/builders/bouffalolab.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ def __init__(self,
enable_wifi: bool = False,
enable_thread: bool = False,
enable_frame_ptr: bool = False,
enable_heap_monitoring: bool = False
enable_heap_monitoring: bool = False,
use_matter_openthread: bool = False
):

if 'BL602' == module_type:
Expand Down Expand Up @@ -157,6 +158,8 @@ def __init__(self,
self.argsOpt.append(f'chip_enable_ethernet={str(enable_ethernet).lower()}')
self.argsOpt.append(f'chip_enable_wifi={str(enable_wifi).lower()}')
self.argsOpt.append(f'chip_enable_openthread={str(enable_thread).lower()}')
if not use_matter_openthread:
self.argsOpt.append('openthread_root="//third_party/connectedhomeip/third_party/bouffalolab/repo/components/network/thread/openthread"')

# for enable_ethernet, do not need ble for commissioning
self.argsOpt.append(f'chip_config_network_layer_ble={str(enable_wifi or enable_thread).lower()}')
Expand Down
5 changes: 2 additions & 3 deletions third_party/bouffalolab/bl702/bl_iot_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -715,9 +715,8 @@ template("bl_iot_sdk") {
defines = [ "OT_FREERTOS_ENABLE=1" ]

include_dirs = [
"${chip_root}/platform/bl702",
"${chip_root}/third_party/openthread/repo/src/core",
"${chip_root}/third_party/openthread/repo/examples/platforms",
"${openthread_root}/src/core",
"${openthread_root}/examples/platforms",
"${bl_iot_sdk_root}/components/network/thread/openthread_port/include",
"${bl_iot_sdk_root}/components/network/thread/openthread_utils/include",
]
Expand Down
5 changes: 2 additions & 3 deletions third_party/bouffalolab/bl702l/bl_iot_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -648,9 +648,8 @@ template("bl_iot_sdk") {

config("${sdk_target_name}_config_openthread_port") {
include_dirs = [
"${chip_root}/platform/bl702l",
"${chip_root}/third_party/openthread/repo/src/core",
"${chip_root}/third_party/openthread/repo/examples/platforms",
"${openthread_root}/src/core",
"${openthread_root}/examples/platforms",
"${bl_iot_sdk_root}/components/network/thread/openthread_port/include",
"${bl_iot_sdk_root}/components/network/thread/openthread_utils/include",
]
Expand Down
2 changes: 1 addition & 1 deletion third_party/bouffalolab/repo
Submodule repo updated 1 files
+1 −1 components

0 comments on commit 50420cc

Please sign in to comment.