Skip to content

[Bouffalo Lab] Update BFLB platform and SDK support#72571

Open
wy-hh wants to merge 7 commits into
project-chip:masterfrom
wy-hh:sdk-update-pr
Open

[Bouffalo Lab] Update BFLB platform and SDK support#72571
wy-hh wants to merge 7 commits into
project-chip:masterfrom
wy-hh:sdk-update-pr

Conversation

@wy-hh

@wy-hh wy-hh commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Problem
  • Bouffalo Lab platform support needs to be updated for the BFLB SDK flow.
  • The lighting and contact sensor examples need CMake/build integration for BFLB SDK based targets.
  • macOS builds require special handling because the Bouffalo SDK toolchain path can retain LTO-related flags that break linking.
Solution
  • Updated Bouffalo Lab platform support for the BFLB SDK, including shared BFLB platform files, refreshed build targets, SDK configuration handling, flashing, OTA image
    generation, factory data support, and documentation.
  • Added Bouffalo Lab lighting and contact sensor example integration for BFLB SDK builds.
  • Added shared CMake handling for Bouffalo SDK examples, including a macOS workaround that removes LTO flags and disables linker plugin usage when required.

Testing

Tested commissioning, onoff toggle, boolean state report and ota upgrading with following targets:

  • bouffalolab-bl616dk-light-wifi-littlefs
  • bouffalolab-bl616dk-contact-sensor-wifi-littlefs
  • bouffalolab-bl602dk-light-wifi-littlefs-mfd
  • bouffalolab-bl616cldk-light-wifi-littlefs-mfd
  • bouffalolab-bl616cldk-light-wifi-littlefs-mfd
  • bouffalolab-bl704ldk-contact-sensor-thread-mtd-littlefs
  • bouffalolab-bl706dk-light-thread-littlefs-mfd
  • bouffalolab-bl616dk-light-thread-littlefs-mfd

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a CMake-based build system for Bouffalo Lab platforms (specifically BL61X series) across the contact-sensor and lighting examples, replacing older GN configurations and updating documentation. It also refactors low-power PDS management, OpenThread initialization, and logging to support the unified 'bflb' platform layer. The review feedback highlights several critical issues, including potential null pointer dereferences in low-power and Thread stack idle checks, thread-safety concerns with local static variables in interrupt contexts, and macro safety issues in FreeRTOSConfig.h. Additionally, the reviewer noted format string mismatches, parsing bugs in the OTA script when handling parenthesized macros, and logging inconsistencies in Python scripts.

Comment thread examples/contact-sensor-app/bouffalolab/bflb/app_pds.cpp Outdated
Comment thread examples/contact-sensor-app/bouffalolab/bflb/app_pds.cpp
Comment thread examples/contact-sensor-app/bouffalolab/bflb/app_pds.cpp Outdated
Comment thread examples/contact-sensor-app/bouffalolab/bflb/FreeRTOSConfig.h Outdated
Comment thread examples/contact-sensor-app/bouffalolab/bl702l/app_pds.cpp
Comment thread examples/contact-sensor-app/bouffalolab/bl702l/app_pds.cpp Outdated
Comment thread examples/lighting-app/bouffalolab/common/AppTask.cpp Outdated
Comment thread scripts/tools/bouffalolab/bouffalolab_ota_image.py
Comment thread scripts/build/builders/bouffalolab.py Outdated
Comment thread scripts/flashing/bouffalolab_firmware_utils.py
wy-hh added 3 commits June 15, 2026 15:19
Update Bouffalo Lab platform support for the BFLB SDK, including shared BFLB platform files, lighting and contact sensor example build integration, refreshed build targets, documentation, flashing, OTA image, factory data, and SDK configuration handling.

Add shared CMake handling for Bouffalo SDK builds, including a macOS workaround that removes LTO flags and disables linker plugin usage when required.
Update Bouffalo follow-up changes for PDS safety, OTA metadata parsing, logging format cleanup, generated contact sensor data model, and build target testdata.
@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.08%. Comparing base (ace3ccc) to head (9b474f8).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #72571   +/-   ##
=======================================
  Coverage   56.08%   56.08%           
=======================================
  Files        1640     1640           
  Lines      112463   112463           
  Branches    13316    13316           
=======================================
  Hits        63075    63075           
  Misses      49388    49388           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown

PR #72571: Size comparison from ace3ccc to a1b3a5b

