From 11b7dfabe254d020e21959015e5d709762602b29 Mon Sep 17 00:00:00 2001 From: Zhou Xiao Date: Fri, 13 Jun 2025 20:13:49 +0800 Subject: [PATCH 01/10] change(ble): [AUTO_MR] Update lib_esp32h2 to b8770ab2 --- components/bt/controller/lib_esp32h2/esp32h2-bt-lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/bt/controller/lib_esp32h2/esp32h2-bt-lib b/components/bt/controller/lib_esp32h2/esp32h2-bt-lib index 82cbc1dd93..7ac752b47c 160000 --- a/components/bt/controller/lib_esp32h2/esp32h2-bt-lib +++ b/components/bt/controller/lib_esp32h2/esp32h2-bt-lib @@ -1 +1 @@ -Subproject commit 82cbc1dd9345010e7e6d78f8a7b022a7ae669e87 +Subproject commit 7ac752b47c70f43cf08751fec85654a68ae4fc83 From 6dfaa7caecacf68000bf81e02752fc7e5948e766 Mon Sep 17 00:00:00 2001 From: Zhou Xiao Date: Fri, 13 Jun 2025 20:13:49 +0800 Subject: [PATCH 02/10] change(ble): [AUTO_MR] Update lib_esp32c5 to b8770ab2 --- components/bt/controller/lib_esp32c5/esp32c5-bt-lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/bt/controller/lib_esp32c5/esp32c5-bt-lib b/components/bt/controller/lib_esp32c5/esp32c5-bt-lib index 40a1921b1f..cfcd6049a6 160000 --- a/components/bt/controller/lib_esp32c5/esp32c5-bt-lib +++ b/components/bt/controller/lib_esp32c5/esp32c5-bt-lib @@ -1 +1 @@ -Subproject commit 40a1921b1f2993eb7558309e73fef837a8a28a15 +Subproject commit cfcd6049a6742361240e71f2c532f9ca4006c03b From ea7689c5032ac72d39293d78260d410a6086f3de Mon Sep 17 00:00:00 2001 From: Zhou Xiao Date: Fri, 13 Jun 2025 20:13:49 +0800 Subject: [PATCH 03/10] change(ble): [AUTO_MR] Update lib_esp32c6 to b8770ab2 --- components/bt/controller/lib_esp32c6/esp32c6-bt-lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/bt/controller/lib_esp32c6/esp32c6-bt-lib b/components/bt/controller/lib_esp32c6/esp32c6-bt-lib index 250e75199e..47fde85c47 160000 --- a/components/bt/controller/lib_esp32c6/esp32c6-bt-lib +++ b/components/bt/controller/lib_esp32c6/esp32c6-bt-lib @@ -1 +1 @@ -Subproject commit 250e75199e8772a9ce44c53e7747063107d36155 +Subproject commit 47fde85c4789cc5e7487d5e1244f9012c3fadf2a From 39e7147613a99063de91e889c66e651a88157ff6 Mon Sep 17 00:00:00 2001 From: Zhou Xiao Date: Fri, 13 Jun 2025 20:13:49 +0800 Subject: [PATCH 04/10] change(ble): [AUTO_MR] Update lib_esp32c2 to e865b4f9 --- components/bt/controller/lib_esp32c2/esp32c2-bt-lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/bt/controller/lib_esp32c2/esp32c2-bt-lib b/components/bt/controller/lib_esp32c2/esp32c2-bt-lib index 3ad0070589..64ba4e23f3 160000 --- a/components/bt/controller/lib_esp32c2/esp32c2-bt-lib +++ b/components/bt/controller/lib_esp32c2/esp32c2-bt-lib @@ -1 +1 @@ -Subproject commit 3ad007058995a523c2cd212bcef4c6937533871e +Subproject commit 64ba4e23f3bb2e8ecf26f7901b0657a950682d3d From 640e44eff80e53489203bfbef9e8b286de7a5d28 Mon Sep 17 00:00:00 2001 From: cjin Date: Tue, 24 Jun 2025 12:30:44 +0800 Subject: [PATCH 05/10] change(ble): update lib_esp32c5 to ea6c58c7 --- components/bt/controller/lib_esp32c5/esp32c5-bt-lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/bt/controller/lib_esp32c5/esp32c5-bt-lib b/components/bt/controller/lib_esp32c5/esp32c5-bt-lib index cfcd6049a6..effd35f8c8 160000 --- a/components/bt/controller/lib_esp32c5/esp32c5-bt-lib +++ b/components/bt/controller/lib_esp32c5/esp32c5-bt-lib @@ -1 +1 @@ -Subproject commit cfcd6049a6742361240e71f2c532f9ca4006c03b +Subproject commit effd35f8c8f7a0b7363dc70f13162600b512cd7d From 9f3be8aa92eca4dba702edc7e05f1514b835464c Mon Sep 17 00:00:00 2001 From: cjin Date: Tue, 24 Jun 2025 12:31:23 +0800 Subject: [PATCH 06/10] change(ble): update lib_esp32h2 to ea6c58c7 --- components/bt/controller/lib_esp32h2/esp32h2-bt-lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/bt/controller/lib_esp32h2/esp32h2-bt-lib b/components/bt/controller/lib_esp32h2/esp32h2-bt-lib index 7ac752b47c..e90088b356 160000 --- a/components/bt/controller/lib_esp32h2/esp32h2-bt-lib +++ b/components/bt/controller/lib_esp32h2/esp32h2-bt-lib @@ -1 +1 @@ -Subproject commit 7ac752b47c70f43cf08751fec85654a68ae4fc83 +Subproject commit e90088b35639ee9b41ab67fcd5b8dab5395cfacb From 5845d3a7df8b7d6a85cf17f0cb8fb7c3f9da6101 Mon Sep 17 00:00:00 2001 From: cjin Date: Tue, 24 Jun 2025 12:31:47 +0800 Subject: [PATCH 07/10] change(ble): update lib_esp32c6 and esp32c61 to ea6c58c7 --- components/bt/controller/lib_esp32c6/esp32c6-bt-lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/bt/controller/lib_esp32c6/esp32c6-bt-lib b/components/bt/controller/lib_esp32c6/esp32c6-bt-lib index 47fde85c47..fa4b7f913d 160000 --- a/components/bt/controller/lib_esp32c6/esp32c6-bt-lib +++ b/components/bt/controller/lib_esp32c6/esp32c6-bt-lib @@ -1 +1 @@ -Subproject commit 47fde85c4789cc5e7487d5e1244f9012c3fadf2a +Subproject commit fa4b7f913d6b65ea30b8d06eb1e62dc1b86b7843 From a4b08004448db5a0cbd4dfff6aa3d1acc015b241 Mon Sep 17 00:00:00 2001 From: cjin Date: Mon, 16 Jun 2025 10:38:19 +0800 Subject: [PATCH 08/10] feat(ble): add sm count reserve cnt setting on ESP32-C5 --- components/bt/controller/esp32c5/Kconfig.in | 31 +++++++++++++++++++ components/bt/controller/esp32c5/esp_bt_cfg.h | 3 ++ .../bt/include/esp32c5/include/esp_bt.h | 6 +++- 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/components/bt/controller/esp32c5/Kconfig.in b/components/bt/controller/esp32c5/Kconfig.in index 2e6db9fdf6..2982b6da8e 100644 --- a/components/bt/controller/esp32c5/Kconfig.in +++ b/components/bt/controller/esp32c5/Kconfig.in @@ -812,3 +812,34 @@ config BT_LE_CTRL_FAST_CONN_DATA_TX_EN help If this option is enabled, The Controller will continue to Send an empty PDU after sending valid connection data within an interval. + +menu "Reserved Memory Config" + config BT_LE_EXT_ADV_RESERVED_MEMORY_COUNT + int "The value of reserved EXT ADV memory count at initialization" + range 0 4 + default 2 + help + This value sets the number the Controller will allocate for extended advertisement + instances at initialization process. If more extended advertisement instances are + enabled, those memory will be dynamically allocated. + Using reduced amount of reserved memory will save heap size at the cost of extra + time consumption at advertising start process and possible advertising start failure + due to memory shortage. + The actual reserved memory count will be the minimum value between the maximum + extended advertisement instances and the BT_LE_EXT_ADV_RESERVED_MEMORY_COUNT. + + + config BT_LE_CONN_RESERVED_MEMORY_COUNT + int "The value of reserved CONN memory count at initialization" + range 0 70 + default 2 + help + This value sets the number the Controller will allocate for connection instances + at the initialization process. If more connection instances are enabled, those + memory will be dynamically allocated. + Using reduced amount of reserved memory will save heap size at the cost of extra + time consumption at connection establishment process and possible connection + establishment failure due to memory shortage. + The actual reserved memory count will be the minimum value between the maximum + connection instances and the BT_LE_CONN_RESERVED_MEMORY_COUNT. +endmenu diff --git a/components/bt/controller/esp32c5/esp_bt_cfg.h b/components/bt/controller/esp32c5/esp_bt_cfg.h index 48a845a3fa..01f9dc6182 100644 --- a/components/bt/controller/esp32c5/esp_bt_cfg.h +++ b/components/bt/controller/esp32c5/esp_bt_cfg.h @@ -280,6 +280,9 @@ extern "C" { #define BLE_LL_TX_PWR_DBM_N (CONFIG_BT_LE_DFT_TX_POWER_LEVEL_DBM_EFF) +#define BLE_LL_ADV_SM_RESERVE_CNT_N MIN(DEFAULT_BT_LE_MAX_EXT_ADV_INSTANCES, CONFIG_BT_LE_EXT_ADV_RESERVED_MEMORY_COUNT) +#define BLE_LL_CONN_SM_RESERVE_CNT_N MIN(DEFAULT_BT_LE_MAX_CONNECTIONS, CONFIG_BT_LE_CONN_RESERVED_MEMORY_COUNT) + #define RUN_BQB_TEST (0) #define RUN_QA_TEST (0) #define NIMBLE_DISABLE_SCAN_BACKOFF (0) diff --git a/components/bt/include/esp32c5/include/esp_bt.h b/components/bt/include/esp32c5/include/esp_bt.h index 91b1da306a..ce490db77a 100644 --- a/components/bt/include/esp32c5/include/esp_bt.h +++ b/components/bt/include/esp32c5/include/esp_bt.h @@ -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); -#define CONFIG_VERSION 0x20250526 +#define CONFIG_VERSION 0x20250606 #define CONFIG_MAGIC 0x5A5AA5A5 /** @@ -232,6 +232,8 @@ typedef struct { - 0 - Disable - 1 - Enable (default) */ int8_t ch39_txpwr; /*!< BLE transmit power (in dBm) used for BLE advertising on channel 39. */ + uint8_t adv_rsv_cnt; /*!< BLE adv state machine reserve count number */ + uint8_t conn_rsv_cnt; /*!< BLE conn state machine reserve count number */ uint32_t config_magic; /*!< Magic number for configuration validation */ } esp_bt_controller_config_t; @@ -291,6 +293,8 @@ typedef struct { .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, \ + .adv_rsv_cnt = BLE_LL_ADV_SM_RESERVE_CNT_N, \ + .conn_rsv_cnt = BLE_LL_CONN_SM_RESERVE_CNT_N, \ .config_magic = CONFIG_MAGIC, \ } From 1653442b7bc375752aea61582cbde9fa4cce461c Mon Sep 17 00:00:00 2001 From: cjin Date: Mon, 16 Jun 2025 10:38:39 +0800 Subject: [PATCH 09/10] feat(ble): add sm count reserve cnt setting on ESP32-C6 and ESP32-C61 --- components/bt/controller/esp32c6/Kconfig.in | 31 +++++++++++++++++++ components/bt/controller/esp32c6/esp_bt_cfg.h | 3 ++ .../bt/include/esp32c6/include/esp_bt.h | 8 ++++- 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/components/bt/controller/esp32c6/Kconfig.in b/components/bt/controller/esp32c6/Kconfig.in index 949349aaaf..8f3c33630b 100644 --- a/components/bt/controller/esp32c6/Kconfig.in +++ b/components/bt/controller/esp32c6/Kconfig.in @@ -846,3 +846,34 @@ config BT_LE_CTRL_FAST_CONN_DATA_TX_EN help If this option is enabled, The Controller will continue to Send an empty PDU after sending valid connection data within an interval. + +menu "Reserved Memory Config" + config BT_LE_EXT_ADV_RESERVED_MEMORY_COUNT + int "The value of reserved EXT ADV memory count at initialization" + range 0 4 + default 2 + help + This value sets the number the Controller will allocate for extended advertisement + instances at initialization process. If more extended advertisement instances are + enabled, those memory will be dynamically allocated. + Using reduced amount of reserved memory will save heap size at the cost of extra + time consumption at advertising start process and possible advertising start failure + due to memory shortage. + The actual reserved memory count will be the minimum value between the maximum + extended advertisement instances and the BT_LE_EXT_ADV_RESERVED_MEMORY_COUNT. + + + config BT_LE_CONN_RESERVED_MEMORY_COUNT + int "The value of reserved CONN memory count at initialization" + range 0 70 + default 2 + help + This value sets the number the Controller will allocate for connection instances + at the initialization process. If more connection instances are enabled, those + memory will be dynamically allocated. + Using reduced amount of reserved memory will save heap size at the cost of extra + time consumption at connection establishment process and possible connection + establishment failure due to memory shortage. + The actual reserved memory count will be the minimum value between the maximum + connection instances and the BT_LE_CONN_RESERVED_MEMORY_COUNT. +endmenu diff --git a/components/bt/controller/esp32c6/esp_bt_cfg.h b/components/bt/controller/esp32c6/esp_bt_cfg.h index f22c4c75be..6def839e56 100644 --- a/components/bt/controller/esp32c6/esp_bt_cfg.h +++ b/components/bt/controller/esp32c6/esp_bt_cfg.h @@ -283,6 +283,9 @@ extern "C" { #define BLE_LL_TX_PWR_DBM_N (CONFIG_BT_LE_DFT_TX_POWER_LEVEL_DBM_EFF) +#define BLE_LL_ADV_SM_RESERVE_CNT_N MIN(DEFAULT_BT_LE_MAX_EXT_ADV_INSTANCES, CONFIG_BT_LE_EXT_ADV_RESERVED_MEMORY_COUNT) +#define BLE_LL_CONN_SM_RESERVE_CNT_N MIN(DEFAULT_BT_LE_MAX_CONNECTIONS, CONFIG_BT_LE_CONN_RESERVED_MEMORY_COUNT) + #define RUN_BQB_TEST (0) #define RUN_QA_TEST (0) #define NIMBLE_DISABLE_SCAN_BACKOFF (0) diff --git a/components/bt/include/esp32c6/include/esp_bt.h b/components/bt/include/esp32c6/include/esp_bt.h index c035b4a6cc..f0c0c55644 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 0x20250526 +#define CONFIG_VERSION 0x20250606 #define CONFIG_MAGIC 0x5A5AA5A5 /** @@ -232,6 +232,8 @@ typedef struct { - 0 - Disable - 1 - Enable (default) */ int8_t ch39_txpwr; /*!< BLE transmit power (in dBm) used for BLE advertising on channel 39. */ + uint8_t adv_rsv_cnt; /*!< BLE adv state machine reserve count number */ + uint8_t conn_rsv_cnt; /*!< BLE conn state machine reserve count number */ uint32_t config_magic; /*!< Magic number for configuration validation */ } esp_bt_controller_config_t; @@ -294,6 +296,8 @@ typedef struct { .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, \ + .adv_rsv_cnt = BLE_LL_ADV_SM_RESERVE_CNT_N, \ + .conn_rsv_cnt = BLE_LL_CONN_SM_RESERVE_CNT_N, \ .config_magic = CONFIG_MAGIC, \ } #elif CONFIG_IDF_TARGET_ESP32C61 @@ -353,6 +357,8 @@ typedef struct { .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, \ + .adv_rsv_cnt = BLE_LL_ADV_SM_RESERVE_CNT_N, \ + .conn_rsv_cnt = BLE_LL_CONN_SM_RESERVE_CNT_N, \ .config_magic = CONFIG_MAGIC, \ } #endif From 884573a41936489464473ba510855c6f31f85a85 Mon Sep 17 00:00:00 2001 From: cjin Date: Mon, 16 Jun 2025 10:38:55 +0800 Subject: [PATCH 10/10] feat(ble): add sm count reserve cnt setting on ESP32-H2 --- components/bt/controller/esp32h2/Kconfig.in | 31 +++++++++++++++++++ components/bt/controller/esp32h2/esp_bt_cfg.h | 3 ++ .../bt/include/esp32h2/include/esp_bt.h | 6 +++- 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/components/bt/controller/esp32h2/Kconfig.in b/components/bt/controller/esp32h2/Kconfig.in index 14330540e0..2f914a1075 100644 --- a/components/bt/controller/esp32h2/Kconfig.in +++ b/components/bt/controller/esp32h2/Kconfig.in @@ -850,3 +850,34 @@ config BT_LE_CTRL_FAST_CONN_DATA_TX_EN help If this option is enabled, The Controller will continue to Send an empty PDU after sending valid connection data within an interval. + +menu "Reserved Memory Config" + config BT_LE_EXT_ADV_RESERVED_MEMORY_COUNT + int "The value of reserved EXT ADV memory count at initialization" + range 0 4 + default 2 + help + This value sets the number the Controller will allocate for extended advertisement + instances at initialization process. If more extended advertisement instances are + enabled, those memory will be dynamically allocated. + Using reduced amount of reserved memory will save heap size at the cost of extra + time consumption at advertising start process and possible advertising start failure + due to memory shortage. + The actual reserved memory count will be the minimum value between the maximum + extended advertisement instances and the BT_LE_EXT_ADV_RESERVED_MEMORY_COUNT. + + + config BT_LE_CONN_RESERVED_MEMORY_COUNT + int "The value of reserved CONN memory count at initialization" + range 0 70 + default 2 + help + This value sets the number the Controller will allocate for connection instances + at the initialization process. If more connection instances are enabled, those + memory will be dynamically allocated. + Using reduced amount of reserved memory will save heap size at the cost of extra + time consumption at connection establishment process and possible connection + establishment failure due to memory shortage. + The actual reserved memory count will be the minimum value between the maximum connection instances and + the BT_LE_CONN_RESERVED_MEMORY_COUNT. +endmenu diff --git a/components/bt/controller/esp32h2/esp_bt_cfg.h b/components/bt/controller/esp32h2/esp_bt_cfg.h index 48a845a3fa..01f9dc6182 100644 --- a/components/bt/controller/esp32h2/esp_bt_cfg.h +++ b/components/bt/controller/esp32h2/esp_bt_cfg.h @@ -280,6 +280,9 @@ extern "C" { #define BLE_LL_TX_PWR_DBM_N (CONFIG_BT_LE_DFT_TX_POWER_LEVEL_DBM_EFF) +#define BLE_LL_ADV_SM_RESERVE_CNT_N MIN(DEFAULT_BT_LE_MAX_EXT_ADV_INSTANCES, CONFIG_BT_LE_EXT_ADV_RESERVED_MEMORY_COUNT) +#define BLE_LL_CONN_SM_RESERVE_CNT_N MIN(DEFAULT_BT_LE_MAX_CONNECTIONS, CONFIG_BT_LE_CONN_RESERVED_MEMORY_COUNT) + #define RUN_BQB_TEST (0) #define RUN_QA_TEST (0) #define NIMBLE_DISABLE_SCAN_BACKOFF (0) diff --git a/components/bt/include/esp32h2/include/esp_bt.h b/components/bt/include/esp32h2/include/esp_bt.h index 0aafa744bd..b33f8b7359 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 0x20250526 +#define CONFIG_VERSION 0x20250606 #define CONFIG_MAGIC 0x5A5AA5A5 /** @@ -234,6 +234,8 @@ typedef struct { - 0 - Disable - 1 - Enable (default) */ int8_t ch39_txpwr; /*!< BLE transmit power (in dBm) used for BLE advertising on channel 39. */ + uint8_t adv_rsv_cnt; /*!< BLE adv state machine reserve count number */ + uint8_t conn_rsv_cnt; /*!< BLE conn state machine reserve count number */ uint32_t config_magic; /*!< Configuration magic value */ } esp_bt_controller_config_t; @@ -294,6 +296,8 @@ typedef struct { .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, \ + .adv_rsv_cnt = BLE_LL_ADV_SM_RESERVE_CNT_N, \ + .conn_rsv_cnt = BLE_LL_CONN_SM_RESERVE_CNT_N, \ .config_magic = CONFIG_MAGIC, \ }