Zigbee stack crash when registering multiple endpoints with identical clusters (ESP32-C6)

hosentraeger
Posts: 1
Joined: Sat Jul 05, 2025 10:11 pm

Zigbee stack crash when registering multiple endpoints with identical clusters (ESP32-C6)

Postby hosentraeger » Sat Jul 05, 2025 10:27 pm

Target: ESP32-C6
SDK: esp-zigbee-sdk
Example: esp_zigbee_HA_sample/HA_on_off_switch
IDF version: v5.4.1
ZB-SDK version: SHA256: 7904c3f30...

Problem:
I’m trying to implement a Zigbee On/Off switch device with two endpoints (EP 1 and EP 2), each acting as a separate on/off switch.
Using esp_zb_on_off_switch_new() works fine for one switch, but when I add a second one with a different endpoint, the Zigbee stack crashes during startup.

Code snippet:

Code: Select all

esp_zb_on_off_switch_cfg_t switch_cfg1 = {
.power_source = ESP_ZB_POWER_SOURCE_DC_SOURCE,
.install_code_policy = false,
.endpoint = 1,
};
esp_zb_on_off_switch_cfg_t switch_cfg2 = {
.power_source = ESP_ZB_POWER_SOURCE_DC_SOURCE,
.install_code_policy = false,
.endpoint = 2,
};

esp_zb_ep_list_t *ep_list = esp_zb_ep_list_create();
esp_zb_ep_list_add_ep(ep_list, esp_zb_on_off_switch_new(&switch_cfg1));
esp_zb_ep_list_add_ep(ep_list, esp_zb_on_off_switch_new(&switch_cfg2));

esp_zb_device_register(ep_list);
Observed behavior:
With two endpoints, the system crashes and reboots.
Zigbee stack fails with:

Code: Select all

Zigbee stack assertion failed /components/esp_zb_sdk/src/utility/data_model_adapter.c:235
abort() was called at PC 0x4201b26b
Workaround:
Using only one call to esp_zb_on_off_switch_new() (i.e. one endpoint) avoids the crash.

Questions:
  • [] Is esp_zb_on_off_switch_new() supposed to support multiple endpoints?
    [] If not, what’s the recommended way to build a multi-endpoint on/off switch?
  • Any known limitations or plans for improvement?
Thank you in advance!

Who is online

Users browsing this forum: Bing [Bot], Semrush [Bot] and 5 guests