Skip to content

Commit

Permalink
[Bouffalolab] Update SDK repo (#23745)
Browse files Browse the repository at this point in the history
* Update sdk repo

* Update build scripts and readme

* change submodule fetch

* update submodule path

* update submodule url

* update sdk repo

* Fix restyle

* update comments

* Do not try on default SDK path
  • Loading branch information
wy-hh authored and pull[bot] committed Jun 7, 2023
1 parent de9c219 commit 2182002
Show file tree
Hide file tree
Showing 13 changed files with 50 additions and 39 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/examples-bouffalolab.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: connectedhomeip/chip-build:0.6.06
image: connectedhomeip/chip-build-bouffalolab:0.6.12
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
steps:
Expand All @@ -44,7 +44,7 @@ jobs:
attempt_limit: 3
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform bl602
run: scripts/checkout_submodules.py --shallow --platform bouffalolab --recursive

- name: Set up environment for size reports
if: ${{ !env.ACT }}
Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: connectedhomeip/chip-build:0.6.06
image: connectedhomeip/chip-build-bouffalolab:0.6.12
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
steps:
Expand All @@ -100,7 +100,7 @@ jobs:
attempt_limit: 3
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform bouffalolab
run: scripts/checkout_submodules.py --shallow --platform bouffalolab --recursive

- name: Set up environment for size reports
if: ${{ !env.ACT }}
Expand Down
14 changes: 7 additions & 7 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
path = third_party/freertos/repo
url = https://github.com/FreeRTOS/FreeRTOS-Kernel.git
branch = V10.3.1-kernel-only
platforms = ameba,cc13x2_26x2,bl602,efr32,esp32,k32w0,infineon,qpg
platforms = ameba,cc13x2_26x2,bouffalolab,efr32,esp32,k32w0,infineon,qpg
[submodule "simw-top-mini"]
path = third_party/simw-top-mini/repo
url = https://github.com/NXP/plug-and-trust.git
Expand Down Expand Up @@ -264,11 +264,6 @@
[submodule "third_party/boringssl/repo/src"]
path = third_party/boringssl/repo/src
url = https://github.com/google/boringssl.git
[submodule "boufalolab_repo"]
path = third_party/bouffalolab/repo
url = https://github.com/bouffalolab/bl_iot_sdk.git
branch = master
platforms = bouffalolab,bl602
[submodule "third_party/mt793x_sdk/filogic"]
path = third_party/mt793x_sdk/filogic
url = https://github.com/MediaTek-Labs/genio-matter-bsp.git
Expand All @@ -293,4 +288,9 @@
path = third_party/open-iot-sdk/storage
url = https://git.gitlab.arm.com/iot/open-iot-sdk/storage.git
branch = main
platforms = openiotsdk
platforms = openiotsdk
[submodule "bouffalolab_sdk"]
path = third_party/bouffalolab/repo
url = https://github.com/bouffalolab/bl_iot_sdk_tiny.git
branch = main
platforms = bouffalolab
3 changes: 1 addition & 2 deletions build_overrides/bouffalolab_iot_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,5 @@ declare_args() {
# Root directory for bl702 SDK build files.
bl702_sdk_build_root = "//third_party/bouffalolab/bl702"

# Root directory of toolchain of Bouffalolab chips
bouffalolab_toolchain = "//third_party/bouffalolab/repo/toolchain/riscv"
bouffalolab_sdk_root = "/opt/bouffalolab_sdk"
}
3 changes: 1 addition & 2 deletions examples/build_overrides/bouffalolab_iot_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@ declare_args() {
bl702_sdk_build_root =
"//third_party/connectedhomeip/third_party/bouffalolab/bl702"

# Root directory of toolchain of Bouffalolab chips
bouffalolab_toolchain = "/third_party/bouffalolab/repo/toolchain/riscv"
bouffalolab_sdk_root = "/opt/bouffalolab_sdk"
}
16 changes: 16 additions & 0 deletions examples/lighting-app/bouffalolab/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,22 @@ Mac OS.
> under this environment. If not, please try `scripts/bootstrap.sh` for
> matter environment update.
- Setup build environment for `Bouffalo Lab` SoC
Run `setup.sh` to install `Bouffalo Lab` SDK to /opt/bouffalolab_sdk
```
cd third_party/bouffalolab/repo
sudo bash script/setup.sh
```
Please execute following command export `BOUFFALOLAB_SDK_ROOT` before
building.
```
export BOUFFALOLAB_SDK_ROOT=/opt/bouffalolab_sdk
```
## Build CHIP Lighting App example
The following steps take examples for BL602 develop board `BL602-IoT-Matter-V1`
Expand Down
12 changes: 5 additions & 7 deletions examples/lighting-app/bouffalolab/bl602/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,16 @@ declare_args() {
# Dump memory usage at link time.
chip_print_memory_usage = true

# PIN code for PASE session establishment.
setupPinCode = 20202021
# OTA periodic query timeout in seconds
ota_periodic_query_timeout = 86400

# Monitor & log memory usage at runtime.
enable_heap_monitoring = false

# OTA periodic query timeout in seconds
ota_periodic_query_timeout = 86400
setupPinCode = 20202021
setupDiscriminator = 3840

board = "BL602-IoT-Matter-V1"

module_type = "BL602"
baudrate = 2000000
}

Expand Down Expand Up @@ -196,7 +195,6 @@ bl602_executable("lighting_app") {
sources += [ "${examples_plat_common_dir}/plat/OTAConfig.cpp" ]
}

print(defines)
ldscript = "${examples_plat_dir}/ldscripts/flash_rom.ld"

ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ]
Expand Down
11 changes: 5 additions & 6 deletions examples/lighting-app/bouffalolab/bl702/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,20 @@ declare_args() {
# Dump memory usage at link time.
chip_print_memory_usage = true

# OTA periodic query timeout in seconds
ota_periodic_query_timeout = 86400

config_cache_size = 8192

# Monitor & log memory usage at runtime.
enable_heap_monitoring = false

# OTA periodic query timeout in seconds
ota_periodic_query_timeout = 86400
setupPinCode = 20202021
setupDiscriminator = 3840

board = "XT-ZB6-DevKit"
module_type = "BL706C-22"
enable_psram = true
baudrate = 2000000

setupPinCode = 20202021
setupDiscriminator = 3840
}

