Merge branch 'bugfix/nimble_issues_02062026_v6.0' into 'release/v6.0'

fix(nimble):  Fix few nimble issues 02062026 (v6.0)

See merge request espressif/esp-idf!49153
This commit is contained in:
Rahul Tank
2026-06-29 21:52:48 +05:30
90 changed files with 2367 additions and 321 deletions
-17
View File
@@ -1388,23 +1388,6 @@ config BT_BLE_RPA_TIMEOUT
This set RPA timeout of Controller and Host.
Default is 900 s (15 minutes). Range is 1 s to 1 hour (3600 s).
config BT_BLE_HOST_ALLOW_SUB_SPEC_MIN_CONN_INT
bool "Allow BLE connection interval below Bluetooth Core Spec minimum (disable host check)"
depends on BT_BLE_ENABLED
default n
help
When enabled, the Bluedroid host skips the minimum BLE connection
interval validation (Bluetooth Core Spec minimum is 0x0006 / 7.5 ms)
and accepts any non-zero interval value from the application. The
BLE controller then enforces what is actually allowed; how small the
connection interval may be depends on controller capability and its
own configuration, not on this host option text.
End users should NOT set this option directly. In typical IDF builds it
follows the active Controller integration when that Controller supports
this mode; use the Controller's own configuration (menu entries and symbol
names differ by chip) instead of toggling this host symbol manually.
menuconfig BT_BLE_50_FEATURES_SUPPORTED
bool "Enable BLE 5.0 and above features(please disable BLE 4.2 if enable BLE 5.0)"
depends on (BT_BLE_ENABLED && ((BT_CONTROLLER_ENABLED && SOC_BLE_50_SUPPORTED) || BT_CONTROLLER_DISABLED))
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2026 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -8,6 +8,7 @@
#include "esp_log.h"
#include "esp_bluedroid_hci.h"
#include "common/bt_target.h"
#include "bt_common.h"
#include "hci/hci_trans_int.h"
#if (BT_CONTROLLER_INCLUDED == TRUE)
#include "esp_bt.h"
@@ -69,7 +70,11 @@ void hci_host_send_packet(uint8_t *data, uint16_t len)
{
#if (BT_HCI_LOG_INCLUDED == TRUE)
if (data != NULL && len > 1) {
bt_hci_log_record_hci_data(data[0], &data[1], (uint16_t)(len - 1));
uint8_t data_type = bt_hci_log_h4_type_to_data_type(data[0]);
bt_hci_log_record_hci_data(data_type, &data[1], (uint16_t)(len - 1));
#if BT_HCI_INSIGHTS_INCLUDED
bt_hci_log_record_insights(data_type, &data[1], (uint16_t)(len - 1));
#endif
}
#endif
#if CONFIG_BT_BLE_LOG_SPI_OUT_HCI_ENABLED
@@ -34,6 +34,7 @@
#include "esp_bt.h"
#endif
#include "esp_bluedroid_hci.h"
#include "bt_common.h"
#if (C2H_FLOW_CONTROL_INCLUDED == TRUE)
#include "l2c_int.h"
@@ -601,14 +602,20 @@ void bt_record_hci_data(uint8_t *data, uint16_t len)
#endif // (BLE_50_FEATURE_SUPPORT == TRUE)
)) {
bt_hci_log_record_hci_adv(HCI_LOG_DATA_TYPE_ADV, &data[2], len - 2);
#if BT_HCI_INSIGHTS_INCLUDED
bt_hci_log_record_insights(HCI_LOG_DATA_TYPE_ADV, &data[2], len - 2);
#endif
} else {
uint8_t data_type;
if (data[0] == HCI_LOG_DATA_TYPE_ISO_DATA) {
if (data[0] == DATA_TYPE_ISO) {
data_type = HCI_LOG_DATA_TYPE_ISO_DATA;
} else {
data_type = ((data[0] == 2) ? HCI_LOG_DATA_TYPE_C2H_ACL : data[0]);
}
bt_hci_log_record_hci_data(data_type, &data[1], len - 1);
#if BT_HCI_INSIGHTS_INCLUDED
bt_hci_log_record_insights(data_type, &data[1], len - 1);
#endif
}
#endif // (BT_HCI_LOG_INCLUDED == TRUE)
}
+8
View File
@@ -917,6 +917,14 @@ menu "Services"
help
Defines maximum number of report characteristics per service instance
config BT_NIMBLE_RAS_SERVICE
depends on BT_NIMBLE_CHANNEL_SOUNDING
bool "RAS service"
default y
help
Enable RAS Service
menuconfig BT_NIMBLE_BAS_SERVICE
bool "Battery service"
default y
@@ -78,7 +78,11 @@ void ble_hci_trans_cfg_hs(ble_hci_trans_rx_cmd_fn *cmd_cb,
void esp_vhci_host_send_packet_wrapper(uint8_t *data, uint16_t len)
{
#if (BT_HCI_LOG_INCLUDED == TRUE)
bt_hci_log_record_hci_data(data[0], &data[1], len - 1);
uint8_t data_type = bt_hci_log_h4_type_to_data_type(data[0]);
bt_hci_log_record_hci_data(data_type, &data[1], len - 1);
#if BT_HCI_INSIGHTS_INCLUDED
bt_hci_log_record_insights(data_type, &data[1], len - 1);
#endif
#endif
#if CONFIG_BT_BLE_LOG_SPI_OUT_HCI_ENABLED
ble_log_spi_out_hci_write(BLE_LOG_SPI_OUT_SOURCE_HCI_DOWNSTREAM, data, len);
@@ -178,7 +182,6 @@ static void ble_hci_rx_acl(uint8_t *data, uint16_t len)
{
struct os_mbuf *m = NULL;
int rc;
int sr;
int retry_count = 1;
@@ -212,9 +215,7 @@ static void ble_hci_rx_acl(uint8_t *data, uint16_t len)
os_mbuf_free_chain(m);
return;
}
OS_ENTER_CRITICAL(sr);
ble_transport_to_hs_acl(m);
OS_EXIT_CRITICAL(sr);
}
#endif
@@ -237,18 +238,24 @@ static void dummy_controller_rcv_pkt_ready(void)
void bt_record_hci_data(uint8_t *data, uint16_t len)
{
#if (BT_HCI_LOG_INCLUDED == TRUE)
if ((data[0] == BLE_HCI_UART_H4_EVT) && (data[1] == BLE_HCI_EVCODE_LE_META) && ((data[3] == BLE_HCI_LE_SUBEV_ADV_RPT) || (data[3] == BLE_HCI_LE_SUBEV_DIRECT_ADV_RPT)
if (len < 2) {
return;
}
if ((len >= 4) && (data[0] == BLE_HCI_UART_H4_EVT) && (data[1] == BLE_HCI_EVCODE_LE_META) && ((data[3] == BLE_HCI_LE_SUBEV_ADV_RPT) || (data[3] == BLE_HCI_LE_SUBEV_DIRECT_ADV_RPT)
|| (data[3] == BLE_HCI_LE_SUBEV_EXT_ADV_RPT) || (data[3] == BLE_HCI_LE_SUBEV_PERIODIC_ADV_RPT))) {
bt_hci_log_record_hci_adv(HCI_LOG_DATA_TYPE_ADV, &data[2], len - 2);
#if BT_HCI_INSIGHTS_INCLUDED
bt_hci_log_record_insights(HCI_LOG_DATA_TYPE_ADV, &data[2], len - 2);
#endif
} else {
uint8_t data_type;
if (data[0] == HCI_LOG_DATA_TYPE_ISO_DATA) {
data_type = HCI_LOG_DATA_TYPE_ISO_DATA;
} else {
data_type = ((data[0] == 2) ? HCI_LOG_DATA_TYPE_C2H_ACL : data[0]);
}
data_type = ((data[0] == 2) ? HCI_LOG_DATA_TYPE_C2H_ACL : bt_hci_log_h4_type_to_data_type(data[0]));
bt_hci_log_record_hci_data(data_type, &data[1], len - 1);
#if BT_HCI_INSIGHTS_INCLUDED
bt_hci_log_record_insights(data_type, &data[1], len - 1);
#endif
}
#endif // (BT_HCI_LOG_INCLUDED == TRUE)
}
@@ -2382,4 +2382,12 @@
#endif
#endif
#ifndef MYNEWT_VAL_BT_NIMBLE_INSIGHTS_ENABLE
#ifdef CONFIG_BT_NIMBLE_INSIGHTS_ENABLE
#define MYNEWT_VAL_BT_NIMBLE_INSIGHTS_ENABLE CONFIG_BT_NIMBLE_INSIGHTS_ENABLE
#else
#define MYNEWT_VAL_BT_NIMBLE_INSIGHTS_ENABLE (0)
#endif
#endif
#endif