Skip to content

Commit 0ca9aa4

Browse files
[BL702] bring up Bouffalo Lab BL702 (#22450)
* [BL702] bring up bouffalolab bl702 * Correct spell error * Update .wordlist.txt * Restyled by whitespace * Restyled by clang-format * Restyled by gn * Restyled by prettier-markdown * Restyled by shellharden * Restyled by shfmt * Restyled by autopep8 * use host_os to set path of toolchain * 1. fix build test on darwin operation system; 2. remove wrong comments and commented out code * fix miss spell * Code restyled * Restyled by clang-format * Correct to reference dts filename for script *.flash.py generation. * Update ReadMe.md * Restyled by prettier-markdown Co-authored-by: Restyled.io <[email protected]>
1 parent ff31543 commit 0ca9aa4

File tree

119 files changed

+11189
-35
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+11189
-35
lines changed

.github/.wordlist.txt

+1
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ bootable
154154
Bootloader
155155
BorderRouterAP
156156
bouffalolab
157+
Bouffalolab
157158
BRD
158159
breakpoint
159160
bredr
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Copyright (c) 2020 Project CHIP Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Build example - Bouffalolab BL702
16+
17+
on:
18+
push:
19+
pull_request:
20+
21+
concurrency:
22+
group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }}
23+
cancel-in-progress: true
24+
25+
jobs:
26+
bl702:
27+
name: BL702
28+
timeout-minutes: 90
29+
30+
runs-on: ubuntu-latest
31+
if: github.actor != 'restyled-io[bot]'
32+
33+
container:
34+
image: connectedhomeip/chip-build:latest
35+
volumes:
36+
- "/tmp/bloat_reports:/tmp/bloat_reports"
37+
steps:
38+
- uses: Wandalen/[email protected]
39+
name: Checkout
40+
with:
41+
action: actions/checkout@v3
42+
with: |
43+
token: ${{ github.token }}
44+
attempt_limit: 3
45+
attempt_delay: 2000
46+
- name: Checkout submodules
47+
run: scripts/checkout_submodules.py --shallow --platform bouffalolab
48+
49+
- name: Set up environment for size reports
50+
if: ${{ !env.ACT }}
51+
env:
52+
GH_CONTEXT: ${{ toJson(github) }}
53+
run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}"
54+
55+
- name: Build example BL702 Lighting App
56+
timeout-minutes: 30
57+
run: |
58+
./scripts/run_in_build_env.sh \
59+
"./scripts/build/build_examples.py --target bouffalolab-BL706-IoT-DVK-BL706C-22-light build"
60+
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py bl702 bl702 lighting-app \
61+
out/bouffalolab-BL706-IoT-DVK-BL706C-22-light/chip-bl702-lighting-example.out /tmp/bloat_reports/
62+
63+
- name: Build example BL702 Lighting App with RPCs
64+
timeout-minutes: 30
65+
run: |
66+
./scripts/run_in_build_env.sh \
67+
"./scripts/build/build_examples.py --target bouffalolab-BL706-IoT-DVK-BL706C-22-light-rpc build"
68+
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py bl702 bl702+rpc lighting-app \
69+
out/bouffalolab-BL706-IoT-DVK-BL706C-22-light-rpc/chip-bl702-lighting-example.out /tmp/bloat_reports/
70+
71+
- name: Uploading Size Reports
72+
uses: actions/upload-artifact@v2
73+
if: ${{ !env.ACT }}
74+
with:
75+
name: Size,BL702-Examples,${{ env.GH_EVENT_PR }},${{ env.GH_EVENT_HASH }},${{ env.GH_EVENT_PARENT }},${{ github.event_name }}
76+
path: |
77+
/tmp/bloat_reports/

.gitmodules

+1-1
Original file line numberDiff line numberDiff line change
@@ -272,4 +272,4 @@
272272
path = third_party/bouffalolab/repo
273273
url = https://github.com/bouffalolab/bl_iot_sdk.git
274274
branch = master
275-
platforms = bl602
275+
platforms = bouffalolab,bl602

.vscode/tasks.json

+5
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,11 @@
332332
"android-x64-chip-tool",
333333
"android-x86-chip-tool",
334334
"bl602-light",
335+
"bouffalolab-BL702-IoT-DVK-light",
336+
"bouffalolab-BL702-IoT-DVK-light-rpc",
337+
"bouffalolab-BL706-IoT-DVK-BL706C-22-light",
338+
"bouffalolab-BL706-IoT-DVK-BL706C-22-light-rpc",
339+
"bouffalolab-BL706-NIGHT-LIGHT",
335340
"efr32-brd4161a-light",
336341
"efr32-brd4163a-light",
337342
"efr32-brd4164a-light",

BUILD.gn

+14
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,9 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
283283
# Set this to true to enable bl602 builds by default.
284284
enable_bl602_builds = false
285285

286+
# Set this to true to enable bl702 builds by default.
287+
enable_bl702_builds = false
288+
286289
# Set this to true to enable mw320 builds by default.
287290
enable_mw320_builds = false
288291
}
@@ -388,6 +391,9 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
388391
# Build the bl602 lighting app example.
389392
enable_bl602_lighting_app_build = enable_bl602_builds
390393

394+
# Build the bl702 lighting app example.
395+
enable_bl702_lighting_app_build = enable_bl702_builds
396+
391397
# Build the mw320 shell app example.
392398
enable_mw320_shell_build = enable_mw320_builds
393399

@@ -682,6 +688,14 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
682688
extra_build_deps += [ ":mw320_shell" ]
683689
}
684690

