Merge branch 'change/ble_update_lib_20250516_v5.4' into 'release/v5.4'

change(ble): [AUTO_MR] 20250516 - Update ESP BLE Controller Lib (v5.4)

See merge request espressif/esp-idf!39237
This commit is contained in:
Island
2025-05-20 11:41:52 +08:00
17 changed files with 166 additions and 56 deletions

View File

@@ -119,6 +119,11 @@ struct ext_funcs_t {
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED #if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
typedef void (*interface_func_t) (uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag); typedef void (*interface_func_t) (uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag);
enum {
BLE_LOG_INTERFACE_FLAG_CONTINUE = 0,
BLE_LOG_INTERFACE_FLAG_END,
};
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED #endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
/* External functions or variables /* External functions or variables
@@ -411,20 +416,22 @@ void esp_bt_read_ctrl_log_from_flash(bool output)
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED #if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag) static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag)
{ {
bool end = flag ? true : false; bool end = (flag & BIT(BLE_LOG_INTERFACE_FLAG_END));
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE #if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
esp_bt_controller_log_storage(len, addr, end); esp_bt_controller_log_storage(len, addr, end);
#else // !CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE #else // !CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED; portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock); portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_feed_wdts(); esp_panic_handler_feed_wdts();
for (int i = 0; i < len; i++) {
esp_rom_printf("%02x ", addr[i]);
}
if (end) { if (len && addr) {
esp_rom_printf("\n"); for (int i = 0; i < len; i++) { esp_rom_printf("%02x ", addr[i]); }
} }
if (len_append && addr_append) {
for (int i = 0; i < len_append; i++) { esp_rom_printf("%02x ", addr_append[i]); }
}
if (end) { esp_rom_printf("\n"); }
portEXIT_CRITICAL_SAFE(&spinlock); portEXIT_CRITICAL_SAFE(&spinlock);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE #endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
} }

View File

@@ -801,3 +801,14 @@ config BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX
When this option is enabled, auxiliary packets will be present in the events of When this option is enabled, auxiliary packets will be present in the events of
'Non-Connectable and Non-Scannable' regardless of whether the advertising length is 0. 'Non-Connectable and Non-Scannable' regardless of whether the advertising length is 0.
If this option is not enabled, auxiliary packets will only be present when the advertising length is not 0. If this option is not enabled, auxiliary packets will only be present when the advertising length is not 0.
config BT_LE_RXBUF_OPT_ENABLED
bool "Enable rxbuf optimization feature"
default y
config BT_LE_CTRL_FAST_CONN_DATA_TX_EN
bool "Enable fast sending of connection data"
default y
help
If this option is enabled, The Controller will continue to
Send an empty PDU after sending valid connection data within an interval.

View File

@@ -67,7 +67,7 @@
#define OSI_COEX_VERSION 0x00010006 #define OSI_COEX_VERSION 0x00010006
#define OSI_COEX_MAGIC_VALUE 0xFADEBEAD #define OSI_COEX_MAGIC_VALUE 0xFADEBEAD
#define EXT_FUNC_VERSION 0x20240422 #define EXT_FUNC_VERSION 0x20250415
#define EXT_FUNC_MAGIC_VALUE 0xA5A5A5A5 #define EXT_FUNC_MAGIC_VALUE 0xA5A5A5A5
#define BT_ASSERT_PRINT ets_printf #define BT_ASSERT_PRINT ets_printf
@@ -98,14 +98,17 @@ struct ext_funcs_t {
int (* _ecc_gen_key_pair)(uint8_t *public, uint8_t *priv); int (* _ecc_gen_key_pair)(uint8_t *public, uint8_t *priv);
int (* _ecc_gen_dh_key)(const uint8_t *remote_pub_key_x, const uint8_t *remote_pub_key_y, int (* _ecc_gen_dh_key)(const uint8_t *remote_pub_key_x, const uint8_t *remote_pub_key_y,
const uint8_t *local_priv_key, uint8_t *dhkey); const uint8_t *local_priv_key, uint8_t *dhkey);
void (* _esp_reset_rpa_moudle)(void);
uint32_t magic; uint32_t magic;
}; };
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED #if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
typedef void (*interface_func_t) (uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag); typedef void (*interface_func_t) (uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
enum {
BLE_LOG_INTERFACE_FLAG_CONTINUE = 0,
BLE_LOG_INTERFACE_FLAG_END,
};
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
/* External functions or variables /* External functions or variables
************************************************************************ ************************************************************************
*/ */
@@ -182,7 +185,6 @@ static int esp_intr_alloc_wrapper(int source, int flags, intr_handler_t handler,
static int esp_intr_free_wrapper(void **ret_handle); static int esp_intr_free_wrapper(void **ret_handle);
static void osi_assert_wrapper(const uint32_t ln, const char *fn, uint32_t param1, uint32_t param2); static void osi_assert_wrapper(const uint32_t ln, const char *fn, uint32_t param1, uint32_t param2);
static uint32_t osi_random_wrapper(void); static uint32_t osi_random_wrapper(void);
static void esp_reset_rpa_moudle(void);
static int esp_ecc_gen_key_pair(uint8_t *pub, uint8_t *priv); static int esp_ecc_gen_key_pair(uint8_t *pub, uint8_t *priv);
static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer_pub_key_y, static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer_pub_key_y,
const uint8_t *our_priv_key, uint8_t *out_dhkey); const uint8_t *our_priv_key, uint8_t *out_dhkey);
@@ -459,15 +461,9 @@ struct ext_funcs_t ext_funcs_ro = {
._os_random = osi_random_wrapper, ._os_random = osi_random_wrapper,
._ecc_gen_key_pair = esp_ecc_gen_key_pair, ._ecc_gen_key_pair = esp_ecc_gen_key_pair,
._ecc_gen_dh_key = esp_ecc_gen_dh_key, ._ecc_gen_dh_key = esp_ecc_gen_dh_key,
._esp_reset_rpa_moudle = esp_reset_rpa_moudle,
.magic = EXT_FUNC_MAGIC_VALUE, .magic = EXT_FUNC_MAGIC_VALUE,
}; };
static void IRAM_ATTR esp_reset_rpa_moudle(void)
{
}
static void IRAM_ATTR osi_assert_wrapper(const uint32_t ln, const char *fn, static void IRAM_ATTR osi_assert_wrapper(const uint32_t ln, const char *fn,
uint32_t param1, uint32_t param2) uint32_t param1, uint32_t param2)
{ {
@@ -1419,20 +1415,22 @@ esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t po
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED #if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag) static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag)
{ {
bool end = flag ? true : false; bool end = (flag & BIT(BLE_LOG_INTERFACE_FLAG_END));
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE #if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
esp_bt_controller_log_storage(len, addr, end); esp_bt_controller_log_storage(len, addr, end);
#else // !CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE #else // !CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED; portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock); portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_feed_wdts(); esp_panic_handler_feed_wdts();
for (int i = 0; i < len; i++) {
esp_rom_printf("%02x ", addr[i]);
}
if (end) { if (len && addr) {
esp_rom_printf("\n"); for (int i = 0; i < len; i++) { esp_rom_printf("%02x ", addr[i]); }
} }
if (len_append && addr_append) {
for (int i = 0; i < len_append; i++) { esp_rom_printf("%02x ", addr_append[i]); }
}
if (end) { esp_rom_printf("\n"); }
portEXIT_CRITICAL_SAFE(&spinlock); portEXIT_CRITICAL_SAFE(&spinlock);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE #endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
} }

View File

@@ -192,6 +192,12 @@ extern "C" {
#define DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX (0) #define DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX (0)
#endif #endif
#if defined(CONFIG_BT_LE_CTRL_FAST_CONN_DATA_TX_EN)
#define DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN (CONFIG_BT_LE_CTRL_FAST_CONN_DATA_TX_EN)
#else
#define DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN (0)
#endif
#ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART #ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART
#define HCI_UART_EN CONFIG_BT_LE_HCI_INTERFACE_USE_UART #define HCI_UART_EN CONFIG_BT_LE_HCI_INTERFACE_USE_UART
#else #else

View File

@@ -839,3 +839,10 @@ config BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX
config BT_LE_RXBUF_OPT_ENABLED config BT_LE_RXBUF_OPT_ENABLED
bool "Enable rxbuf optimization feature" bool "Enable rxbuf optimization feature"
default y default y
config BT_LE_CTRL_FAST_CONN_DATA_TX_EN
bool "Enable fast sending of connection data"
default y
help
If this option is enabled, The Controller will continue to
Send an empty PDU after sending valid connection data within an interval.

View File

@@ -58,6 +58,7 @@
#include "hal/efuse_hal.h" #include "hal/efuse_hal.h"
#include "soc/rtc.h" #include "soc/rtc.h"
#include "modem/modem_syscon_struct.h"
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED #if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
#include "ble_log/ble_log_spi_out.h" #include "ble_log/ble_log_spi_out.h"
@@ -70,7 +71,7 @@
#define OSI_COEX_VERSION 0x00010006 #define OSI_COEX_VERSION 0x00010006
#define OSI_COEX_MAGIC_VALUE 0xFADEBEAD #define OSI_COEX_MAGIC_VALUE 0xFADEBEAD
#define EXT_FUNC_VERSION 0x20240422 #define EXT_FUNC_VERSION 0x20250415
#define EXT_FUNC_MAGIC_VALUE 0xA5A5A5A5 #define EXT_FUNC_MAGIC_VALUE 0xA5A5A5A5
#define BT_ASSERT_PRINT ets_printf #define BT_ASSERT_PRINT ets_printf
@@ -101,17 +102,29 @@ struct ext_funcs_t {
int (* _ecc_gen_key_pair)(uint8_t *public, uint8_t *priv); int (* _ecc_gen_key_pair)(uint8_t *public, uint8_t *priv);
int (* _ecc_gen_dh_key)(const uint8_t *remote_pub_key_x, const uint8_t *remote_pub_key_y, int (* _ecc_gen_dh_key)(const uint8_t *remote_pub_key_x, const uint8_t *remote_pub_key_y,
const uint8_t *local_priv_key, uint8_t *dhkey); const uint8_t *local_priv_key, uint8_t *dhkey);
void (* _esp_reset_rpa_moudle)(void); #if CONFIG_IDF_TARGET_ESP32C6
void (* _esp_reset_modem)(uint8_t mdl_opts, uint8_t start);
#endif // CONFIG_IDF_TARGET_ESP32C6
uint32_t magic; uint32_t magic;
}; };
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED #if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
typedef void (*interface_func_t) (uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag); typedef void (*interface_func_t) (uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag);
enum {
BLE_LOG_INTERFACE_FLAG_CONTINUE = 0,
BLE_LOG_INTERFACE_FLAG_END,
};
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED #endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
/* External functions or variables /* External functions or variables
************************************************************************ ************************************************************************
*/ */
#if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
extern void coex_hw_timer_set(uint8_t idx,uint8_t src, uint8_t pti,uint32_t latency, uint32_t perioidc);
extern void coex_hw_timer_enable(uint8_t idx);
extern void coex_hw_timer_disable(uint8_t idx);
#endif // CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
extern int ble_osi_coex_funcs_register(struct osi_coex_funcs_t *coex_funcs); extern int ble_osi_coex_funcs_register(struct osi_coex_funcs_t *coex_funcs);
extern int r_ble_controller_init(esp_bt_controller_config_t *cfg); extern int r_ble_controller_init(esp_bt_controller_config_t *cfg);
extern void esp_ble_controller_info_capture(uint32_t cycle_times); extern void esp_ble_controller_info_capture(uint32_t cycle_times);
@@ -185,7 +198,9 @@ static int esp_intr_alloc_wrapper(int source, int flags, intr_handler_t handler,
static int esp_intr_free_wrapper(void **ret_handle); static int esp_intr_free_wrapper(void **ret_handle);
static void osi_assert_wrapper(const uint32_t ln, const char *fn, uint32_t param1, uint32_t param2); static void osi_assert_wrapper(const uint32_t ln, const char *fn, uint32_t param1, uint32_t param2);
static uint32_t osi_random_wrapper(void); static uint32_t osi_random_wrapper(void);
static void esp_reset_rpa_moudle(void); #if CONFIG_IDF_TARGET_ESP32C6
static void esp_reset_modem(uint8_t mdl_opts,uint8_t start);
#endif // CONFIG_IDF_TARGET_ESP32C6
static int esp_ecc_gen_key_pair(uint8_t *pub, uint8_t *priv); static int esp_ecc_gen_key_pair(uint8_t *pub, uint8_t *priv);
static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer_pub_key_y, static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer_pub_key_y,
const uint8_t *our_priv_key, uint8_t *out_dhkey); const uint8_t *our_priv_key, uint8_t *out_dhkey);
@@ -463,15 +478,34 @@ struct ext_funcs_t ext_funcs_ro = {
._os_random = osi_random_wrapper, ._os_random = osi_random_wrapper,
._ecc_gen_key_pair = esp_ecc_gen_key_pair, ._ecc_gen_key_pair = esp_ecc_gen_key_pair,
._ecc_gen_dh_key = esp_ecc_gen_dh_key, ._ecc_gen_dh_key = esp_ecc_gen_dh_key,
._esp_reset_rpa_moudle = esp_reset_rpa_moudle, #if CONFIG_IDF_TARGET_ESP32C6
._esp_reset_modem = esp_reset_modem,
#endif // CONFIG_IDF_TARGET_ESP32C6
.magic = EXT_FUNC_MAGIC_VALUE, .magic = EXT_FUNC_MAGIC_VALUE,
}; };
static void IRAM_ATTR esp_reset_rpa_moudle(void) #if CONFIG_IDF_TARGET_ESP32C6
static void IRAM_ATTR esp_reset_modem(uint8_t mdl_opts,uint8_t start)
{ {
if (mdl_opts == 0x05) {
if (start) {
#if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
coex_hw_timer_set(0x04, 0x02, 15, 0, 5000);
coex_hw_timer_enable(0x04);
#endif // CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
MODEM_SYSCON.modem_rst_conf.val |= (BIT(16) | BIT(18));
MODEM_SYSCON.modem_rst_conf.val &= ~(BIT(16) | BIT(18));
} else {
#if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
coex_hw_timer_disable(0x04);
#endif // CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
}
}
} }
#endif // CONFIG_IDF_TARGET_ESP32C6
static void IRAM_ATTR osi_assert_wrapper(const uint32_t ln, const char *fn, static void IRAM_ATTR osi_assert_wrapper(const uint32_t ln, const char *fn,
uint32_t param1, uint32_t param2) uint32_t param1, uint32_t param2)
{ {
@@ -1452,20 +1486,22 @@ esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t po
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED #if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag) static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag)
{ {
bool end = flag ? true : false; bool end = (flag & BIT(BLE_LOG_INTERFACE_FLAG_END));
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE #if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
esp_bt_controller_log_storage(len, addr, end); esp_bt_controller_log_storage(len, addr, end);
#else // !CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE #else // !CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED; portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock); portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_feed_wdts(); esp_panic_handler_feed_wdts();
for (int i = 0; i < len; i++) {
esp_rom_printf("%02x ", addr[i]);
}
if (end) { if (len && addr) {
esp_rom_printf("\n"); for (int i = 0; i < len; i++) { esp_rom_printf("%02x ", addr[i]); }
} }
if (len_append && addr_append) {
for (int i = 0; i < len_append; i++) { esp_rom_printf("%02x ", addr_append[i]); }
}
if (end) { esp_rom_printf("\n"); }
portEXIT_CRITICAL_SAFE(&spinlock); portEXIT_CRITICAL_SAFE(&spinlock);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE #endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
} }

View File

@@ -195,6 +195,12 @@ extern "C" {
#define DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX (0) #define DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX (0)
#endif #endif
#if defined(CONFIG_BT_LE_CTRL_FAST_CONN_DATA_TX_EN)
#define DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN (CONFIG_BT_LE_CTRL_FAST_CONN_DATA_TX_EN)
#else
#define DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN (0)
#endif
#ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART #ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART
#define HCI_UART_EN CONFIG_BT_LE_HCI_INTERFACE_USE_UART #define HCI_UART_EN CONFIG_BT_LE_HCI_INTERFACE_USE_UART
#else #else

View File

@@ -843,3 +843,10 @@ config BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX
config BT_LE_RXBUF_OPT_ENABLED config BT_LE_RXBUF_OPT_ENABLED
bool "Enable rxbuf optimization feature" bool "Enable rxbuf optimization feature"
default y default y
config BT_LE_CTRL_FAST_CONN_DATA_TX_EN
bool "Enable fast sending of connection data"
default y
help
If this option is enabled, The Controller will continue to
Send an empty PDU after sending valid connection data within an interval.

View File

@@ -66,7 +66,7 @@
#define OSI_COEX_VERSION 0x00010006 #define OSI_COEX_VERSION 0x00010006
#define OSI_COEX_MAGIC_VALUE 0xFADEBEAD #define OSI_COEX_MAGIC_VALUE 0xFADEBEAD
#define EXT_FUNC_VERSION 0x20240422 #define EXT_FUNC_VERSION 0x20250415
#define EXT_FUNC_MAGIC_VALUE 0xA5A5A5A5 #define EXT_FUNC_MAGIC_VALUE 0xA5A5A5A5
#define BT_ASSERT_PRINT ets_printf #define BT_ASSERT_PRINT ets_printf
@@ -97,12 +97,16 @@ struct ext_funcs_t {
int (* _ecc_gen_key_pair)(uint8_t *public, uint8_t *priv); int (* _ecc_gen_key_pair)(uint8_t *public, uint8_t *priv);
int (* _ecc_gen_dh_key)(const uint8_t *remote_pub_key_x, const uint8_t *remote_pub_key_y, int (* _ecc_gen_dh_key)(const uint8_t *remote_pub_key_x, const uint8_t *remote_pub_key_y,
const uint8_t *local_priv_key, uint8_t *dhkey); const uint8_t *local_priv_key, uint8_t *dhkey);
void (* _esp_reset_rpa_moudle)(void);
uint32_t magic; uint32_t magic;
}; };
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED #if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
typedef void (*interface_func_t) (uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag); typedef void (*interface_func_t) (uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag);
enum {
BLE_LOG_INTERFACE_FLAG_CONTINUE = 0,
BLE_LOG_INTERFACE_FLAG_END,
};
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED #endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
/* External functions or variables /* External functions or variables
************************************************************************ ************************************************************************
@@ -183,7 +187,6 @@ static int esp_intr_alloc_wrapper(int source, int flags, intr_handler_t handler,
static int esp_intr_free_wrapper(void **ret_handle); static int esp_intr_free_wrapper(void **ret_handle);
static void osi_assert_wrapper(const uint32_t ln, const char *fn, uint32_t param1, uint32_t param2); static void osi_assert_wrapper(const uint32_t ln, const char *fn, uint32_t param1, uint32_t param2);
static uint32_t osi_random_wrapper(void); static uint32_t osi_random_wrapper(void);
static void esp_reset_rpa_moudle(void);
static int esp_ecc_gen_key_pair(uint8_t *pub, uint8_t *priv); static int esp_ecc_gen_key_pair(uint8_t *pub, uint8_t *priv);
static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer_pub_key_y, static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer_pub_key_y,
const uint8_t *our_priv_key, uint8_t *out_dhkey); const uint8_t *our_priv_key, uint8_t *out_dhkey);
@@ -460,15 +463,9 @@ struct ext_funcs_t ext_funcs_ro = {
._os_random = osi_random_wrapper, ._os_random = osi_random_wrapper,
._ecc_gen_key_pair = esp_ecc_gen_key_pair, ._ecc_gen_key_pair = esp_ecc_gen_key_pair,
._ecc_gen_dh_key = esp_ecc_gen_dh_key, ._ecc_gen_dh_key = esp_ecc_gen_dh_key,
._esp_reset_rpa_moudle = esp_reset_rpa_moudle,
.magic = EXT_FUNC_MAGIC_VALUE, .magic = EXT_FUNC_MAGIC_VALUE,
}; };
static void IRAM_ATTR esp_reset_rpa_moudle(void)
{
}
static void IRAM_ATTR osi_assert_wrapper(const uint32_t ln, const char *fn, static void IRAM_ATTR osi_assert_wrapper(const uint32_t ln, const char *fn,
uint32_t param1, uint32_t param2) uint32_t param1, uint32_t param2)
{ {
@@ -1412,20 +1409,22 @@ esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t po
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED #if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag) static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag)
{ {
bool end = flag ? true : false; bool end = (flag & BIT(BLE_LOG_INTERFACE_FLAG_END));
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE #if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
esp_bt_controller_log_storage(len, addr, end); esp_bt_controller_log_storage(len, addr, end);
#else // !CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE #else // !CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED; portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock); portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_feed_wdts(); esp_panic_handler_feed_wdts();
for (int i = 0; i < len; i++) {
esp_rom_printf("%02x ", addr[i]);
}
if (end) { if (len && addr) {
esp_rom_printf("\n"); for (int i = 0; i < len; i++) { esp_rom_printf("%02x ", addr[i]); }
} }
if (len_append && addr_append) {
for (int i = 0; i < len_append; i++) { esp_rom_printf("%02x ", addr_append[i]); }
}
if (end) { esp_rom_printf("\n"); }
portEXIT_CRITICAL_SAFE(&spinlock); portEXIT_CRITICAL_SAFE(&spinlock);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE #endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
} }

View File

@@ -192,6 +192,12 @@ extern "C" {
#define DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX (0) #define DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX (0)
#endif #endif
#if defined(CONFIG_BT_LE_CTRL_FAST_CONN_DATA_TX_EN)
#define DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN (CONFIG_BT_LE_CTRL_FAST_CONN_DATA_TX_EN)
#else
#define DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN (0)
#endif
#ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART #ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART
#define HCI_UART_EN CONFIG_BT_LE_HCI_INTERFACE_USE_UART #define HCI_UART_EN CONFIG_BT_LE_HCI_INTERFACE_USE_UART
#else #else

View File

@@ -159,7 +159,7 @@ esp_err_t esp_ble_tx_power_set_enhanced(esp_ble_enhanced_power_type_t power_type
*/ */
esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t power_type, uint16_t handle); esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t power_type, uint16_t handle);
#define CONFIG_VERSION 0x20250310 #define CONFIG_VERSION 0x20250513
#define CONFIG_MAGIC 0x5A5AA5A5 #define CONFIG_MAGIC 0x5A5AA5A5
/** /**
@@ -226,6 +226,11 @@ typedef struct {
- 1 - Enable */ - 1 - Enable */
uint8_t vhci_enabled; /*!< VHCI mode is enabled */ uint8_t vhci_enabled; /*!< VHCI mode is enabled */
uint8_t ptr_check_enabled; /*!< Enable boundary check for internal memory. */ uint8_t ptr_check_enabled; /*!< Enable boundary check for internal memory. */
uint8_t ble_adv_tx_options; /*!< The options for Extended advertising sending. */
uint8_t skip_unnecessary_checks_en; /*!< The option to skip non-fatal state checks and perform extra handling for fatal checks. */
uint8_t fast_conn_data_tx_en; /*!< The option for fast transmission of connection data
- 0 - Disable
- 1 - Enable (default) */
uint32_t config_magic; /*!< Magic number for configuration validation */ uint32_t config_magic; /*!< Magic number for configuration validation */
} esp_bt_controller_config_t; } esp_bt_controller_config_t;
@@ -281,6 +286,9 @@ typedef struct {
.ble_data_lenth_zero_aux = DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX, \ .ble_data_lenth_zero_aux = DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX, \
.vhci_enabled = DEFAULT_BT_LE_VHCI_ENABLED, \ .vhci_enabled = DEFAULT_BT_LE_VHCI_ENABLED, \
.ptr_check_enabled = DEFAULT_BT_LE_PTR_CHECK_ENABLED, \ .ptr_check_enabled = DEFAULT_BT_LE_PTR_CHECK_ENABLED, \
.ble_adv_tx_options = 0, \
.skip_unnecessary_checks_en = 0, \
.fast_conn_data_tx_en = DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN, \
.config_magic = CONFIG_MAGIC, \ .config_magic = CONFIG_MAGIC, \
} }

