Skip to content

Commit 3fb150c

Browse files
[Bouffalo Lab] Add/update Bouffalo platform SDK repo (project-chip#43273) (#10)
* [Bouffalo Lab] Add/update Bouffalo platform SDK repo (project-chip#43273) * [Bouffalo Lab] Add BouffaloSDK for bl616 * update to use psram cachable address * [Bouffalo Lab] Re-assign memory address of matter platform task for BL702 (#7) * [Bouffalo Lab] update bl702l compile script for thread commissioning (#8) * fix get thread network interface in DiagnosticDataProviderImpl * update sdk * fix compile error after merge with latest code * update as gemini-code-assist suggested * Restyled by whitespace * Restyled by clang-format * Restyled by gn * Restyled by ruff * Restyled by autopep8 * Restyled by clang-format * fix targets test data * Restyled by clang-format * Restyled by prettier-markdown * resume workflows in a single job * Exclude Bouffalo SDK from run-clang-tidy-on-compile-commands.py execution in build.yaml. * recover build.yaml * remove bouffalo sdk repo * clone bouffalo sdk to path third_party/bouffalolab/repo_bouffalo_sdk * update bouffalolab workflows build jobs --------- Co-authored-by: Restyled.io <commits@restyled.io> * Restyled by clang-format * Restyled by ruff --------- Co-authored-by: Restyled.io <commits@restyled.io>
1 parent d0538c5 commit 3fb150c

94 files changed

Lines changed: 2154 additions & 2570 deletions

File tree

Some content is hidden

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

.github/workflows/examples-bouffalolab.yaml

Lines changed: 64 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ on:
2525

2626
concurrency:
2727
group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }}
28+
2829
cancel-in-progress: true
2930