691+
if (enable_bl702_lighting_app_build) {
692+
group("bl702_lighting_app") {
693+
deps = [ "${chip_root}/examples/lighting-app/bl702(${chip_root}/config/bl702/toolchain:bl702_lighting_app)" ]
694+
}
695+
696+
extra_build_deps += [ ":bl702_shell" ]
697+
}
698+
685699
group("default") {
686700
deps = extra_build_deps + builds
687701
}

build/toolchain/riscv_gcc/riscv_toolchain.gni

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
import("//build_overrides/bl602_sdk.gni")
1615
import("//build_overrides/build.gni")
1716

1817
import("${build_root}/toolchain/gcc_toolchain.gni")
1918

2019
template("riscv_toolchain") {
2120
gcc_toolchain(target_name) {
22-
_tool_name_root = "${root_build_dir}/../../third_party/bouffalolab/repo/toolchain/riscv/Linux/bin/riscv64-unknown-elf-"
21+
_tool_name_root = "riscv64-unknown-elf-"
22+
2323
ar = _tool_name_root + "ar"
2424
cc = _tool_name_root + "gcc"
2525
cxx = _tool_name_root + "g++"
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright (c) 2021 Project CHIP Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
declare_args() {
16+
# Root directory for bl602 SDK build files.
17+
bl602_sdk_build_root = "//third_party/bouffalolab/bl602"
18+
19+
# Root directory for bl702 SDK build files.
20+
bl702_sdk_build_root = "//third_party/bouffalolab/bl702"
21+
22+
# Root directory of toolchain of Bouffalolab chips
23+
bouffalolab_toolchain = "//third_party/bouffalolab/repo/toolchain/riscv"
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Copyright (c) 2021 Project CHIP Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
import("//build_overrides/chip.gni")
16+
import("//build_overrides/pigweed.gni")
17+
import("$dir_pw_build/target_types.gni")
18+
19+
config("pw_string_config") {
20+
defines = [
21+
"_GLIBCXX_USE_C99_MATH_TR1",
22+
"_LDBL_EQ_DBL",
23+
]
24+
}
25+
26+
pw_source_set("pw_string_dep") {
27+
public_configs = [ ":pw_string_config" ]
28+
}
29+
30+
static_library("pw_rpc") {
31+
output_name = "libPwRpc"
32+
33+
public_configs = [ "${dir_pigweed}/pw_hdlc:default_config" ]
34+
35+
public_deps = [
36+
"$dir_pw_rpc:server",
37+
"$dir_pw_rpc/nanopb:echo_service",
38+
"${chip_root}/examples/platform/bouffalolab/bl702/pw_sys_io:pw_sys_io_bl702",
39+
"${dir_pigweed}/pw_hdlc:pw_rpc",
40+
dir_pw_assert,
41+
dir_pw_checksum,
42+
dir_pw_hdlc,
43+
dir_pw_log,
44+
]
45+
46+
output_dir = "${root_out_dir}/lib"
47+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Copyright (c) 2021 Project CHIP Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
import("//build_overrides/chip.gni")
16+
import("//build_overrides/pigweed.gni")
17+
18+
pw_log_BACKEND = "$dir_pw_log_basic"
19+
pw_assert_BACKEND = "$dir_pw_assert_log"
20+
pw_sys_io_BACKEND =
21+
"${chip_root}/examples/platform/bouffalolab/bl702/pw_sys_io:pw_sys_io_bl702"
22+
pw_span_ENABLE_STD_SPAN_POLYFILL = false
23+
24+
pw_string_CONFIG =
25+
"${chip_root}/config/bouffalolab/bl702/lib/pw_rpc:pw_string_dep"
26+
27+
pw_build_LINK_DEPS = [
28+
"$dir_pw_assert:impl",
29+
"$dir_pw_log:impl",
30+
]
31+
32+
dir_pw_third_party_nanopb = "${chip_root}/third_party/nanopb/repo"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Copyright (c) 2021 Project CHIP Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
import("//build_overrides/chip.gni")
16+
import("//build_overrides/pigweed.gni")
17+
import("$dir_pw_build/target_types.gni")
18+
19+
static_library("pw_rpc") {
20+
output_name = "libPwRpc"
21+
22+
public_configs = [ "${dir_pigweed}/pw_hdlc:default_config" ]
23+
24+
public_deps = [
25+
"$dir_pw_rpc:server",
26+
"$dir_pw_rpc/nanopb:echo_service",
27+
"${chip_root}/examples/platform/bouffalolab/bl702/pw_sys_io:pw_sys_io_bl702",
28+
"${dir_pigweed}/pw_hdlc:pw_rpc",
29+
dir_pw_assert,
30+
dir_pw_checksum,
31+
dir_pw_hdlc,
32+
dir_pw_log,
33+
]
34+
35+
output_dir = "${root_out_dir}/lib"
36+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright (c) 2021 Project CHIP Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
declare_args() {
16+
# Root directory for bl602 SDK build files.
17+
bl602_sdk_build_root =
18+
"//third_party/connectedhomeip/third_party/bouffalolab/bl602"
19+
20+
# Root directory for bl702 SDK build files.
21+
bl702_sdk_build_root =
22+
"//third_party/connectedhomeip/third_party/bouffalolab/bl702"
23+
24+
# Root directory of toolchain of Bouffalolab chips
25+
bouffalolab_toolchain = "/third_party/bouffalolab/repo/toolchain/riscv"
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
*
3+
* Copyright (c) 2021 Project CHIP Authors
4+
* All rights reserved.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
#include "PigweedLoggerMutex.h"
20+
21+
namespace chip {
22+
namespace rpc {
23+
24+
PigweedLoggerMutex logger_mutex;
25+
26+
} // namespace rpc
27+
} // namespace chip

0 commit comments

Comments
 (0)