From 1e196de967a66f04aa7a88e49aeee6a8e5e92f7b Mon Sep 17 00:00:00 2001 From: zhaoweiliang Date: Tue, 27 Jan 2026 12:03:02 +0800 Subject: [PATCH 1/7] change(ble): [AUTO_MR] Update lib_esp32h2 to bc223ab7 --- 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 27ca7c0a07..126dbfeec7 160000 --- a/components/bt/controller/lib_esp32h2/esp32h2-bt-lib +++ b/components/bt/controller/lib_esp32h2/esp32h2-bt-lib @@ -1 +1 @@ -Subproject commit 27ca7c0a074804c382409d01f86f5f46b4382bca +Subproject commit 126dbfeec7e7291458ce6ff8f9297e46f8946733 From a82be7c52c867d09d0b258d3a1aec7f8938a455e Mon Sep 17 00:00:00 2001 From: zhaoweiliang Date: Tue, 27 Jan 2026 12:03:02 +0800 Subject: [PATCH 2/7] change(ble): [AUTO_MR] Update lib_esp32c5 to bc223ab7 --- 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 bbff15b4d8..1a570a59b6 160000 --- a/components/bt/controller/lib_esp32c5/esp32c5-bt-lib +++ b/components/bt/controller/lib_esp32c5/esp32c5-bt-lib @@ -1 +1 @@ -Subproject commit bbff15b4d8cecad7c9e44b84bc32efc80cb3c6b2 +Subproject commit 1a570a59b6d694b8829c82555f445d88bf26f295 From 6ed9fc7d6bc7676770a4c3854d9847ef8152a938 Mon Sep 17 00:00:00 2001 From: zhaoweiliang Date: Tue, 27 Jan 2026 12:03:02 +0800 Subject: [PATCH 3/7] change(ble): [AUTO_MR] Update lib_esp32c6 to bc223ab7 --- 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 d8b5341796..9d05fc931a 160000 --- a/components/bt/controller/lib_esp32c6/esp32c6-bt-lib +++ b/components/bt/controller/lib_esp32c6/esp32c6-bt-lib @@ -1 +1 @@ -Subproject commit d8b5341796e19d39aaa011dcdc3b71ca6f9450f0 +Subproject commit 9d05fc931ae771de52de7e4b4c7090f5b3ec0ec4 From 84924e3980ab8acdbb2caa17cd81f1fdd788b601 Mon Sep 17 00:00:00 2001 From: zhaoweiliang Date: Tue, 27 Jan 2026 11:40:15 +0800 Subject: [PATCH 4/7] feat(ble): support adv fast tx feature on ESP32-C6 and ESP32-H2 --- components/bt/controller/esp32c6/Kconfig.in | 9 +++++++ components/bt/controller/esp32c6/ble.c | 27 +++++++++++++++++++-- components/bt/controller/esp32h2/Kconfig.in | 9 +++++++ components/bt/controller/esp32h2/ble.c | 27 +++++++++++++++++++-- components/bt/linker_esp_ble_controller.lf | 10 ++++++++ 5 files changed, 78 insertions(+), 4 deletions(-) diff --git a/components/bt/controller/esp32c6/Kconfig.in b/components/bt/controller/esp32c6/Kconfig.in index a2fb88293e..8b430c96a7 100644 --- a/components/bt/controller/esp32c6/Kconfig.in +++ b/components/bt/controller/esp32c6/Kconfig.in @@ -1000,3 +1000,12 @@ config BT_LE_CTRL_DL_ITVL_PHY_SYNC_EN When this option is enabled, the Controller automatically initiates a data length update Using the appropriate data length parameters When a PHY update or a connection interval update occurs. + +config BT_LE_CTRL_ADV_FAST_TX_EN + bool "Reduce adv enable-to-air latency (READ DOCS FIRST) (EXPERIMENTAL)" + default n + help + Reduce the latency between issuing the advertising enable command + and the actual on-air transmission by executing the advertising TX + path from IRAM. + Note: Enabling this option increases IRAM usage. diff --git a/components/bt/controller/esp32c6/ble.c b/components/bt/controller/esp32c6/ble.c index 7b5e76abe8..5052f6516c 100644 --- a/components/bt/controller/esp32c6/ble.c +++ b/components/bt/controller/esp32c6/ble.c @@ -80,6 +80,13 @@ int pawrSync_stack_enable(void); void pawrSync_stack_disable(void); #endif // DEFAULT_BT_LE_PAWR_SUPPORTED +#if CONFIG_BT_LE_CTRL_ADV_FAST_TX_EN +int advFastTx_stack_initEnv(void); +void advFastTx_stack_deinitEnv(void); +int advFastTx_stack_enable(void); +void advFastTx_stack_disable(void); +#endif // CONFIG_BT_LE_CTRL_ADV_FAST_TX_EN + #if (CONFIG_BT_NIMBLE_ENABLED || CONFIG_BT_BLUEDROID_ENABLED) void adv_stack_enableClearLegacyAdvVsCmd(bool en); void scan_stack_enableAdvFlowCtrlVsCmd(bool en); @@ -211,12 +218,20 @@ int ble_stack_initEnv(void) return rc; } #endif // DEFAULT_BT_LE_PAWR_SUPPORTED - +#if CONFIG_BT_LE_CTRL_ADV_FAST_TX_EN + rc = advFastTx_stack_initEnv(); + if (rc) { + return rc; + } +#endif // CONFIG_BT_LE_CTRL_ADV_FAST_TX_EN return 0; } void ble_stack_deinitEnv(void) { +#if CONFIG_BT_LE_CTRL_ADV_FAST_TX_EN + advFastTx_stack_deinitEnv(); +#endif // CONFIG_BT_LE_CTRL_ADV_FAST_TX_EN #if DEFAULT_BT_LE_PAWR_SUPPORTED pawrSync_stack_deinitEnv(); pawrBcast_stack_deinitEnv(); @@ -302,7 +317,12 @@ int ble_stack_enable(void) return rc; } #endif // DEFAULT_BT_LE_PAWR_SUPPORTED - +#if CONFIG_BT_LE_CTRL_ADV_FAST_TX_EN + rc = advFastTx_stack_enable(); + if (rc) { + return rc; + } +#endif // CONFIG_BT_LE_CTRL_ADV_FAST_TX_EN #if (CONFIG_BT_NIMBLE_ENABLED || CONFIG_BT_BLUEDROID_ENABLED) ble_stack_enableVsCmds(true); ble_stack_enableVsEvents(true); @@ -321,6 +341,9 @@ void ble_stack_disable(void) ble_stack_enableVsEvents(false); ble_stack_enableVsCmds(false); #endif // (CONFIG_BT_NIMBLE_ENABLED || CONFIG_BT_BLUEDROID_ENABLED) +#if CONFIG_BT_LE_CTRL_ADV_FAST_TX_EN + advFastTx_stack_disable(); +#endif // CONFIG_BT_LE_CTRL_ADV_FAST_TX_EN #if DEFAULT_BT_LE_PAWR_SUPPORTED pawrSync_stack_disable(); pawrBcast_stack_disable(); diff --git a/components/bt/controller/esp32h2/Kconfig.in b/components/bt/controller/esp32h2/Kconfig.in index b613c6f27d..8f92508aba 100644 --- a/components/bt/controller/esp32h2/Kconfig.in +++ b/components/bt/controller/esp32h2/Kconfig.in @@ -1004,3 +1004,12 @@ config BT_LE_CTRL_DL_ITVL_PHY_SYNC_EN When this option is enabled, the Controller automatically initiates a data length update Using the appropriate data length parameters When a PHY update or a connection interval update occurs. + +config BT_LE_CTRL_ADV_FAST_TX_EN + bool "Reduce adv enable-to-air latency (READ DOCS FIRST) (EXPERIMENTAL)" + default n + help + Reduce the latency between issuing the advertising enable command + and the actual on-air transmission by executing the advertising TX + path from IRAM. + Note: Enabling this option increases IRAM usage. diff --git a/components/bt/controller/esp32h2/ble.c b/components/bt/controller/esp32h2/ble.c index 411c0a69f9..11d92f6112 100644 --- a/components/bt/controller/esp32h2/ble.c +++ b/components/bt/controller/esp32h2/ble.c @@ -75,6 +75,13 @@ int conn_errorSim_enable(void); void conn_errorSim_disable(void); #endif // CONFIG_BT_LE_ERROR_SIM_ENABLED +#if CONFIG_BT_LE_CTRL_ADV_FAST_TX_EN +int advFastTx_stack_initEnv(void); +void advFastTx_stack_deinitEnv(void); +int advFastTx_stack_enable(void); +void advFastTx_stack_disable(void); +#endif // CONFIG_BT_LE_CTRL_ADV_FAST_TX_EN + #if (CONFIG_BT_NIMBLE_ENABLED || CONFIG_BT_BLUEDROID_ENABLED) void adv_stack_enableClearLegacyAdvVsCmd(bool en); void scan_stack_enableAdvFlowCtrlVsCmd(bool en); @@ -198,12 +205,20 @@ int ble_stack_initEnv(void) return rc; } #endif // DEFAULT_BT_LE_PAWR_SUPPORTED - +#if CONFIG_BT_LE_CTRL_ADV_FAST_TX_EN + rc = advFastTx_stack_initEnv(); + if (rc) { + return rc; + } +#endif // CONFIG_BT_LE_CTRL_ADV_FAST_TX_EN return 0; } void ble_stack_deinitEnv(void) { +#if CONFIG_BT_LE_CTRL_ADV_FAST_TX_EN + advFastTx_stack_deinitEnv(); +#endif // CONFIG_BT_LE_CTRL_ADV_FAST_TX_EN #if DEFAULT_BT_LE_PAWR_SUPPORTED pawrSync_stack_deinitEnv(); pawrBcast_stack_deinitEnv(); @@ -289,7 +304,12 @@ int ble_stack_enable(void) return rc; } #endif // DEFAULT_BT_LE_PAWR_SUPPORTED - +#if CONFIG_BT_LE_CTRL_ADV_FAST_TX_EN + rc = advFastTx_stack_enable(); + if (rc) { + return rc; + } +#endif // CONFIG_BT_LE_CTRL_ADV_FAST_TX_EN #if (CONFIG_BT_NIMBLE_ENABLED || CONFIG_BT_BLUEDROID_ENABLED) ble_stack_enableVsCmds(true); ble_stack_enableVsEvents(true); @@ -308,6 +328,9 @@ void ble_stack_disable(void) ble_stack_enableVsEvents(false); ble_stack_enableVsCmds(false); #endif // (CONFIG_BT_NIMBLE_ENABLED || CONFIG_BT_BLUEDROID_ENABLED) +#if CONFIG_BT_LE_CTRL_ADV_FAST_TX_EN + advFastTx_stack_disable(); +#endif // CONFIG_BT_LE_CTRL_ADV_FAST_TX_EN #if DEFAULT_BT_LE_PAWR_SUPPORTED pawrSync_stack_disable(); pawrBcast_stack_disable(); diff --git a/components/bt/linker_esp_ble_controller.lf b/components/bt/linker_esp_ble_controller.lf index 0af407f8eb..b9b9b124b9 100644 --- a/components/bt/linker_esp_ble_controller.lf +++ b/components/bt/linker_esp_ble_controller.lf @@ -6,17 +6,27 @@ entries: entries: .high_perf_code_iram1+ +[sections:adv_fast_execute_code_iram_text] +entries: + .adv_fast_execute_code_iram1+ + [scheme:bt_default] entries: bt_bss -> dram0_bss bt_common -> dram0_bss data -> dram0_data high_perf_iram_text -> iram0_text + if BT_CTRL_RUN_IN_FLASH_ONLY = y: bt_iram_text -> flash_text else: bt_iram_text -> iram0_text + if BT_LE_CTRL_ADV_FAST_TX_EN = y: + adv_fast_execute_code_iram_text -> iram0_text + else: + adv_fast_execute_code_iram_text -> flash_text + # For the following fragments, order matters for # 'ALIGN(4) ALIGN(4, post) SURROUND(sym)', which generates: # From 1fc9676c999f78a3cd0b3578440112debe85db3d Mon Sep 17 00:00:00 2001 From: zhaoweiliang Date: Tue, 27 Jan 2026 12:17:14 +0800 Subject: [PATCH 5/7] feat(ble): support adv fast tx feature on ESP32-C5 --- components/bt/controller/esp32c5/Kconfig.in | 9 ++++ components/bt/controller/esp32c5/ble.c | 50 +++++++++++++++------ 2 files changed, 46 insertions(+), 13 deletions(-) diff --git a/components/bt/controller/esp32c5/Kconfig.in b/components/bt/controller/esp32c5/Kconfig.in index 8e57445217..69d55a4855 100644 --- a/components/bt/controller/esp32c5/Kconfig.in +++ b/components/bt/controller/esp32c5/Kconfig.in @@ -979,3 +979,12 @@ config BT_LE_CTRL_DL_ITVL_PHY_SYNC_EN When this option is enabled, the Controller automatically initiates a data length update Using the appropriate data length parameters When a PHY update or a connection interval update occurs. + +config BT_LE_CTRL_ADV_FAST_TX_EN + bool "Reduce adv enable-to-air latency (READ DOCS FIRST) (EXPERIMENTAL)" + default n + help + Reduce the latency between issuing the advertising enable command + and the actual on-air transmission by executing the advertising TX + path from IRAM. + Note: Enabling this option increases IRAM usage. diff --git a/components/bt/controller/esp32c5/ble.c b/components/bt/controller/esp32c5/ble.c index b9fd93c43c..50557cd556 100644 --- a/components/bt/controller/esp32c5/ble.c +++ b/components/bt/controller/esp32c5/ble.c @@ -44,6 +44,18 @@ int dtm_stack_enable(void); void dtm_stack_disable(void); #endif // CONFIG_BT_LE_DTM_ENABLED +int conn_stack_initEnv(void); +void conn_stack_deinitEnv(void); +int conn_stack_enable(void); +void conn_stack_disable(void); + +#if CONFIG_BT_LE_ERROR_SIM_ENABLED +int conn_errorSim_initEnv(void); +void conn_errorSim_deinitEnv(void); +int conn_errorSim_enable(void); +void conn_errorSim_disable(void); +#endif // CONFIG_BT_LE_ERROR_SIM_ENABLED + #if DEFAULT_BT_LE_PAWR_SUPPORTED || CONFIG_BT_LE_ERROR_SIM_ENABLED int ble_single_env_init(void); void ble_single_env_deinit(void); @@ -63,17 +75,12 @@ int pawrSync_stack_enable(void); void pawrSync_stack_disable(void); #endif // DEFAULT_BT_LE_PAWR_SUPPORTED -int conn_stack_initEnv(void); -void conn_stack_deinitEnv(void); -int conn_stack_enable(void); -void conn_stack_disable(void); - -#if CONFIG_BT_LE_ERROR_SIM_ENABLED -int conn_errorSim_initEnv(void); -void conn_errorSim_deinitEnv(void); -int conn_errorSim_enable(void); -void conn_errorSim_disable(void); -#endif // CONFIG_BT_LE_ERROR_SIM_ENABLED +#if CONFIG_BT_LE_CTRL_ADV_FAST_TX_EN +int advFastTx_stack_initEnv(void); +void advFastTx_stack_deinitEnv(void); +int advFastTx_stack_enable(void); +void advFastTx_stack_disable(void); +#endif // CONFIG_BT_LE_CTRL_ADV_FAST_TX_EN #if (CONFIG_BT_NIMBLE_ENABLED || CONFIG_BT_BLUEDROID_ENABLED) void adv_stack_enableClearLegacyAdvVsCmd(bool en); @@ -200,12 +207,20 @@ int ble_stack_initEnv(void) return rc; } #endif // DEFAULT_BT_LE_PAWR_SUPPORTED - +#if CONFIG_BT_LE_CTRL_ADV_FAST_TX_EN + rc = advFastTx_stack_initEnv(); + if (rc) { + return rc; + } +#endif // CONFIG_BT_LE_CTRL_ADV_FAST_TX_EN return 0; } void ble_stack_deinitEnv(void) { +#if CONFIG_BT_LE_CTRL_ADV_FAST_TX_EN + advFastTx_stack_deinitEnv(); +#endif // CONFIG_BT_LE_CTRL_ADV_FAST_TX_EN #if DEFAULT_BT_LE_PAWR_SUPPORTED pawrSync_stack_deinitEnv(); pawrBcast_stack_deinitEnv(); @@ -291,7 +306,12 @@ int ble_stack_enable(void) return rc; } #endif // DEFAULT_BT_LE_PAWR_SUPPORTED - +#if CONFIG_BT_LE_CTRL_ADV_FAST_TX_EN + rc = advFastTx_stack_enable(); + if (rc) { + return rc; + } +#endif // CONFIG_BT_LE_CTRL_ADV_FAST_TX_EN #if (CONFIG_BT_NIMBLE_ENABLED || CONFIG_BT_BLUEDROID_ENABLED) ble_stack_enableVsCmds(true); ble_stack_enableVsEvents(true); @@ -310,6 +330,10 @@ void ble_stack_disable(void) ble_stack_enableVsEvents(false); ble_stack_enableVsCmds(false); #endif // (CONFIG_BT_NIMBLE_ENABLED || CONFIG_BT_BLUEDROID_ENABLED) +#if CONFIG_BT_LE_CTRL_ADV_FAST_TX_EN + advFastTx_stack_disable(); +#endif // CONFIG_BT_LE_CTRL_ADV_FAST_TX_EN + #if DEFAULT_BT_LE_PAWR_SUPPORTED pawrSync_stack_disable(); pawrBcast_stack_disable(); From 5307ec1f929cab08ce292d16af4a711b20f30e5d Mon Sep 17 00:00:00 2001 From: cjin Date: Tue, 27 Jan 2026 14:37:59 +0800 Subject: [PATCH 6/7] feat(ble): add config for reserved controller memory on ESP32C5 --- components/bt/controller/esp32c5/ble.c | 6 ++++++ components/bt/controller/esp32c5/esp_bt_cfg.h | 14 ++++++++++++++ components/bt/include/esp32c5/include/esp_bt.h | 8 ++++++-- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/components/bt/controller/esp32c5/ble.c b/components/bt/controller/esp32c5/ble.c index 50557cd556..3b8aa469a6 100644 --- a/components/bt/controller/esp32c5/ble.c +++ b/components/bt/controller/esp32c5/ble.c @@ -122,6 +122,12 @@ void ble_stack_enableVsCmds(bool en) log_stack_enableLogsRelatedVsCmd(en); hci_stack_enableSetVsEvtMaskVsCmd(en); winWiden_stack_enableSetConstPeerScaVsCmd(en); +#if DEFAULT_BT_SCAN_ALLOW_ENH_ADI_FILTER + scan_stack_enableSetScanADIOnlyFilterVsCmd(en); +#endif // DEFAULT_BT_SCAN_ALLOW_ENH_ADI_FILTER +#if DEFAULT_BT_ADV_SEND_CONSTANT_DID + extAdv_stack_setExtAdvConstantDidVsCmd(en); +#endif // DEFAULT_BT_ADV_SEND_CONSTANT_DID } void ble_stack_enableVsEvents(bool en) diff --git a/components/bt/controller/esp32c5/esp_bt_cfg.h b/components/bt/controller/esp32c5/esp_bt_cfg.h index a309a7fd54..5d547e6ac4 100644 --- a/components/bt/controller/esp32c5/esp_bt_cfg.h +++ b/components/bt/controller/esp32c5/esp_bt_cfg.h @@ -300,6 +300,20 @@ extern "C" { #define DEFAULT_BT_LE_HCI_UART_PARITY (0) #endif +#ifdef CONFIG_BT_LE_CTRL_ADV_FAST_TX_EN +#define DEFAULT_BT_LE_CTRL_ENH_MEM_RESV_ADV (1<<0) +#else +#define DEFAULT_BT_LE_CTRL_ENH_MEM_RESV_ADV (0) +#endif + +#define DEFAULT_BT_LE_CTRL_ENH_MEM_RESV_FLAGS DEFAULT_BT_LE_CTRL_ENH_MEM_RESV_ADV + +#ifdef CONFIG_BT_LE_CTRL_ADV_FAST_TX_EN +#define DEFAULT_BT_LE_CTRL_RXBUF_MEM_RESV CONFIG_BT_LE_CTRL_ADV_FAST_TX_EN +#else +#define DEFAULT_BT_LE_CTRL_RXBUF_MEM_RESV (0) +#endif + /* Unchanged configuration */ #define BLE_LL_CTRL_PROC_TIMEOUT_MS_N (40000) /* ms */ diff --git a/components/bt/include/esp32c5/include/esp_bt.h b/components/bt/include/esp32c5/include/esp_bt.h index c1aa985641..2f55323117 100644 --- a/components/bt/include/esp32c5/include/esp_bt.h +++ b/components/bt/include/esp32c5/include/esp_bt.h @@ -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 */ @@ -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 0x20251211 +#define CONFIG_VERSION 0x20260123 #define CONFIG_MAGIC 0x5A5AA5A5 /** @@ -238,6 +238,8 @@ typedef struct { uint8_t slv_fst_rx_lat_en; /*!< The option for enabling slave fast PDU reception during latency. */ uint8_t dl_itvl_phy_sync_en; /*!< The option for automatically initiate the data length update when phy update or connect interval update. */ uint8_t scan_allow_adi_filter; /*!< The option for ext scan to allow PDU with specific adi. */ + uint8_t enhanced_mem_resv; /*!< The option masks the BLE events with all reserved memory. */ + uint8_t rxbuf_reserved; /*!< The option reserve all Rxbuffer memory at initialization. */ uint32_t config_magic; /*!< Magic number for configuration validation */ } esp_bt_controller_config_t; @@ -303,6 +305,8 @@ typedef struct { .slv_fst_rx_lat_en = DEFAULT_BT_LE_CTRL_SLV_FAST_RX_CONN_DATA_EN, \ .dl_itvl_phy_sync_en = DEFAULT_BT_LE_CTRL_DL_ITVL_PHY_SYNC_EN, \ .scan_allow_adi_filter = DEFAULT_BT_SCAN_ALLOW_ENH_ADI_FILTER, \ + .enhanced_mem_resv = DEFAULT_BT_LE_CTRL_ENH_MEM_RESV_ADV, \ + .rxbuf_reserved = DEFAULT_BT_LE_CTRL_RXBUF_MEM_RESV, \ .config_magic = CONFIG_MAGIC, \ } From 4418d5da82df6fb4c726605265c8618baeca577b Mon Sep 17 00:00:00 2001 From: cjin Date: Tue, 27 Jan 2026 14:38:16 +0800 Subject: [PATCH 7/7] feat(ble): add config for reserved controller memory on ESP32C6 and ESP32H2 --- components/bt/controller/esp32c6/esp_bt_cfg.h | 14 ++++++++++++++ components/bt/controller/esp32h2/ble.c | 6 ++++++ components/bt/controller/esp32h2/esp_bt_cfg.h | 14 ++++++++++++++ components/bt/include/esp32c6/include/esp_bt.h | 14 ++++++++++---- components/bt/include/esp32h2/include/esp_bt.h | 8 ++++++-- 5 files changed, 50 insertions(+), 6 deletions(-) diff --git a/components/bt/controller/esp32c6/esp_bt_cfg.h b/components/bt/controller/esp32c6/esp_bt_cfg.h index 9ed552ccf5..eb82f56941 100644 --- a/components/bt/controller/esp32c6/esp_bt_cfg.h +++ b/components/bt/controller/esp32c6/esp_bt_cfg.h @@ -301,6 +301,20 @@ extern "C" { #define DEFAULT_BT_LE_HCI_UART_PARITY (0) #endif +#ifdef CONFIG_BT_LE_CTRL_ADV_FAST_TX_EN +#define DEFAULT_BT_LE_CTRL_ENH_MEM_RESV_ADV (1<<0) +#else +#define DEFAULT_BT_LE_CTRL_ENH_MEM_RESV_ADV (0) +#endif + +#define DEFAULT_BT_LE_CTRL_ENH_MEM_RESV_FLAGS DEFAULT_BT_LE_CTRL_ENH_MEM_RESV_ADV + +#ifdef CONFIG_BT_LE_CTRL_ADV_FAST_TX_EN +#define DEFAULT_BT_LE_CTRL_RXBUF_MEM_RESV CONFIG_BT_LE_CTRL_ADV_FAST_TX_EN +#else +#define DEFAULT_BT_LE_CTRL_RXBUF_MEM_RESV (0) +#endif + /* Unchanged configuration */ #define BLE_LL_CTRL_PROC_TIMEOUT_MS_N (40000) /* ms */ diff --git a/components/bt/controller/esp32h2/ble.c b/components/bt/controller/esp32h2/ble.c index 11d92f6112..bb1a0cdb9a 100644 --- a/components/bt/controller/esp32h2/ble.c +++ b/components/bt/controller/esp32h2/ble.c @@ -120,6 +120,12 @@ void ble_stack_enableVsCmds(bool en) log_stack_enableLogsRelatedVsCmd(en); hci_stack_enableSetVsEvtMaskVsCmd(en); winWiden_stack_enableSetConstPeerScaVsCmd(en); +#if DEFAULT_BT_SCAN_ALLOW_ENH_ADI_FILTER + scan_stack_enableSetScanADIOnlyFilterVsCmd(en); +#endif // DEFAULT_BT_SCAN_ALLOW_ENH_ADI_FILTER +#if DEFAULT_BT_ADV_SEND_CONSTANT_DID + extAdv_stack_setExtAdvConstantDidVsCmd(en); +#endif // DEFAULT_BT_ADV_SEND_CONSTANT_DID } void ble_stack_enableVsEvents(bool en) diff --git a/components/bt/controller/esp32h2/esp_bt_cfg.h b/components/bt/controller/esp32h2/esp_bt_cfg.h index a309a7fd54..5d547e6ac4 100644 --- a/components/bt/controller/esp32h2/esp_bt_cfg.h +++ b/components/bt/controller/esp32h2/esp_bt_cfg.h @@ -300,6 +300,20 @@ extern "C" { #define DEFAULT_BT_LE_HCI_UART_PARITY (0) #endif +#ifdef CONFIG_BT_LE_CTRL_ADV_FAST_TX_EN +#define DEFAULT_BT_LE_CTRL_ENH_MEM_RESV_ADV (1<<0) +#else +#define DEFAULT_BT_LE_CTRL_ENH_MEM_RESV_ADV (0) +#endif + +#define DEFAULT_BT_LE_CTRL_ENH_MEM_RESV_FLAGS DEFAULT_BT_LE_CTRL_ENH_MEM_RESV_ADV + +#ifdef CONFIG_BT_LE_CTRL_ADV_FAST_TX_EN +#define DEFAULT_BT_LE_CTRL_RXBUF_MEM_RESV CONFIG_BT_LE_CTRL_ADV_FAST_TX_EN +#else +#define DEFAULT_BT_LE_CTRL_RXBUF_MEM_RESV (0) +#endif + /* Unchanged configuration */ #define BLE_LL_CTRL_PROC_TIMEOUT_MS_N (40000) /* ms */ diff --git a/components/bt/include/esp32c6/include/esp_bt.h b/components/bt/include/esp32c6/include/esp_bt.h index ccd91df5c0..9747a07650 100644 --- a/components/bt/include/esp32c6/include/esp_bt.h +++ b/components/bt/include/esp32c6/include/esp_bt.h @@ -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 */ @@ -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 0x20251211 +#define CONFIG_VERSION 0x20260123 #define CONFIG_MAGIC 0x5A5AA5A5 /** @@ -236,8 +236,10 @@ typedef struct { uint8_t conn_rsv_cnt; /*!< BLE conn state machine reserve count number */ uint8_t priority_level_cfg; /*!< The option for priority level configuration */ uint8_t slv_fst_rx_lat_en; /*!< The option for enabling slave fast PDU reception during latency. */ - uint8_t dl_itvl_phy_sync_en; /*!< The option for automatically initiate the data length update when phy update or connect interval update. */ - uint8_t scan_allow_adi_filter; /*!< The option for ext scan to allow PDU with specific adi. */ + uint8_t dl_itvl_phy_sync_en; /*!< The option for automatically initiate the data length update when phy update or connect interval update. */ + uint8_t scan_allow_adi_filter; /*!< The option for ext scan to allow PDU with specific adi. */ + uint8_t enhanced_mem_resv; /*!< The option masks the BLE events with all reserved memory. */ + uint8_t rxbuf_reserved; /*!< The option reserve all Rxbuffer memory at initialization. */ uint32_t config_magic; /*!< Magic number for configuration validation */ } esp_bt_controller_config_t; @@ -306,6 +308,8 @@ typedef struct { .slv_fst_rx_lat_en = DEFAULT_BT_LE_CTRL_SLV_FAST_RX_CONN_DATA_EN, \ .dl_itvl_phy_sync_en = DEFAULT_BT_LE_CTRL_DL_ITVL_PHY_SYNC_EN, \ .scan_allow_adi_filter = DEFAULT_BT_SCAN_ALLOW_ENH_ADI_FILTER, \ + .enhanced_mem_resv = DEFAULT_BT_LE_CTRL_ENH_MEM_RESV_ADV, \ + .rxbuf_reserved = DEFAULT_BT_LE_CTRL_RXBUF_MEM_RESV, \ .config_magic = CONFIG_MAGIC, \ } #elif CONFIG_IDF_TARGET_ESP32C61 @@ -370,6 +374,8 @@ typedef struct { .priority_level_cfg = BT_LL_CTRL_PRIO_LVL_CFG, \ .slv_fst_rx_lat_en = DEFAULT_BT_LE_CTRL_SLV_FAST_RX_CONN_DATA_EN, \ .dl_itvl_phy_sync_en = DEFAULT_BT_LE_CTRL_DL_ITVL_PHY_SYNC_EN, \ + .enhanced_mem_resv = DEFAULT_BT_LE_CTRL_ENH_MEM_RESV_ADV, \ + .rxbuf_reserved = DEFAULT_BT_LE_CTRL_RXBUF_MEM_RESV, \ .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 d4bbabe79e..fdbda4bfc6 100644 --- a/components/bt/include/esp32h2/include/esp_bt.h +++ b/components/bt/include/esp32h2/include/esp_bt.h @@ -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 */ @@ -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 0x20251211 +#define CONFIG_VERSION 0x20260123 #define CONFIG_MAGIC 0x5A5AA5A5 /** @@ -240,6 +240,8 @@ typedef struct { uint8_t slv_fst_rx_lat_en; /*!< The option for enabling slave fast PDU reception during latency. */ uint8_t dl_itvl_phy_sync_en; /*!< The option for automatically initiate the data length update when phy update or connect interval update. */ uint8_t scan_allow_adi_filter; /*!< The option for ext scan to allow PDU with specific adi. */ + uint8_t enhanced_mem_resv; /*!< The option masks the BLE events with all reserved memory. */ + uint8_t rxbuf_reserved; /*!< The option reserve all Rxbuffer memory at initialization. */ uint32_t config_magic; /*!< Configuration magic value */ } esp_bt_controller_config_t; @@ -306,6 +308,8 @@ typedef struct { .slv_fst_rx_lat_en = DEFAULT_BT_LE_CTRL_SLV_FAST_RX_CONN_DATA_EN, \ .dl_itvl_phy_sync_en = DEFAULT_BT_LE_CTRL_DL_ITVL_PHY_SYNC_EN, \ .scan_allow_adi_filter = DEFAULT_BT_SCAN_ALLOW_ENH_ADI_FILTER, \ + .enhanced_mem_resv = DEFAULT_BT_LE_CTRL_ENH_MEM_RESV_ADV, \ + .rxbuf_reserved = DEFAULT_BT_LE_CTRL_RXBUF_MEM_RESV, \ .config_magic = CONFIG_MAGIC, \ }