3031
env:
@@ -54,85 +55,99 @@ jobs:
5455
if: ${{ !env.ACT }}
5556
with:
5657
gh-context: ${{ toJson(github) }}
58+
5759
- name: Build example BL602 Lighting App
5860
run: |
5961
./scripts/run_in_build_env.sh \
60-
"./scripts/build/build_examples.py \
61-
--target bouffalolab-bl602dk-light-wifi-littlefs-mfd-rpc \
62-
build \
63-
--copy-artifacts-to out/artifacts \
64-
"
65-
- name: Prepare some bloat report from the previous builds
66-
run: |
62+
"./scripts/build/build_examples.py --target bouffalolab-bl602dk-light-wifi-littlefs-mfd-rpc build"
6763
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
6864
bl602 bl602+mfd+littlefs+rpc lighting-app \
69-
out/artifacts/bouffalolab-bl602dk-light-wifi-littlefs-mfd-rpc/chip-bl602-lighting-example.out \
65+
out/bouffalolab-bl602dk-light-wifi-littlefs-mfd-rpc/chip-bl602-lighting-example.out \
7066
/tmp/bloat_reports/
71-
- name: Clean out build output
72-
run: rm -rf ./out
67+
rm -rf ./out
7368
74-
- name: Build example BL702 Lighting App
69+
- name: Build example BL702 Lighting App (Ethernet)
70+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'bouffalolab/bflb-connectedhomeip'
7571
run: |
7672
./scripts/run_in_build_env.sh \
77-
"./scripts/build/build_examples.py \
78-
--target bouffalolab-bl706dk-light-ethernet-easyflash \
79-
--target bouffalolab-bl706dk-light-wifi-littlefs \
80-
--target bouffalolab-bl706dk-light-thread-littlefs-mfd-rpc \
81-
build \
82-
--copy-artifacts-to out/artifacts \
83-
"
84-
- name: Prepare some bloat report from the previous builds
85-
run: |
73+
"./scripts/build/build_examples.py --target bouffalolab-bl706dk-light-ethernet-easyflash build "
8674
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
8775
bl702 bl702+eth lighting-app \
88-
out/artifacts/bouffalolab-bl706dk-light-ethernet-easyflash/chip-bl702-lighting-example.out \
76+
out/bouffalolab-bl706dk-light-ethernet-easyflash/chip-bl702-lighting-example.out \
8977
/tmp/bloat_reports/
78+
rm -rf ./out
79+
80+
- name: Build example BL702 Lighting App (Wi-Fi)
81+
run: |
82+
./scripts/run_in_build_env.sh \
83+
"./scripts/build/build_examples.py --target bouffalolab-bl706dk-light-wifi-littlefs-shell build "
9084
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
91-
bl702 bl702+wifi lighting-app \
92-
out/artifacts/bouffalolab-bl706dk-light-wifi-littlefs/chip-bl702-lighting-example.out \
85+
bl702 bl702+eth lighting-app \
86+
out/bouffalolab-bl706dk-light-wifi-littlefs-shell/chip-bl702-lighting-example.out \
9387
/tmp/bloat_reports/
88+
rm -rf ./out
89+
90+
- name: Build example BL702 Lighting App (Thread)
91+
run: |
92+
./scripts/run_in_build_env.sh \
93+
"./scripts/build/build_examples.py --target bouffalolab-bl706dk-light-thread-littlefs-mfd-rpc build "
9494
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
95-
bl702 bl706+mfd+rpc+littlefs lighting-app \
96-
out/artifacts/bouffalolab-bl706dk-light-thread-littlefs-mfd-rpc/chip-bl702-lighting-example.out \
95+
bl702 bl702+eth lighting-app \
96+
out/bouffalolab-bl706dk-light-thread-littlefs-mfd-rpc/chip-bl702-lighting-example.out \
9797
/tmp/bloat_reports/
98-
- name: Clean out build output
99-
run: rm -rf ./out
98+
rm -rf ./out
10099
101100
- name: Build example BL702L Lighting App
102-
timeout-minutes: 30
101+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'bouffalolab/bflb-connectedhomeip'
103102
run: |
104103
./scripts/run_in_build_env.sh \
105-
"./scripts/build/build_examples.py \
106-
--target bouffalolab-bl704ldk-light-thread-littlefs-mfd \
107-
build \
108-
--copy-artifacts-to out/artifacts \
109-
"
110-
- name: Prepare some bloat report from the previous builds
111-
run: |
104+
"./scripts/build/build_examples.py --target bouffalolab-bl704ldk-light-thread-littlefs-mfd build "
112105
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
113106
bl702l bl702l+mfd+littlefs lighting-app \
114-
out/artifacts/bouffalolab-bl704ldk-light-thread-littlefs-mfd/chip-bl702l-lighting-example.out \
107+
out/bouffalolab-bl704ldk-light-thread-littlefs-mfd/chip-bl702l-lighting-example.out \
115108
/tmp/bloat_reports/
116-
- name: Clean out build output
117-
run: rm -rf ./out
109+
rm -rf ./out
118110
119111
- name: Build example BL702L Contact Sensor
120-
timeout-minutes: 30
121112
run: |
122113
./scripts/run_in_build_env.sh \
123-
"./scripts/build/build_examples.py \
124-
--target bouffalolab-bl704ldk-contact-sensor-thread-mtd-littlefs-mfd \
125-
build \
126-
--copy-artifacts-to out/artifacts \
127-
"
128-
- name: Prepare some bloat report from the previous builds
129-
run: |
114+
"./scripts/build/build_examples.py --target bouffalolab-bl704ldk-contact-sensor-thread-mtd-littlefs-mfd build"
130115
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
131116
bl702l bl702l+mfd+littlefs contact-sensor-app \
132-
out/artifacts/bouffalolab-bl704ldk-contact-sensor-thread-mtd-littlefs-mfd/chip-bl702l-contact-sensor-example.out \
117+
out/bouffalolab-bl704ldk-contact-sensor-thread-mtd-littlefs-mfd/chip-bl702l-contact-sensor-example.out \
118+
/tmp/bloat_reports/
119+
rm -rf ./out
120+
121+
- name: Build example BL616 Lighting App (Ethernet)
122+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'bouffalolab/bflb-connectedhomeip'
123+
run: |
124+
./scripts/run_in_build_env.sh \
125+
"./scripts/build/build_examples.py --target bouffalolab-bl616dk-light-ethernet-littlefs-mfd build "
126+
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
127+
bl616 bl616+ethernet lighting-app \
128+
out/bouffalolab-bl616dk-light-ethernet-littlefs-mfd/chip-bl616-lighting-example.out \
129+
/tmp/bloat_reports/
130+
rm -rf ./out
131+
132+
- name: Build example BL616 Lighting App (Wi-Fi)
133+
run: |
134+
./scripts/run_in_build_env.sh \
135+
"./scripts/build/build_examples.py --target bouffalolab-bl616dk-light-wifi-littlefs-mfd-shell build"
136+
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
137+
bl616 bl616+wifi+shell lighting-app \
138+
out/bouffalolab-bl616dk-light-wifi-littlefs-mfd-shell/chip-bl616-lighting-example.out \
139+
/tmp/bloat_reports/
140+
rm -rf ./out
141+
142+
- name: Build example BL616 Lighting App (Thread)
143+
run: |
144+
./scripts/run_in_build_env.sh \
145+
"./scripts/build/build_examples.py --target bouffalolab-bl616dk-light-thread-littlefs-mfd build"
146+
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
147+
bl616 bl616+thread lighting-app \
148+
out/bouffalolab-bl616dk-light-thread-littlefs-mfd/chip-bl616-lighting-example.out \
133149
/tmp/bloat_reports/
134-
- name: Clean out build output
135-
run: rm -rf ./out
150+
rm -rf ./out
136151
137152
- name: Uploading Size Reports
138153
uses: ./.github/actions/upload-size-reports

