Skip to content

Commit 9f24353

Browse files
[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>
1 parent 177c5f3 commit 9f24353

94 files changed

Lines changed: 2142 additions & 2559 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: 63 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -54,85 +54,99 @@ jobs:
5454
if: ${{ !env.ACT }}
5555
with:
5656
gh-context: ${{ toJson(github) }}
57+
5758
- name: Build example BL602 Lighting App
5859
run: |
5960
./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: |
61+
"./scripts/build/build_examples.py --target bouffalolab-bl602dk-light-wifi-littlefs-mfd-rpc build"
6762
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
6863
bl602 bl602+mfd+littlefs+rpc lighting-app \
69-
out/artifacts/bouffalolab-bl602dk-light-wifi-littlefs-mfd-rpc/chip-bl602-lighting-example.out \
64+
out/bouffalolab-bl602dk-light-wifi-littlefs-mfd-rpc/chip-bl602-lighting-example.out \
7065
/tmp/bloat_reports/
71-
- name: Clean out build output
72-
run: rm -rf ./out
66+
rm -rf ./out
7367
74-
- name: Build example BL702 Lighting App
68+
- name: Build example BL702 Lighting App (Ethernet)
69+
if: github.event_name != 'pull_request'
7570
run: |
7671
./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: |
72+
"./scripts/build/build_examples.py --target bouffalolab-bl706dk-light-ethernet-easyflash build "
8673
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
8774
bl702 bl702+eth lighting-app \
88-
out/artifacts/bouffalolab-bl706dk-light-ethernet-easyflash/chip-bl702-lighting-example.out \
75+
out/bouffalolab-bl706dk-light-ethernet-easyflash/chip-bl702-lighting-example.out \
8976
/tmp/bloat_reports/
77+
rm -rf ./out
78+
79+
- name: Build example BL702 Lighting App (Wi-Fi)
80+
run: |
81+
./scripts/run_in_build_env.sh \
82+
"./scripts/build/build_examples.py --target bouffalolab-bl706dk-light-wifi-littlefs-shell build "
9083
.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 \
84+
bl702 bl702+eth lighting-app \
85+
out/bouffalolab-bl706dk-light-wifi-littlefs-shell/chip-bl702-lighting-example.out \
9386
/tmp/bloat_reports/
87+
rm -rf ./out
88+
89+
- name: Build example BL702 Lighting App (Thread)
90+
run: |
91+
./scripts/run_in_build_env.sh \
92+
"./scripts/build/build_examples.py --target bouffalolab-bl706dk-light-thread-littlefs-mfd-rpc build "
9493
.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 \
94+
bl702 bl702+eth lighting-app \
95+
out/bouffalolab-bl706dk-light-thread-littlefs-mfd-rpc/chip-bl702-lighting-example.out \
9796
/tmp/bloat_reports/
98-
- name: Clean out build output
99-
run: rm -rf ./out
97+
rm -rf ./out
10098
10199
- name: Build example BL702L Lighting App
102-
timeout-minutes: 30
100+
if: github.event_name != 'pull_request'
103101
run: |
104102
./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: |
103+
"./scripts/build/build_examples.py --target bouffalolab-bl704ldk-light-thread-littlefs-mfd build "
112104
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
113105
bl702l bl702l+mfd+littlefs lighting-app \
114-
out/artifacts/bouffalolab-bl704ldk-light-thread-littlefs-mfd/chip-bl702l-lighting-example.out \
106+
out/bouffalolab-bl704ldk-light-thread-littlefs-mfd/chip-bl702l-lighting-example.out \
115107
/tmp/bloat_reports/
116-
- name: Clean out build output
117-
run: rm -rf ./out
108+
rm -rf ./out
118109
119110
- name: Build example BL702L Contact Sensor
120-
timeout-minutes: 30
121111
run: |
122112
./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: |
113+
"./scripts/build/build_examples.py --target bouffalolab-bl704ldk-contact-sensor-thread-mtd-littlefs-mfd build"
130114
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
131115
bl702l bl702l+mfd+littlefs contact-sensor-app \
132-
out/artifacts/bouffalolab-bl704ldk-contact-sensor-thread-mtd-littlefs-mfd/chip-bl702l-contact-sensor-example.out \
116+
out/bouffalolab-bl704ldk-contact-sensor-thread-mtd-littlefs-mfd/chip-bl702l-contact-sensor-example.out \
117+
/tmp/bloat_reports/
118+
rm -rf ./out
119+
120+
- name: Build example BL616 Lighting App (Ethernet)
121+
if: github.event_name != 'pull_request'
122+
run: |
123+
./scripts/run_in_build_env.sh \
124+
"./scripts/build/build_examples.py --target bouffalolab-bl616dk-light-ethernet-littlefs-mfd build "
125+
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
126+
bl616 bl616+ethernet lighting-app \
127+
out/bouffalolab-bl616dk-light-ethernet-littlefs-mfd/chip-bl616-lighting-example.out \
128+
/tmp/bloat_reports/
129+
rm -rf ./out
130+
131+
- name: Build example BL616 Lighting App (Wi-Fi)
132+
run: |
133+
./scripts/run_in_build_env.sh \
134+
"./scripts/build/build_examples.py --target bouffalolab-bl616dk-light-wifi-littlefs-mfd-shell build"
135+
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
136+
bl616 bl616+wifi+shell lighting-app \
137+
out/bouffalolab-bl616dk-light-wifi-littlefs-mfd-shell/chip-bl616-lighting-example.out \
138+
/tmp/bloat_reports/
139+
rm -rf ./out
140+
141+
- name: Build example BL616 Lighting App (Thread)
142+
run: |
143+
./scripts/run_in_build_env.sh \
144+
"./scripts/build/build_examples.py --target bouffalolab-bl616dk-light-thread-littlefs-mfd build"
145+
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
146+
bl616 bl616+thread lighting-app \
147+
out/bouffalolab-bl616dk-light-thread-littlefs-mfd/chip-bl616-lighting-example.out \
133148
/tmp/bloat_reports/
134-
- name: Clean out build output
135-
run: rm -rf ./out
149+
rm -rf ./out
136150
137151
- name: Uploading Size Reports
138152
uses: ./.github/actions/upload-size-reports

.gitmodules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@
227227
url = https://github.com/bouffalolab/bl_iot_sdk_tiny.git
228228
branch = main
229229
platforms = bouffalolab
230+
recursive = true
230231
[submodule "third_party/libwebsockets/repo"]
231232
path = third_party/libwebsockets/repo
232233
url = https://github.com/warmcat/libwebsockets
@@ -348,3 +349,8 @@
348349
path = third_party/uriparser/repo
349350
url = https://github.com/uriparser/uriparser.git
350351
branch = uriparser-1.0.0
352+
[submodule "third_party/bouffalolab/repo_bouffalo_sdk"]
353+
path = third_party/bouffalolab/repo_bouffalo_sdk
354+
url = https://github.com/bouffalolab/bouffalo_sdk.git
355+
branch = main
356+
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)