From 4eca2abbafea84166f0bc76c32008b144d87b21f Mon Sep 17 00:00:00 2001 From: Zhao Wei Liang Date: Mon, 9 Jun 2025 11:04:09 +0800 Subject: [PATCH] fix(ble): fixed an occasional assertion issue during sync on ESP32-C6 (cherry picked from commit 3c8ba488e0b34586ccfa945ebb085b6e43e73fdb) Co-authored-by: zwl --- components/bt/controller/esp32c6/bt.c | 2 +- components/bt/controller/esp32h2/bt.c | 2 +- components/bt/include/esp32c6/include/esp_bt.h | 5 ++++- components/bt/include/esp32h2/include/esp_bt.h | 4 +++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/components/bt/controller/esp32c6/bt.c b/components/bt/controller/esp32c6/bt.c index a290fd6d25..56ceaa58dd 100644 --- a/components/bt/controller/esp32c6/bt.c +++ b/components/bt/controller/esp32c6/bt.c @@ -1743,7 +1743,7 @@ int ble_sm_alg_gen_key_pair(uint8_t *pub, uint8_t *priv) #endif // CONFIG_BT_LE_DEBUG_REMAIN_SCENE_ENABLED int IRAM_ATTR -ble_capture_info_user_handler(uint8_t type, uint32_t reason) +ble_capture_info_user_handler(uint8_t type, uint32_t reason, uint32_t param1, uint32_t param2) { int i; diff --git a/components/bt/controller/esp32h2/bt.c b/components/bt/controller/esp32h2/bt.c index 22b1aaa3eb..2c564b911b 100644 --- a/components/bt/controller/esp32h2/bt.c +++ b/components/bt/controller/esp32h2/bt.c @@ -1666,7 +1666,7 @@ int ble_sm_alg_gen_key_pair(uint8_t *pub, uint8_t *priv) #endif // CONFIG_BT_LE_DEBUG_REMAIN_SCENE_ENABLED int IRAM_ATTR -ble_capture_info_user_handler(uint8_t type, uint32_t reason) +ble_capture_info_user_handler(uint8_t type, uint32_t reason, uint32_t param1, uint32_t param2) { int i; diff --git a/components/bt/include/esp32c6/include/esp_bt.h b/components/bt/include/esp32c6/include/esp_bt.h index 9871c145f6..9947d755cd 100644 --- a/components/bt/include/esp32c6/include/esp_bt.h +++ b/components/bt/include/esp32c6/include/esp_bt.h @@ -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); -#define CONFIG_VERSION 0x20250513 +#define CONFIG_VERSION 0x20250526 #define CONFIG_MAGIC 0x5A5AA5A5 /** @@ -229,6 +229,7 @@ typedef struct { uint8_t fast_conn_data_tx_en; /*!< The option for fast transmission of connection data - 0 - Disable - 1 - Enable (default) */ + int8_t ch39_txpwr; /*!< BLE transmit power (in dBm) used for BLE advertising on channel 39. */ uint32_t config_magic; /*!< Magic number for configuration validation */ } esp_bt_controller_config_t; @@ -289,6 +290,7 @@ typedef struct { .ble_adv_tx_options = 0, \ .skip_unnecessary_checks_en = 0, \ .fast_conn_data_tx_en = DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN, \ + .ch39_txpwr = BLE_LL_TX_PWR_DBM_N, \ .config_magic = CONFIG_MAGIC, \ } #elif CONFIG_IDF_TARGET_ESP32C61 @@ -347,6 +349,7 @@ typedef struct { .ble_adv_tx_options = 0, \ .skip_unnecessary_checks_en = 0, \ .fast_conn_data_tx_en = DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN, \ + .ch39_txpwr = BLE_LL_TX_PWR_DBM_N, \ .config_magic = CONFIG_MAGIC, \ } #endif diff --git a/components/bt/include/esp32h2/include/esp_bt.h b/components/bt/include/esp32h2/include/esp_bt.h index bf9370eba1..0aafa744bd 100644 --- a/components/bt/include/esp32h2/include/esp_bt.h +++ b/components/bt/include/esp32h2/include/esp_bt.h @@ -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); -#define CONFIG_VERSION 0x20250513 +#define CONFIG_VERSION 0x20250526 #define CONFIG_MAGIC 0x5A5AA5A5 /** @@ -233,6 +233,7 @@ typedef struct { uint8_t fast_conn_data_tx_en; /*!< The option for fast transmission of connection data - 0 - Disable - 1 - Enable (default) */ + int8_t ch39_txpwr; /*!< BLE transmit power (in dBm) used for BLE advertising on channel 39. */ uint32_t config_magic; /*!< Configuration magic value */ } esp_bt_controller_config_t; @@ -292,6 +293,7 @@ typedef struct { .ble_adv_tx_options = 0, \ .skip_unnecessary_checks_en = 0, \ .fast_conn_data_tx_en = DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN, \ + .ch39_txpwr = BLE_LL_TX_PWR_DBM_N, \ .config_magic = CONFIG_MAGIC, \ }