From dab1febe9132a83543fac34f98b0c612903dead1 Mon Sep 17 00:00:00 2001 From: Rohit Date: Mon, 23 Jun 2025 17:09:17 +0530 Subject: [PATCH] components/esp-matter: Scheduled delegate initialisation on chip task. Fixes https://github.com/espressif/esp-matter/issues/1468 --- components/esp_matter/esp_matter_core.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/esp_matter/esp_matter_core.cpp b/components/esp_matter/esp_matter_core.cpp index 34f7a793b..4f5cbb4aa 100644 --- a/components/esp_matter/esp_matter_core.cpp +++ b/components/esp_matter/esp_matter_core.cpp @@ -797,6 +797,10 @@ static void esp_matter_chip_init_task(intptr_t context) chip::Server::GetInstance().GetICDManager().Shutdown(); } #endif // CHIP_CONFIG_ENABLE_ICD_SERVER + + // Initialise clusters which have delegate implemented + esp_matter::cluster::delegate_init_callback_common(); + PlatformMgr().ScheduleWork(deinit_ble_if_commissioned, reinterpret_cast(nullptr)); xTaskNotifyGive(task_to_notify); } @@ -888,8 +892,6 @@ static esp_err_t chip_init(event_callback_t callback, intptr_t callback_arg) PlatformMgr().ScheduleWork(esp_matter_chip_init_task, reinterpret_cast(xTaskGetCurrentTaskHandle())); // Wait for the matter stack to be initialized xTaskNotifyWait(0, 0, NULL, portMAX_DELAY); - // Initialise clusters which have delegate implemented - esp_matter::cluster::delegate_init_callback_common(); #endif // CONFIG_ESP_MATTER_ENABLE_MATTER_SERVER return ESP_OK;