From b2a17e9d4cf8d12ee22687fc358b8145ceb5a7f5 Mon Sep 17 00:00:00 2001 From: zwj Date: Thu, 13 Oct 2022 15:50:51 +0800 Subject: [PATCH] Update bt lib for ESP32C3 and ESP32S3 - Added config to disable scan backoff - Fixed llm_scan.c assert at line 1485 during controller deinit if duplicate scan is not stopped - Call pll track in controller task --- components/bt/controller/esp32c3/Kconfig.in | 8 ++++++++ components/bt/controller/esp32s3/Kconfig.in | 8 ++++++++ components/bt/controller/lib_esp32c3_family | 2 +- components/bt/include/esp32c3/include/esp_bt.h | 10 +++++++++- components/bt/include/esp32s3/include/esp_bt.h | 10 +++++++++- 5 files changed, 35 insertions(+), 3 deletions(-) diff --git a/components/bt/controller/esp32c3/Kconfig.in b/components/bt/controller/esp32c3/Kconfig.in index fe47c6d383..75969aeca6 100644 --- a/components/bt/controller/esp32c3/Kconfig.in +++ b/components/bt/controller/esp32c3/Kconfig.in @@ -413,3 +413,11 @@ config BT_CTRL_CODED_AGC_RECORRECT_EN default n help Enable coded phy AGC recorrect + +config BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX + bool "Disable active scan backoff" + default n + help + Disable active scan backoff. The bluetooth spec requires that scanners should run a backoff procedure to + minimize collision of scan request PDUs from nultiple scanners. If scan backoff is disabled, in active + scanning, scan request PDU will be sent every time when HW receives scannable ADV PDU. diff --git a/components/bt/controller/esp32s3/Kconfig.in b/components/bt/controller/esp32s3/Kconfig.in index d85ce2e2cc..fd594e3c09 100644 --- a/components/bt/controller/esp32s3/Kconfig.in +++ b/components/bt/controller/esp32s3/Kconfig.in @@ -429,3 +429,11 @@ config BT_CTRL_CODED_AGC_RECORRECT_EN default n help Enable coded phy AGC recorrect + +config BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX + bool "Disable active scan backoff" + default n + help + Disable active scan backoff. The bluetooth spec requires that scanners should run a backoff procedure to + minimize collision of scan request PDUs from nultiple scanners. If scan backoff is disabled, in active + scanning, scan request PDU will be sent every time when HW receives scannable ADV PDU. diff --git a/components/bt/controller/lib_esp32c3_family b/components/bt/controller/lib_esp32c3_family index 4dd1838c81..976ca00e43 160000 --- a/components/bt/controller/lib_esp32c3_family +++ b/components/bt/controller/lib_esp32c3_family @@ -1 +1 @@ -Subproject commit 4dd1838c81fc41eab863e284a53f029faab5372d +Subproject commit 976ca00e43905df9e910b400a9e17c311b085ce2 diff --git a/components/bt/include/esp32c3/include/esp_bt.h b/components/bt/include/esp32c3/include/esp_bt.h index be9de3d88b..b1608d841e 100644 --- a/components/bt/include/esp32c3/include/esp_bt.h +++ b/components/bt/include/esp32c3/include/esp_bt.h @@ -18,7 +18,7 @@ extern "C" { #endif #define ESP_BT_CTRL_CONFIG_MAGIC_VAL 0x5A5AA5A5 -#define ESP_BT_CTRL_CONFIG_VERSION 0x02112280 +#define ESP_BT_CTRL_CONFIG_VERSION 0x02209230 #define ESP_BT_HCI_TL_MAGIC_VALUE 0xfadebead #define ESP_BT_HCI_TL_VERSION 0x00010000 @@ -141,6 +141,12 @@ typedef void (* esp_bt_hci_tl_callback_t) (void *arg, uint8_t status); #define BT_CTRL_CODED_AGC_RECORRECT 0 #endif +#ifdef CONFIG_BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX +#define BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX CONFIG_BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX +#else +#define BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX 0 +#endif + #define AGC_RECORRECT_EN ((BT_CTRL_AGC_RECORRECT_EN << 0) | (BT_CTRL_CODED_AGC_RECORRECT <<1)) @@ -181,6 +187,7 @@ typedef void (* esp_bt_hci_tl_callback_t) (void *arg, uint8_t status); .slave_ce_len_min = SLAVE_CE_LEN_MIN_DEFAULT, \ .hw_recorrect_en = AGC_RECORRECT_EN, \ .cca_thresh = CONFIG_BT_CTRL_HW_CCA_VAL, \ + .scan_backoff_upperlimitmax = BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX, \ } #else @@ -248,6 +255,7 @@ typedef struct { uint8_t slave_ce_len_min; uint8_t hw_recorrect_en; uint8_t cca_thresh; /*!< cca threshold*/ + uint16_t scan_backoff_upperlimitmax; /*!< scan backoff upperlimitmax value */ } esp_bt_controller_config_t; /** diff --git a/components/bt/include/esp32s3/include/esp_bt.h b/components/bt/include/esp32s3/include/esp_bt.h index e72e5111b7..b8e6905190 100644 --- a/components/bt/include/esp32s3/include/esp_bt.h +++ b/components/bt/include/esp32s3/include/esp_bt.h @@ -18,7 +18,7 @@ extern "C" { #endif #define ESP_BT_CTRL_CONFIG_MAGIC_VAL 0x5A5AA5A5 -#define ESP_BT_CTRL_CONFIG_VERSION 0x02112280 +#define ESP_BT_CTRL_CONFIG_VERSION 0x02209230 #define ESP_BT_HCI_TL_MAGIC_VALUE 0xfadebead #define ESP_BT_HCI_TL_VERSION 0x00010000 @@ -129,6 +129,12 @@ typedef void (* esp_bt_hci_tl_callback_t) (void *arg, uint8_t status); #define MESH_DUPLICATE_SCAN_CACHE_SIZE 0 #endif +#ifdef CONFIG_BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX +#define BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX CONFIG_BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX +#else +#define BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX 0 +#endif + #ifdef CONFIG_BT_CTRL_AGC_RECORRECT_EN #define BT_CTRL_AGC_RECORRECT_EN CONFIG_BT_CTRL_AGC_RECORRECT_EN #else @@ -180,6 +186,7 @@ typedef void (* esp_bt_hci_tl_callback_t) (void *arg, uint8_t status); .slave_ce_len_min = SLAVE_CE_LEN_MIN_DEFAULT, \ .hw_recorrect_en = AGC_RECORRECT_EN, \ .cca_thresh = CONFIG_BT_CTRL_HW_CCA_VAL, \ + .scan_backoff_upperlimitmax = BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX, \ } #else @@ -247,6 +254,7 @@ typedef struct { uint8_t slave_ce_len_min; /*!< slave minimum ce length*/ uint8_t hw_recorrect_en; uint8_t cca_thresh; /*!< cca threshold*/ + uint16_t scan_backoff_upperlimitmax; /*!< scan backoff upperlimitmax value */ } esp_bt_controller_config_t; /**