View File

@@ -156,7 +156,7 @@ esp_err_t esp_ble_tx_power_set_enhanced(esp_ble_enhanced_power_type_t power_type
*/ */
esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t power_type, uint16_t handle); esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t power_type, uint16_t handle);
#define CONFIG_VERSION 0x20250310 #define CONFIG_VERSION 0x20250513
#define CONFIG_MAGIC 0x5A5AA5A5 #define CONFIG_MAGIC 0x5A5AA5A5
/** /**
@@ -226,6 +226,11 @@ typedef struct {
- 1 - Enable */ - 1 - Enable */
uint8_t vhci_enabled; /*!< VHCI mode is enabled */ uint8_t vhci_enabled; /*!< VHCI mode is enabled */
uint8_t ptr_check_enabled; /*!< Enable boundary check for internal memory. */ uint8_t ptr_check_enabled; /*!< Enable boundary check for internal memory. */
uint8_t ble_adv_tx_options; /*!< The options for Extended advertising sending. */
uint8_t skip_unnecessary_checks_en; /*!< The option to skip non-fatal state checks and perform extra handling for fatal checks. */
uint8_t fast_conn_data_tx_en; /*!< The option for fast transmission of connection data
- 0 - Disable
- 1 - Enable (default) */
uint32_t config_magic; /*!< Magic number for configuration validation */ uint32_t config_magic; /*!< Magic number for configuration validation */
} esp_bt_controller_config_t; } esp_bt_controller_config_t;
@@ -284,6 +289,9 @@ typedef struct {
.ble_data_lenth_zero_aux = DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX, \ .ble_data_lenth_zero_aux = DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX, \
.vhci_enabled = DEFAULT_BT_LE_VHCI_ENABLED, \ .vhci_enabled = DEFAULT_BT_LE_VHCI_ENABLED, \
.ptr_check_enabled = DEFAULT_BT_LE_PTR_CHECK_ENABLED, \ .ptr_check_enabled = DEFAULT_BT_LE_PTR_CHECK_ENABLED, \
.ble_adv_tx_options = 0, \
.skip_unnecessary_checks_en = 0, \
.fast_conn_data_tx_en = DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN, \
.config_magic = CONFIG_MAGIC, \ .config_magic = CONFIG_MAGIC, \
} }
#elif CONFIG_IDF_TARGET_ESP32C61 #elif CONFIG_IDF_TARGET_ESP32C61
@@ -339,6 +347,9 @@ typedef struct {
.ble_data_lenth_zero_aux = DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX, \ .ble_data_lenth_zero_aux = DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX, \
.vhci_enabled = DEFAULT_BT_LE_VHCI_ENABLED, \ .vhci_enabled = DEFAULT_BT_LE_VHCI_ENABLED, \
.ptr_check_enabled = DEFAULT_BT_LE_PTR_CHECK_ENABLED, \ .ptr_check_enabled = DEFAULT_BT_LE_PTR_CHECK_ENABLED, \
.ble_adv_tx_options = 0, \
.skip_unnecessary_checks_en = 0, \
.fast_conn_data_tx_en = DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN, \
.config_magic = CONFIG_MAGIC, \ .config_magic = CONFIG_MAGIC, \
} }
#endif #endif

