logo elektroda
logo elektroda
X
logo elektroda

Bouffalo Lab BL702 Zigbee XT-ZB2 SDK zigbee_def.mk Missing When Building Home Assistant Integration

User question

Hi there,
I am using https://github.com/bouffalolab/bl_iot_sdk
for my Zigbee model XT-ZB2
Flashing no Problem: for test I could use the code demo_gpio with small modifications: Blinking LED. Everything fine!
I want integrate this model in me Home Assistant. So I use the code
bl_iot_sdk/customer_app/bl702_demo_event/ ./genzsedstartupbleperipheral CHIP=BL702 BOARD=bl702dk
Error message:
/Projekte/zigbee/bl_iot_sdk/components/network/zigbee/zigbee_def.mk: No such file or directory....

who the f*ck is the file Zigbee_def.mk

Best regards from Germany!
isicom

Artificial Intelligence Response

Direct answer to the question

  • zigbee_def.mk is a Makefile fragment that the BL IoT SDK includes from the Zigbee component to set include paths, preprocessor flags, and prebuilt library link options for the Zigbee stack.
  • Your build fails because the Zigbee component is not present (or its path is wrong) in your local SDK checkout, so the include of components/network/zigbee/zigbee_def.mk cannot be resolved.

Key points

  • Use the correct build script for this example: from customer_app/bl702_demo_event run ./genzb …, not genzsedstartupbleperipheral. (bouffalolab.github.io)
  • Ensure the Zigbee component exists under components/network/zigbee in your SDK; otherwise initialize/update the repository correctly or install an SDK package that actually contains Zigbee. (bouffalolab.github.io)
  • For Home Assistant (ZHA) integration, a simpler path is to run Bouffalo’s BLZ NCP/coordinator firmware and use the zigpy‑blz radio driver; this is an officially published experimental driver for BL70x radios. (community.home-assistant.io)

Detailed problem analysis

1) What zigbee_def.mk is and why the error appears

  • Identity: a Makefile include used by the BL IoT SDK’s build system to pull in the Zigbee stack configuration (CFLAGS/DEFINES, include paths, and prebuilt Zigbee libraries).
  • Typical location: bl_iot_sdk/components/network/zigbee/zigbee_def.mk (case-sensitive on Linux).
  • The error “…zigbee_def.mk: No such file or directory” means the Zigbee component directory is absent, incomplete, or the project Makefile includes it via a wrong relative path.

2) SDKs and example command you used

  • The BL IoT SDK documentation for BL702 Zigbee indicates the bl702_demo_event example is built using the genzb script. The command you tried (genzsedstartupbleperipheral) does not match the documented scripts and likely pulls different components/paths that are not present, causing the missing include. Build from customer_app/bl702_demo_event with:
    • ./genzb CHIP=bl702 BOARD=bl702dk
      This aligns with the current example instructions. (bouffalolab.github.io)

3) Repository state and why Zigbee can be missing

  • Over the last years, Bouffalo has reorganized SDKs. The newer “bouffalo_sdk” repo merges older SDKs but, per its own Wireless Support table, shows Zigbee “not supported” in that repository snapshot; so switching to bouffalo_sdk alone will not give you Zigbee today. The Zigbee examples remain documented under BL IoT SDK. (github.com)
  • If you cloned bl_iot_sdk without all content or from a mirror/branch that does not contain the proprietary Zigbee blobs, the components/network/zigbee directory (and thus zigbee_def.mk) will be missing. The official docs still show Zigbee demos for BL702 (including bl702_demo_event and genzb). (bouffalolab.github.io)

4) Practical diagnosis you can run in your tree

  • Verify presence of the Zigbee component:
    • cd /Projekte/zigbee/bl_iot_sdk
    • find components -maxdepth 2 -type d -name zigbee
    • ls -l components/network/zigbee/zigbee_def.mk
  • If missing, your checkout is incomplete for Zigbee. Re‑acquire the SDK so that Zigbee is included (see “Practical guidelines” below).
  • Also confirm you are in the correct working directory when running the script (customer_app/bl702_demo_event) and use CHIP=bl702 (lowercase in most docs) and a valid BOARD (e.g., bl702dk).

5) Home Assistant integration angle

  • If the goal is to get your XT‑ZB2 onto Home Assistant quickly, you don’t have to compile the example application first. BL70x radios can act as a Zigbee coordinator/NCP and integrate with HA’s ZHA via zigpy‑blz, Bouffalo’s experimental zigpy radio driver published in 2025. You flash the appropriate BLZ coordinator firmware and point ZHA to the serial port; the driver expects 2,000,000 baud by default. (community.home-assistant.io)

Current information and trends

  • BL IoT SDK documentation (as of the 1.6.39 series) still documents BL702 Zigbee examples and says to build bl702_demo_event with genzb. (bouffalolab.github.io)
  • Bouffalo’s “bouffalo_sdk” (the unified SDK) shows Zigbee unsupported in that repo snapshot, so for Zigbee you should stick with BL IoT SDK or with vendor Zigbee firmware images. (github.com)
  • Home Assistant: zigpy‑blz (published under the Bouffalo Lab org in 2025) enables BL70x radios to act as ZHA coordinators; a ZHA integration guide and BLZ serial protocol documents are linked from the HA community post. (community.home-assistant.io)
  • BL702/BL706 devices continue to be advertised by Bouffalo with Zigbee 3.0 support (HW capability), but distribution of stack binaries in public SDKs may vary. (en.bouffalolab.com)