bl702_sdk("sdk") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ template("riscv_toolchain") {
_tool_name_root = ""

if ("linux" == host_os) {
_tool_name_root = "${root_build_dir}/../../${bouffalolab_toolchain}/Linux/bin/riscv64-unknown-elf-"
_tool_name_root = "${bouffalolab_sdk_root}/toolchain/riscv/Linux/bin/riscv64-unknown-elf-"
} else if ("mac" == host_os || "darwin" == host_os) {
_tool_name_root = "${root_build_dir}/../../${bouffalolab_toolchain}/Darwin/bin/riscv64-unknown-elf-"
_tool_name_root = "${bouffalolab_sdk_root}/toolchain/riscv/Darwin/bin/riscv64-unknown-elf-"
}

ar = _tool_name_root + "ar"
Expand Down
2 changes: 2 additions & 0 deletions scripts/build/builders/bouffalolab.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ def __init__(self,
elif enable_shell:
self.argsOpt.append('chip_build_libshell=true')

self.argsOpt.append('bouffalolab_sdk_root="%s"' % os.environ['BOUFFALOLAB_SDK_ROOT'])

def GnBuildArgs(self):
return self.argsOpt

Expand Down
2 changes: 2 additions & 0 deletions scripts/examples/gn_bouffalolab_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ else
exit 1
fi

optArgs=$optArgs' bouffalolab_sdk_root="'$BOUFFALOLAB_SDK_ROOT'"'

example_dir=$MATTER_ROOT/examples/$example_name/bouffalolab/$bouffalo_chip
output_dir=$MATTER_ROOT/$output_folder

Expand Down
6 changes: 2 additions & 4 deletions third_party/bouffalolab/bl602/bl602_executable.gni
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ template("bl602_executable") {

objcopy = "riscv64-unknown-elf-objcopy"
if ("linux" == host_os) {
objcopy =
"../../${bouffalolab_toolchain}/Linux/bin/riscv64-unknown-elf-objcopy"
objcopy = "${bouffalolab_sdk_root}/toolchain/riscv/Linux/bin/riscv64-unknown-elf-objcopy"
} else if ("mac" == host_os || "darwin" == host_os) {
objcopy =
"../../${bouffalolab_toolchain}/Darwin/bin/riscv64-unknown-elf-objcopy"
objcopy = "${bouffalolab_sdk_root}/toolchain/riscv/Darwin/bin/riscv64-unknown-elf-objcopy"
}

# Copy flashing dependencies to the output directory so that the output
Expand Down
6 changes: 2 additions & 4 deletions third_party/bouffalolab/bl702/bl702_executable.gni
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ template("bl702_executable") {

objcopy = "riscv64-unknown-elf-objcopy"
if ("linux" == host_os) {
objcopy =
"../../${bouffalolab_toolchain}/Linux/bin/riscv64-unknown-elf-objcopy"
objcopy = "${bouffalolab_sdk_root}/toolchain/riscv/Linux/bin/riscv64-unknown-elf-objcopy"
} else if ("mac" == host_os || "darwin" == host_os) {
objcopy =
"../../${bouffalolab_toolchain}/Darwin/bin/riscv64-unknown-elf-objcopy"
objcopy = "${bouffalolab_sdk_root}/toolchain/riscv/Darwin/bin/riscv64-unknown-elf-objcopy"
}

# Copy flashing dependencies to the output directory so that the output
Expand Down
2 changes: 1 addition & 1 deletion third_party/bouffalolab/repo
Submodule repo updated from dc5263 to 2d6f06

0 comments on commit 2182002

Please sign in to comment.