From b6e2f93db269ad2bba8715953cb56f93bae4fc2f Mon Sep 17 00:00:00 2001 From: Zhou Xiao Date: Fri, 7 Aug 2026 18:34:39 +0800 Subject: [PATCH] fix(nimble): initialize BLE Log in host-only mode (cherry picked from commit 82f035a8998a1473b700d9d100cdbf287f265989) --- porting/nimble/src/nimble_port.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/porting/nimble/src/nimble_port.c b/porting/nimble/src/nimble_port.c index 50b3b596a..67f5d98f1 100644 --- a/porting/nimble/src/nimble_port.c +++ b/porting/nimble/src/nimble_port.c @@ -52,6 +52,9 @@ #endif #include "bt_osal.h" #include "bt_prf_task.h" +#if CONFIG_BLE_LOG_ENABLED && !CONFIG_BT_CONTROLLER_ENABLED +#include "ble_log.h" +#endif #define NIMBLE_PORT_LOG_TAG "BLE_INIT" @@ -229,6 +232,12 @@ esp_err_t esp_nimble_init(void) } #endif +#if CONFIG_BLE_LOG_ENABLED && !CONFIG_BT_CONTROLLER_ENABLED + if (!ble_log_init()) { + ESP_LOGW(NIMBLE_PORT_LOG_TAG, "BLE Log init failed"); + } +#endif + return ESP_OK; } @@ -246,6 +255,10 @@ esp_err_t esp_nimble_deinit(void) ble_npl_deiniting = true; #endif +#if CONFIG_BLE_LOG_ENABLED && !CONFIG_BT_CONTROLLER_ENABLED + ble_log_deinit(); +#endif + ble_transport_ll_deinit(); #if (BT_HCI_LOG_INCLUDED == TRUE)