Supporting explanations and details

  • Build includes: The project Makefile typically has an include like include $(BL_SDK_BASE)/components/network/zigbee/zigbee_def.mk. If BL_SDK_BASE points to your SDK root and the zigbee directory is absent, GNU make will fail exactly as you see.
  • Scripts: Bouffalo’s customer_app projects provide wrapper scripts (gencoord/genrouter/genzsed/etc. in some releases) to set Zigbee role or combine features. In current docs, genzb is the canonical script for the demo_event example; using a different script name can reference nonexisting build fragments, triggering missing-file errors. (bouffalolab.github.io)

Ethical and legal aspects

  • Zigbee stack implementations and precompiled libraries are often subject to licensing. Some SDK distributions omit these binaries from public repos. Always use Bouffalo‑provided packages for Zigbee to ensure you have redistribution rights and correct versions.

Practical guidelines

Do this in order: 1) Use the documented build script

  • cd /Projekte/zigbee/bl_iot_sdk/customer_app/bl702_demo_event
  • chmod +x genzb
  • ./genzb CHIP=bl702 BOARD=bl702dk

2) Verify the Zigbee component exists

  • cd /Projekte/zigbee/bl_iot_sdk
  • test -f components/network/zigbee/zigbee_def.mk && echo "OK: zigbee present" || echo "MISSING: zigbee"

3) If missing, (re)install an SDK package that includes Zigbee

  • Download or clone BL IoT SDK from Bouffalo’s official source referenced by their documentation page (not the unified bouffalo_sdk) and ensure you get the distribution that contains the Zigbee component. The current online docs describing genzb for BL702 come from the BL IoT SDK documentation site. (bouffalolab.github.io)

4) Environment sanity

  • Ensure BL_SDK_BASE (or BL60X_SDK_PATH in older setups) points to /Projekte/zigbee/bl_iot_sdk.
  • Use the SiFive/T-HEAD RISC‑V toolchain versions Bouffalo recommends for BL70x in this SDK.
  • Build on a case‑sensitive filesystem and keep file names’ case exact (zigbee_def.mk is lower‑case).

5) If your end goal is Home Assistant, consider the coordinator route

  • Flash BLZ coordinator/NCP firmware for your BL70x module and use ZHA with zigpy‑blz (baud 2,000,000 by default). This avoids compiling the demo and gets you straight to HA. (community.home-assistant.io)

Potential pitfalls and fixes

  • Wrong script name/path: use genzb from the example directory, not a composite script name. (bouffalolab.github.io)
  • Using bouffalo_sdk for Zigbee: current public repo snapshot lists Zigbee as unsupported, so it will not build Zigbee apps. (github.com)
  • Partial/incomplete SDK or mirror: re‑acquire from Bouffalo’s documented SDK source; follow their “BL IoT SDK” path, not only the unified SDK. (bouffalolab.github.io)

Possible disclaimers or additional notes

  • The availability of the Zigbee stack in public SDKs has changed over time; some packages omit proprietary blobs. If the Zigbee folder continues to be missing after a clean install, contact Bouffalo support or check their developer forum for the Zigbee-enabled package for BL702.
  • Some example scripts and names vary by SDK release; always align with the release notes or the example’s README for your commit/tag.

Suggestions for further research

  • Check the exact BL IoT SDK release/tag you have against the documentation version that mentions genzb for bl702_demo_event and obtain that release’s package. (bouffalolab.github.io)
  • Review Bouffalo’s BL IoT SDK getting-started for BL70x to confirm environment/toolchain versions. (bouffalolab.github.io)
  • For HA, read the zigpy‑blz ZHA integration guide linked from the HA community thread; it shows firmware, serial settings, and limitations. (community.home-assistant.io)

Brief summary

  • zigbee_def.mk is part of the Zigbee build configuration in BL IoT SDK; your error means the Zigbee component isn’t present or the wrong script/path is being used.
  • Build the documented BL702 Zigbee demo using ./genzb from customer_app/bl702_demo_event and make sure components/network/zigbee exists in your SDK. (bouffalolab.github.io)
  • If your target is Home Assistant integration, consider flashing BLZ coordinator firmware and using ZHA with zigpy‑blz; this is the most direct path to HA on BL70x today. (community.home-assistant.io)

If you paste the outputs of:

  • ls -l components/network/
  • ls -l components/network/zigbee/
  • the exact command and working directory you used,
    I’ll pinpoint the next step (re-acquire SDK vs. fix paths vs. toolchain setup).

Ask additional question

Wait...(2min)
Disclaimer: The responses provided by artificial intelligence (language model) may be inaccurate and misleading. Elektroda is not responsible for the accuracy, reliability, or completeness of the presented information. All responses should be verified by the user.