Full report (20 builds for cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, psoc6, qpg, realtek, stm32)
platform target config section ace3ccc a1b3a5b change % change
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 777008 777008 0 0.0
RAM 103404 103404 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 789760 789760 0 0.0
RAM 108684 108684 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 738868 738868 0 0.0
RAM 97612 97612 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 719040 719040 0 0.0
RAM 97644 97644 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 569106 569106 0 0.0
RAM 205112 205112 0 0.0
lock CC3235SF_LAUNCHXL FLASH 596658 596658 0 0.0
RAM 205272 205272 0 0.0
efr32 lighting-app BRD4187C FLASH 1094308 1094308 0 0.0
RAM 135256 135256 0 0.0
lock-app BRD4187C FLASH 994320 994320 0 0.0
RAM 131292 131292 0 0.0
BRD4338a FLASH 799169 799169 0 0.0
RAM 243432 243432 0 0.0
esp32 all-clusters-app c3devkit DRAM 99876 99876 0 0.0
FLASH 1623944 1623944 0 0.0
IRAM 94776 94776 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 834496 834496 0 0.0
RAM 157693 157693 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1737236 1737236 0 0.0
RAM 215412 215412 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1625916 1625916 0 0.0
RAM 211604 211604 0 0.0
light cy8ckit_062s2_43012 FLASH 1470220 1470220 0 0.0
RAM 197436 197436 0 0.0
lock cy8ckit_062s2_43012 FLASH 1503676 1503676 0 0.0
RAM 225268 225268 0 0.0
qpg lighting-app qpg6200+debug FLASH 842424 842424 0 0.0
RAM 127908 127908 0 0.0
lock-app qpg6200+debug FLASH 782260 782260 0 0.0
RAM 118840 118840 0 0.0
realtek light-switch-app rtl8777g FLASH 688816 688816 0 0.0
RAM 101780 101780 0 0.0
lighting-app rtl8777g FLASH 729760 729760 0 0.0
RAM 102052 102052 0 0.0
stm32 light STM32WB5MM-DK FLASH 478464 478464 0 0.0
RAM 141492 141492 0 0.0

Add the ota-requestor interface dependency when OTA requestor sources are enabled so BFLB builds pass GN include checks.
@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown

PR #72571: Size comparison from ace3ccc to 9b474f8

Increases above 0.2%:

platform target config section ace3ccc 9b474f8 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1094288 1098106 3818 0.3
bl702 lighting-app bl702+eth FLASH 1057262 1084658 27396 2.6
RAM 108525 109029 504 0.5
bl702l contact-sensor-app bl702l+mfd+littlefs RAM 105908 108596 2688 2.5
Full report (33 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, psoc6, qpg, realtek, stm32, telink)
platform target config section ace3ccc 9b474f8 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1094288 1098106 3818 0.3
RAM 144882 133418 -11464 -7.9
bl702 lighting-app bl702+eth FLASH 1057262 1084658 27396 2.6
RAM 108525 109029 504 0.5
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 896094 881818 -14276 -1.6
RAM 105908 108596 2688 2.5
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 777008 777008 0 0.0
RAM 103404 103404 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 789760 789760 0 0.0
RAM 108684 108684 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 738868 738868 0 0.0
RAM 97612 97612 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 719040 719040 0 0.0
RAM 97644 97644 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 569106 569106 0 0.0
RAM 205112 205112 0 0.0
lock CC3235SF_LAUNCHXL FLASH 596658 596658 0 0.0
RAM 205272 205272 0 0.0
efr32 lighting-app BRD4187C FLASH 1094308 1094308 0 0.0
RAM 135256 135256 0 0.0
lock-app BRD4187C FLASH 994320 994320 0 0.0
RAM 131292 131292 0 0.0
BRD4338a FLASH 799169 799169 0 0.0
RAM 243432 243432 0 0.0
esp32 all-clusters-app c3devkit DRAM 99876 99876 0 0.0
FLASH 1623944 1623944 0 0.0
IRAM 94776 94776 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 834496 834496 0 0.0
RAM 157693 157693 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1737236 1737236 0 0.0
RAM 215412 215412 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1625916 1625916 0 0.0
RAM 211604 211604 0 0.0
light cy8ckit_062s2_43012 FLASH 1470220 1470220 0 0.0
RAM 197436 197436 0 0.0
lock cy8ckit_062s2_43012 FLASH 1503676 1503676 0 0.0
RAM 225268 225268 0 0.0
qpg lighting-app qpg6200+debug FLASH 842424 842424 0 0.0
RAM 127908 127908 0 0.0
lock-app qpg6200+debug FLASH 782260 782260 0 0.0
RAM 118840 118840 0 0.0
realtek light-switch-app rtl8777g FLASH 688816 688816 0 0.0
RAM 101780 101780 0 0.0
lighting-app rtl8777g FLASH 729760 729760 0 0.0
RAM 102052 102052 0 0.0
stm32 light STM32WB5MM-DK FLASH 478464 478464 0 0.0
RAM 141492 141492 0 0.0
telink all-devices-app tl7218x FLASH 833912 833912 0 0.0
RAM 99028 99028 0 0.0
tlsr9118bdk40d FLASH 625238 625238 0 0.0
RAM 120160 120160 0 0.0
bridge-app tl7218x FLASH 733700 733700 0 0.0
RAM 97700 97700 0 0.0
light-app-ota-compress-lzma-factory-data tl3218x FLASH 800190 800190 0 0.0
RAM 42380 42380 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl7218x FLASH 845370 845370 0 0.0
RAM 101492 101492 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 734192 734192 0 0.0
RAM 57816 57816 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 795254 795254 0 0.0
RAM 75176 75176 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 734066 734066 0 0.0
RAM 34472 34472 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 614710 614710 0 0.0
RAM 118508 118508 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 841318 841322 4 0.0
RAM 97376 97376 0 0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant