From f4684b49cc114f763e90f45e27b3611a1bc96562 Mon Sep 17 00:00:00 2001 From: luoxu Date: Mon, 3 Nov 2025 10:41:25 +0800 Subject: [PATCH 1/4] fix(ble_mesh): fixed incorrect log argument --- components/bt/esp_ble_mesh/v1.1/btc/btc_ble_mesh_dfu_model.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/bt/esp_ble_mesh/v1.1/btc/btc_ble_mesh_dfu_model.c b/components/bt/esp_ble_mesh/v1.1/btc/btc_ble_mesh_dfu_model.c index d60df283f14..b6fe3ecdbd5 100644 --- a/components/bt/esp_ble_mesh/v1.1/btc/btc_ble_mesh_dfu_model.c +++ b/components/bt/esp_ble_mesh/v1.1/btc/btc_ble_mesh_dfu_model.c @@ -185,7 +185,7 @@ static void btc_ble_mesh_dfu_client_free_req_data(btc_msg_t *msg) } if (msg->act >= ESP_BLE_MESH_DFU_CLIENT_EVT_MAX) { - BT_ERR("%s, Invalid event %d", __func, msg->act); + BT_ERR("%s, Invalid event %d", __func__, msg->act); return; } From fa8f7ddaf542098efe02341bae798225ccff15dd Mon Sep 17 00:00:00 2001 From: Luo Xu Date: Thu, 27 Nov 2025 20:03:47 +0800 Subject: [PATCH 2/4] fix(ble_mesh): correct long packet segment buffer size calculation (cherry picked from commit 6d59a914014b1525f2bc7d83ad06701a92a3d029) Co-authored-by: luoxu --- components/bt/esp_ble_mesh/core/transport.c | 4 ++-- components/bt/esp_ble_mesh/core/transport.enh.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/bt/esp_ble_mesh/core/transport.c b/components/bt/esp_ble_mesh/core/transport.c index 204854e241c..8c5319b7170 100644 --- a/components/bt/esp_ble_mesh/core/transport.c +++ b/components/bt/esp_ble_mesh/core/transport.c @@ -2105,9 +2105,9 @@ void bt_mesh_trans_init(void) #if CONFIG_BLE_MESH_LONG_PACKET for (i = 0; i < ARRAY_SIZE(ext_seg_rx); i++) { k_delayed_work_init(&ext_seg_rx[i].ack_timer, seg_ack); - ext_seg_rx[i].buf.size = CONFIG_BLE_MESH_LONG_PACKET_ADV_LEN; + ext_seg_rx[i].buf.size = BLE_MESH_EXT_RX_SDU_MAX; ext_seg_rx[i].buf.__buf = (ext_seg_rx_buf_data + - (i * CONFIG_BLE_MESH_LONG_PACKET_ADV_LEN)); + (i * BLE_MESH_EXT_RX_SDU_MAX)); ext_seg_rx[i].buf.data = ext_seg_rx[i].buf.__buf; } #endif diff --git a/components/bt/esp_ble_mesh/core/transport.enh.c b/components/bt/esp_ble_mesh/core/transport.enh.c index 3147ee86a12..7d81ebcbc59 100644 --- a/components/bt/esp_ble_mesh/core/transport.enh.c +++ b/components/bt/esp_ble_mesh/core/transport.enh.c @@ -2723,9 +2723,9 @@ void bt_mesh_trans_init(void) #if CONFIG_BLE_MESH_LONG_PACKET for (i = 0; i < ARRAY_SIZE(ext_seg_rx); i++) { - ext_seg_rx[i].buf.size = CONFIG_BLE_MESH_LONG_PACKET_ADV_LEN; + ext_seg_rx[i].buf.size = BLE_MESH_EXT_RX_SDU_MAX; ext_seg_rx[i].buf.__buf = (ext_seg_rx_buf_data + - (i * CONFIG_BLE_MESH_LONG_PACKET_ADV_LEN)); + (i * BLE_MESH_EXT_RX_SDU_MAX)); ext_seg_rx[i].buf.data = ext_seg_rx[i].buf.__buf; } #endif From e7511968bd37545e777604b23459bff595f3c402 Mon Sep 17 00:00:00 2001 From: luoxu Date: Wed, 4 Feb 2026 13:41:23 +0800 Subject: [PATCH 3/4] feat(ble_mesh): added missing header --- components/bt/esp_ble_mesh/common/include/mesh/common.h | 1 + 1 file changed, 1 insertion(+) diff --git a/components/bt/esp_ble_mesh/common/include/mesh/common.h b/components/bt/esp_ble_mesh/common/include/mesh/common.h index 8be5e40d062..19482bd378b 100644 --- a/components/bt/esp_ble_mesh/common/include/mesh/common.h +++ b/components/bt/esp_ble_mesh/common/include/mesh/common.h @@ -13,6 +13,7 @@ #include #include +#include #include "esp_attr.h" #include "esp_heap_caps.h" From 1d27b536f7f38b4f946e2d0978153a771cd54df6 Mon Sep 17 00:00:00 2001 From: luoxu Date: Wed, 4 Feb 2026 13:34:53 +0800 Subject: [PATCH 4/4] feat(ble_mesh): fixed configuration of core nums --- .../bt/esp_ble_mesh/common/include/mesh/kernel.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/components/bt/esp_ble_mesh/common/include/mesh/kernel.h b/components/bt/esp_ble_mesh/common/include/mesh/kernel.h index a24772a47d1..74b7c4d23db 100644 --- a/components/bt/esp_ble_mesh/common/include/mesh/kernel.h +++ b/components/bt/esp_ble_mesh/common/include/mesh/kernel.h @@ -1,6 +1,6 @@ /* * SPDX-FileCopyrightText: 2016 Wind River Systems, Inc. - * SPDX-FileContributor: 2020-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileContributor: 2020-2026 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -21,9 +21,15 @@ extern "C" { #endif +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 0) +#define BLE_MESH_PLATFORM_CORE_NUMS CONFIG_FREERTOS_NUMBER_OF_CORES +#else +#define BLE_MESH_PLATFORM_CORE_NUMS portNUM_PROCESSORS +#endif + #ifdef CONFIG_BT_BLUEDROID_ENABLED #ifdef CONFIG_BT_BLUEDROID_PINNED_TO_CORE -#define BLE_MESH_ADV_TASK_CORE (CONFIG_BT_BLUEDROID_PINNED_TO_CORE < CONFIG_FREERTOS_NUMBER_OF_CORES ? CONFIG_BT_BLUEDROID_PINNED_TO_CORE : tskNO_AFFINITY) +#define BLE_MESH_ADV_TASK_CORE (CONFIG_BT_BLUEDROID_PINNED_TO_CORE < BLE_MESH_PLATFORM_CORE_NUMS ? CONFIG_BT_BLUEDROID_PINNED_TO_CORE : tskNO_AFFINITY) #else #define BLE_MESH_ADV_TASK_CORE (0) #endif @@ -31,7 +37,7 @@ extern "C" { #ifdef CONFIG_BT_NIMBLE_ENABLED #ifdef CONFIG_BT_NIMBLE_PINNED_TO_CORE -#define BLE_MESH_ADV_TASK_CORE (CONFIG_BT_NIMBLE_PINNED_TO_CORE < CONFIG_FREERTOS_NUMBER_OF_CORES ? CONFIG_BT_NIMBLE_PINNED_TO_CORE : tskNO_AFFINITY) +#define BLE_MESH_ADV_TASK_CORE (CONFIG_BT_NIMBLE_PINNED_TO_CORE < BLE_MESH_PLATFORM_CORE_NUMS ? CONFIG_BT_NIMBLE_PINNED_TO_CORE : tskNO_AFFINITY) #else #define BLE_MESH_ADV_TASK_CORE (0) #endif