From 52909b69b793844708d7f81e639b79c1c57a6fef Mon Sep 17 00:00:00 2001 From: zwj Date: Fri, 5 Feb 2021 19:22:37 +0800 Subject: [PATCH 1/3] fix esp32c3 can't enable adv flow control func --- .../include/common/bluedroid_user_config.h | 27 +++++++++++++++++++ .../bt/include/esp32c3/include/esp_bt.h | 4 +-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/components/bt/host/bluedroid/common/include/common/bluedroid_user_config.h b/components/bt/host/bluedroid/common/include/common/bluedroid_user_config.h index f2c49d771d..62d474fc6d 100644 --- a/components/bt/host/bluedroid/common/include/common/bluedroid_user_config.h +++ b/components/bt/host/bluedroid/common/include/common/bluedroid_user_config.h @@ -148,6 +148,7 @@ #define UC_BT_SMP_SLAVE_CON_PARAMS_UPD_ENABLE FALSE #endif +#if CONFIG_BT_CTRL_ESP32 //BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP #ifdef CONFIG_BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP #define UC_BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP CONFIG_BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP @@ -169,6 +170,32 @@ #define UC_BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD 20 #endif +#endif //CONFIG_BT_CTRL_ESP32 + +#if (CONFIG_BT_CTRL_ESP32C3 || CONFIG_BT_CTRL_ESP32S3) +//BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP +#ifdef CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP +#define UC_BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP +#else +#define UC_BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP FALSE +#endif + +//SMP_SLAVE_CON_PARAMS_UPD_ENABLE +#ifdef CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM +#define UC_BTDM_BLE_ADV_REPORT_FLOW_CTRL_NUM CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM +#else +#define UC_BTDM_BLE_ADV_REPORT_FLOW_CTRL_NUM 100 +#endif + +//BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP +#ifdef CONFIG_BT_CTRL_BLE_ADV_REPORT_DISCARD_THRSHOLD +#define UC_BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD CONFIG_BT_CTRL_BLE_ADV_REPORT_DISCARD_THRSHOLD +#else +#define UC_BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD 20 +#endif + +#endif //(CONFIG_BT_CTRL_ESP32C3 || CONFIG_BT_CTRL_ESP32S3) + //BT ACL CONNECTIONS #ifdef CONFIG_BT_ACL_CONNECTIONS #define UC_BT_ACL_CONNECTIONS CONFIG_BT_ACL_CONNECTIONS diff --git a/components/bt/include/esp32c3/include/esp_bt.h b/components/bt/include/esp32c3/include/esp_bt.h index 3276283407..b0f80ce1ce 100644 --- a/components/bt/include/esp32c3/include/esp_bt.h +++ b/components/bt/include/esp32c3/include/esp_bt.h @@ -104,8 +104,8 @@ enum { #endif /* normal adv cache size */ -#ifdef CONFIG_BT_SCAN_DUPL_CACHE_SIZE -#define NORMAL_SCAN_DUPLICATE_CACHE_SIZE CONFIG_BT_SCAN_DUPL_CACHE_SIZE +#ifdef CONFIG_BT_CTRL_SCAN_DUPL_CACHE_SIZE +#define NORMAL_SCAN_DUPLICATE_CACHE_SIZE CONFIG_BT_CTRL_SCAN_DUPL_CACHE_SIZE #else #define NORMAL_SCAN_DUPLICATE_CACHE_SIZE 20 #endif From 44dd496bea0b11470d53dc31edf74ed403a7d94a Mon Sep 17 00:00:00 2001 From: wangmengyang Date: Mon, 8 Feb 2021 21:19:59 +0800 Subject: [PATCH 2/3] update esp32c3 btbb lib 21-02-08 and set coexist state when in scan(initiating) mode --- components/bt/controller/lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/bt/controller/lib b/components/bt/controller/lib index 77eb1e9166..072dc4370b 160000 --- a/components/bt/controller/lib +++ b/components/bt/controller/lib @@ -1 +1 @@ -Subproject commit 77eb1e91662fe4a5e9c783d25c5c9ae208c1af4b +Subproject commit 072dc4370b147e4b37a7e35babc5ab518185432b From b71481093a374a4c35f158a8aa6e897e52eae0d6 Mon Sep 17 00:00:00 2001 From: Xia Xiaotian Date: Sun, 7 Feb 2021 23:01:30 +0800 Subject: [PATCH 3/3] esp_wifi: fix some Wi-Fi scan and coexist bugs 1. Fix the bug that Wi-Fi performance is impacted by BLE starting scan for a while in some scenarios on ESP32-C3. 2. Fix the bug that Wi-Fi performance is impacted when Bluetooth change state for a while in some scenarios on ESP32-C3. 3. Fix the bug that BLE performance is impacted by Wi-Fi scan on ESP32-C3. 4. Fix the bug that Wi-Fi scan fails when BLE is scanning on ESP32-C3. 5. Fix Wi-Fi ACK and CTS rate when low rate is disabled on ESP32-C3. --- components/esp_hw_support/port/esp32c3/regi2c_ctrl.h | 4 ++++ components/esp_hw_support/port/esp32c3/rtc_clk.c | 2 ++ components/esp_rom/esp32c3/ld/esp32c3.rom.ld | 8 ++++---- components/esp_wifi/lib | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/components/esp_hw_support/port/esp32c3/regi2c_ctrl.h b/components/esp_hw_support/port/esp32c3/regi2c_ctrl.h index cec9f76d97..dbca47e01f 100644 --- a/components/esp_hw_support/port/esp32c3/regi2c_ctrl.h +++ b/components/esp_hw_support/port/esp32c3/regi2c_ctrl.h @@ -40,6 +40,10 @@ extern "C" { #endif /* Analog function control register */ +#define I2C_MST_ANA_CONF0_REG 0x6000E040 +#define I2C_MST_BBPLL_STOP_FORCE_HIGH (BIT(2)) +#define I2C_MST_BBPLL_STOP_FORCE_LOW (BIT(3)) + #define ANA_CONFIG_REG 0x6000E044 #define ANA_CONFIG_S (8) #define ANA_CONFIG_M (0x3FF) diff --git a/components/esp_hw_support/port/esp32c3/rtc_clk.c b/components/esp_hw_support/port/esp32c3/rtc_clk.c index d9b193fb9c..93314b7dc6 100644 --- a/components/esp_hw_support/port/esp32c3/rtc_clk.c +++ b/components/esp_hw_support/port/esp32c3/rtc_clk.c @@ -221,6 +221,8 @@ void rtc_clk_bbpll_configure(rtc_xtal_freq_t xtal_freq, int pll_freq) uint8_t dcur; uint8_t dbias; + CLEAR_PERI_REG_MASK(I2C_MST_ANA_CONF0_REG, I2C_MST_BBPLL_STOP_FORCE_HIGH); + SET_PERI_REG_MASK(I2C_MST_ANA_CONF0_REG, I2C_MST_BBPLL_STOP_FORCE_LOW); if (pll_freq == RTC_PLL_FREQ_480M) { /* Set this register to let the digital part know 480M PLL is used */ SET_PERI_REG_MASK(SYSTEM_CPU_PER_CONF_REG, SYSTEM_PLL_FREQ_SEL); diff --git a/components/esp_rom/esp32c3/ld/esp32c3.rom.ld b/components/esp_rom/esp32c3/ld/esp32c3.rom.ld index 0ef0ffd9b4..fa88af2ecb 100644 --- a/components/esp_rom/esp32c3/ld/esp32c3.rom.ld +++ b/components/esp_rom/esp32c3/ld/esp32c3.rom.ld @@ -1818,7 +1818,7 @@ rom_i2c_readReg = 0x40001954; rom_i2c_readReg_Mask = 0x40001958; rom_i2c_writeReg = 0x4000195c; rom_i2c_writeReg_Mask = 0x40001960; -rom_index_to_txbbgain = 0x40001964; +/* rom_index_to_txbbgain = 0x40001964; */ rom_iq_est_disable = 0x40001968; rom_iq_est_enable = 0x4000196c; rom_linear_to_db = 0x40001970; @@ -1853,14 +1853,14 @@ rom_set_chan_cal_interp = 0x400019e0; rom_set_loopback_gain = 0x400019e4; rom_set_noise_floor = 0x400019e8; rom_set_rxclk_en = 0x400019ec; -rom_set_tx_dig_gain = 0x400019f0; +/* rom_set_tx_dig_gain = 0x400019f0; */ /* rom_set_txcap_reg = 0x400019f4; */ rom_set_txclk_en = 0x400019f8; rom_spur_cal = 0x400019fc; rom_spur_reg_write_one_tone = 0x40001a00; rom_target_power_add_backoff = 0x40001a04; rom_tx_pwctrl_bg_init = 0x40001a08; -rom_txbbgain_to_index = 0x40001a0c; +/* rom_txbbgain_to_index = 0x40001a0c; */ rom_wifi_11g_rate_chg = 0x40001a10; rom_write_gain_mem = 0x40001a14; chip726_phyrom_version = 0x40001a18; @@ -1931,4 +1931,4 @@ rom_write_pll_cap_mem = 0x40001b18; rom_pll_correct_dcap = 0x40001b1c; rom_phy_en_hw_set_freq = 0x40001b20; rom_phy_dis_hw_set_freq = 0x40001b24; -rom_pll_vol_cal = 0x40001b28; +/* rom_pll_vol_cal = 0x40001b28; */ diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index c813b4b147..682a6588da 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit c813b4b14704132002d154298384c985c10a2b6d +Subproject commit 682a6588dab0a18ef79630a0f3b59e551be35a43