View File

@@ -161,7 +161,7 @@ esp_err_t esp_ble_tx_power_set_enhanced(esp_ble_enhanced_power_type_t power_type
*/ */
esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t power_type, uint16_t handle); esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t power_type, uint16_t handle);
#define CONFIG_VERSION 0x20250310 #define CONFIG_VERSION 0x20250513
#define CONFIG_MAGIC 0x5A5AA5A5 #define CONFIG_MAGIC 0x5A5AA5A5
/** /**
@@ -226,8 +226,13 @@ typedef struct {
uint8_t ble_data_lenth_zero_aux; /*!< Enable / disable auxiliary packets when the extended ADV data length is zero. Configurable in menuconfig. uint8_t ble_data_lenth_zero_aux; /*!< Enable / disable auxiliary packets when the extended ADV data length is zero. Configurable in menuconfig.
- 0 - Disable (default) - 0 - Disable (default)
- 1 - Enable */ - 1 - Enable */
uint8_t vhci_enabled; /*!< VHCI is enabled */ uint8_t vhci_enabled; /*!< VHCI is enabled */
uint8_t ptr_check_enabled; /*!< Enable boundary check for internal memory. */ uint8_t ptr_check_enabled; /*!< Enable boundary check for internal memory. */
uint8_t ble_adv_tx_options; /*!< The options for Extended advertising sending. */
uint8_t skip_unnecessary_checks_en; /*!< The option to skip non-fatal state checks and perform extra handling for fatal checks. */
uint8_t fast_conn_data_tx_en; /*!< The option for fast transmission of connection data
- 0 - Disable
- 1 - Enable (default) */
uint32_t config_magic; /*!< Configuration magic value */ uint32_t config_magic; /*!< Configuration magic value */
} esp_bt_controller_config_t; } esp_bt_controller_config_t;
@@ -284,6 +289,9 @@ typedef struct {
.ble_data_lenth_zero_aux = DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX, \ .ble_data_lenth_zero_aux = DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX, \
.vhci_enabled = DEFAULT_BT_LE_VHCI_ENABLED, \ .vhci_enabled = DEFAULT_BT_LE_VHCI_ENABLED, \
.ptr_check_enabled = DEFAULT_BT_LE_PTR_CHECK_ENABLED, \ .ptr_check_enabled = DEFAULT_BT_LE_PTR_CHECK_ENABLED, \
.ble_adv_tx_options = 0, \
.skip_unnecessary_checks_en = 0, \
.fast_conn_data_tx_en = DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN, \
.config_magic = CONFIG_MAGIC, \ .config_magic = CONFIG_MAGIC, \
} }