.gitmodules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@
226226
url = https://github.com/bouffalolab/bl_iot_sdk_tiny.git
227227
branch = main
228228
platforms = bouffalolab
229+
recursive = true
229230
[submodule "third_party/libwebsockets/repo"]
230231
path = third_party/libwebsockets/repo
231232
url = https://github.com/warmcat/libwebsockets
@@ -334,3 +335,8 @@
334335
url = https://github.com/awslabs/amazon-kinesis-video-streams-webrtc-sdk-c
335336
platforms = esp32
336337
recursive = true
338+
[submodule "third_party/bouffalolab/repo_bouffalo_sdk"]
339+
path = third_party/bouffalolab/repo_bouffalo_sdk
340+
url = https://github.com/bouffalolab/bouffalo_sdk.git
341+
branch = main
342+
platforms = bouffalolab

docs/platforms/bouffalolab/getting_started.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ following command to list supports options.
9292
The output with `bouffalolab` started likes below:
9393
9494
```
95-
bouffalolab-{bl602dk,bl704ldk,bl706dk,bl602-night-light,bl706-night-light,bl602-iot-matter-v1,xt-zb6-devkit}-{light,contact-sensor}-{ethernet,wifi,thread,thread-ftd,thread-mtd}-{easyflash,littlefs}[-shell][-mfd][-rotating_device_id][-rpc][-cdc]
95+
bouffalolab-{bl602-night-light,bl602dk,bl616dk,bl704ldk,bl706-night-light,bl706dk}-{contact-sensor,light}-{ethernet,thread,thread-ftd,thread-mtd,wifi}-{easyflash,littlefs}[-cdc][-coredump][-memmonitor][-mfd][-mot][-rotating_device_id][-rpc][-shell]
9696
```
9797
9898
- supported board options, select one of the following options to build
@@ -104,8 +104,6 @@ bouffalolab-{bl602dk,bl704ldk,bl706dk,bl602-night-light,bl706-night-light,bl602-
104104
105105
- `-bl602-night-light`
106106
- `-bl706-night-light`
107-
- `-bl602-iot-matter-v1`
108-
- `-xt-zb6-devkit`
109107
110108
- supported example options, select one of the following options to build
111109
@@ -131,8 +129,9 @@ bouffalolab-{bl602dk,bl704ldk,bl706dk,bl602-night-light,bl706-night-light,bl602-
131129
132130
- `-easyflash`, specifies to use `easyflash` for flash access.
133131
134-
> `littlefs` has different format with `easyflash`, please uses
135-
> `-easyflash` for your in-field production
132+
> `littlefs` uses a different format than `easyflash` and they are not
133+
> compatible. Please use the `-easyflash` flag if existing in-field
134+
> devices were already deployed with `easyflash`.
136135
137136
- `-rotating_device_id`, enable rotating device id
138137
@@ -170,6 +169,15 @@ Taking lighting app with `littlefs` supported as example :
170169
./scripts/build/build_examples.py --target bouffalolab-bl616dk-light-wifi-littlefs build
171170
```
172171
172+
- BL706 with Wi-Fi
173+
174+
```
175+
./scripts/build/build_examples.py --target bouffalolab-bl706dk-light-ethernet-littlefs build
176+
```
177+
178+
> This BL706 + BL602 Wi-Fi solution: BL602 runs WLAN part and BL706 runs
179+
> TCP/IP stack which uses SPI for communication between these two parts.
180+
173181
- BL616 with Thread
174182
175183
```
@@ -194,15 +202,12 @@ Taking lighting app with `littlefs` supported as example :
194202
./scripts/build/build_examples.py --target bouffalolab-bl706dk-light-ethernet-littlefs build
195203
```
196204
197-
- BL706 with Wi-Fi
205+
- BL616 with Ethernet
198206
199207
```
200-
./scripts/build/build_examples.py --target bouffalolab-bl706dk-light-ethernet-littlefs build
208+
./scripts/build/build_examples.py --target bouffalolab-bl616dk-light-ethernet-littlefs build
201209
```
202210
203-
> This BL706 + BL602 Wi-Fi solution: BL602 runs WLAN part and BL706 runs
204-
> TCP/IP stack which uses SPI for communication between these two parts.
205-
206211
# Partition table
207212
208213
`Bouffalo Lab` provides reference partition table files for each platform under

examples/contact-sensor-app/bouffalolab/bl702l/app_pds.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@ void app_pds_fastboot_done_callback(void)
9595

9696
bl_psram_init();
9797

98-
// app_pds_config_pin();
99-
10098
app_pds_wakeup_source = bl_pds_get_wakeup_source();
10199
app_pds_wakeup_pin = bl_pds_get_wakeup_gpio();
102100
}
@@ -107,6 +105,7 @@ int app_pds_before_sleep_callback(void)
107105
{
108106
bl_pds_set_psram_retention(1);
109107
lmac154_sleepStoreRegs(low_power_pds_lmac154_backup);
108+
L1C_Cache_Flush();
110109

111110
return 0;
112111
}
@@ -125,6 +124,7 @@ void app_pds_after_sleep_callback(void)
125124

126125
zb_timer_restore_events(true);
127126

127+
lmac154_enableCoex();
128128
bl_irq_enable(M154_IRQn);
129129
}
130130
bl_sec_init();

examples/contact-sensor-app/bouffalolab/bl702l/args.gni

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ bl_iot_sdk_target = get_label_info(":sdk", "label_no_toolchain")
2121

2222
chip_detail_logging = false
2323
is_debug = false
24-
chip_progress_logging = true
24+
chip_progress_logging = false
2525
chip_error_logging = true
2626

2727
chip_enable_icd_server = true

examples/contact-sensor-app/bouffalolab/common/AppTask.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void AppTask::AppShellTask(void * args)
7373
Shell::Engine::Root().RunMainLoop();
7474
}
7575

76-
CHIP_ERROR AppTask::StartAppShellTask()
76+
void AppTask::StartAppShellTask()
7777
{
7878
static TaskHandle_t shellTask;
7979

@@ -82,8 +82,6 @@ CHIP_ERROR AppTask::StartAppShellTask()
8282
cmd_misc_init();
8383

8484
xTaskCreate(AppTask::AppShellTask, "chip_shell", 1024 / sizeof(configSTACK_DEPTH_TYPE), NULL, APP_TASK_PRIORITY, &shellTask);
85-
86-
return CHIP_NO_ERROR;
8785
}
8886
#endif
8987

examples/contact-sensor-app/bouffalolab/common/AppTask.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class AppTask
107107
static void AppTaskMain(void * pvParameter);
108108

109109
#if CONFIG_ENABLE_CHIP_SHELL
110-
static CHIP_ERROR StartAppShellTask();
110+
static void StartAppShellTask();
111111
static void AppShellTask(void * args);
112112
#endif
113113

examples/lighting-app/bouffalolab/bl602/BUILD.gn

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,6 @@ bouffalolab_executable("lighting_app") {
109109
defines +=
110110
[ "CONFIG_BOUFFALOLAB_FACTORY_DATA_ENABLE=${chip_enable_factory_data}" ]
111111

112-
if (enable_lwip_pbuf_ram) {
113-
defines += [ "CHIP_SYSTEM_CONFIG_PACKETBUFFER_LWIP_PBUF_RAM=1" ]
114-
}
115-
116112
bl_plat_name = "bl602"
117113
sources = [
118114
"${examples_plat_dir}/common/route_hook/bl_route_hook.c",
@@ -232,10 +228,6 @@ bouffalolab_executable("lighting_app") {
232228
inputs = [ ldscript ]
233229

234230
if (chip_print_memory_usage) {
235-
if (enable_lwip_pbuf_ram) {
236-
ldflags += [ "-Wl,--defsym=__RAM_PBUF_POOL=0" ]
237-
}
238-
239231
ldflags += [
240232
"-Wl,--print-memory-usage",
241233
"-fstack-usage",

examples/lighting-app/bouffalolab/bl616/BUILD.gn

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ declare_args() {
5454
board = "BL616DK"
5555
module_type = "BL616"
5656
baudrate = 2000000
57+
58+
app_ver_x = 2
59+
app_ver_y = 1
60+
app_ver_z = 0
5761
}
5862

5963
bouffalo_sdk("sdk") {
@@ -72,8 +76,18 @@ bouffalo_sdk("sdk") {
7276
"OTA_PERIODIC_TIMEOUT=${ota_periodic_query_timeout_seconds}",
7377
"OTA_AUTO_REBOOT_DELAY=${ota_auto_reboot_delay_seconds}",
7478
"CHIP_UART_BAUDRATE=${baudrate}",
79+
"APP_VER_X=${app_ver_x}",
80+
"APP_VER_Y=${app_ver_y}",
81+
"APP_VER_Z=${app_ver_z}",
7582
]
7683

84+
if (chip_enable_ethernet) {
85+
include_dirs += [ "${example_dir}/bl616/ethernet" ]
86+
} else if (chip_enable_wifi) {
87+
include_dirs += [ "${example_dir}/bl616/wifi" ]
88+
}
89+
defines += [ "CHIP_DEVICE_CONFIG_ENABLE_ETHERNET=${chip_enable_ethernet}" ]
90+
7791
defines += [ "PW_RPC_ENABLED=${chip_enable_pw_rpc}" ]
7892
if (chip_enable_pw_rpc) {
7993
include_dirs += [ "${examples_plat_dir}/common/rpc" ]
@@ -121,12 +135,7 @@ bouffalolab_executable("lighting_app") {
121135
defines += [ "BOOT_PIN_RESET=2" ]
122136
}
123137

124-
if (enable_lwip_pbuf_ram) {
125-
defines += [ "CHIP_SYSTEM_CONFIG_PACKETBUFFER_LWIP_PBUF_RAM=1" ]
126-
}
127-
128138
defines += [ "BL616DK" ]
129-
130139
sources = [
131140
"${chip_root}/examples/providers/DeviceInfoProviderImpl.cpp",
132141
"${example_dir}/common/AppTask.cpp",

examples/lighting-app/bouffalolab/bl616/FreeRTOSConfig.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,6 @@ to exclude the API function. */
103103
#define INCLUDE_xTaskGetHandle 1
104104
#define INCLUDE_xSemaphoreGetMutexHolder 1
105105

106-
/* Normal assert() semantics without relying on the provision of an assert.h
107-
header file. */
108-
void vApplicationMallocFailedHook(void);
109-
110106
#if __cplusplus
111107
extern "C" void vAssertCalled(void);
112108
#else

0 commit comments

Comments
 (0)