Merge branch 'bugfix/ble_update_lib_20231229_v5.2' into 'release/v5.2'

update lib on release/v5.2

See merge request espressif/esp-idf!28189
release/v5.2
Island 2024-01-22 10:37:49 +08:00
commit c54555bb01
16 zmienionych plików z 55 dodań i 93 usunięć

Wyświetl plik

@ -464,23 +464,3 @@ config BT_CTRL_BLE_ADV_REPORT_DISCARD_THRSHOLD
config BT_LE_RELEASE_IRAM_SUPPORTED
bool
default y
config BT_LE_TX_CCA_ENABLED
bool "BLE enable TX CCA feature"
default n
help
Enable the BLE (Bluetooth Low Energy) LBT (Listen Before Talk) function. Before transmitting a packet,
monitor the in-band CCA (Clear Channel Assessment). If the airborne carrier energy is too high, abandon
the packet transmission. Enabling this feature may potentially decrease BLE performance. In certain
countries and regions, when the maximum transmission power exceeds a certain limit, support for LBT
interference avoidance mechanisms is required. If the maximum transmission power does not reach the limit,
it may not be necessary to enable this function.
Please refer to the relevant certification regulations for details.
config BT_LE_CCA_RSSI_THRESH
int "Power threshold to refrain packet transmission in unit of -1 dBm"
depends on BT_LE_TX_CCA_ENABLED
range 1 100
default 75
help
If a carrier signal above the threshold is detected in the air, refrain from packet transmission.

Wyświetl plik

@ -1019,7 +1019,7 @@ void esp_ble_controller_log_dump_all(bool output)
esp_panic_handler_reconfigure_wdts(5000);
BT_ASSERT_PRINT("\r\n[DUMP_START:");
ble_log_async_output_dump_all(output);
BT_ASSERT_PRINT("]\r\n");
BT_ASSERT_PRINT(":DUMP_END]\r\n");
portEXIT_CRITICAL_SAFE(&spinlock);
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED

Wyświetl plik

@ -382,7 +382,7 @@ config BT_LE_WHITELIST_SIZE
config BT_LE_LL_DUP_SCAN_LIST_COUNT
int "BLE duplicate scan list count"
range 1 100
range 5 100
default 20
help
config the max count of duplicate scan list
@ -543,15 +543,6 @@ config BT_LE_SCAN_DUPL_TYPE
default 2 if BT_LE_SCAN_DUPL_TYPE_DATA_DEVICE
default 0
config BT_LE_SCAN_DUPL_CACHE_SIZE
int "Maximum number of devices in scan duplicate filter"
depends on BT_LE_SCAN_DUPL
range 10 1000
default 100
help
Maximum number of devices which can be recorded in scan duplicate filter.
When the maximum amount of device in the filter is reached, the cache will be refreshed.
config BT_LE_SCAN_DUPL_CACHE_REFRESH_PERIOD
int "Duplicate scan list refresh period (seconds)"
depends on BT_LE_SCAN_DUPL
@ -571,23 +562,3 @@ config BT_LE_SCAN_DUPL_CACHE_REFRESH_PERIOD
config BT_LE_MSYS_INIT_IN_CONTROLLER
bool "Msys Mbuf Init in Controller"
default y
config BT_LE_TX_CCA_ENABLED
bool "BLE enable TX CCA feature"
default n
help
Enable the BLE (Bluetooth Low Energy) LBT (Listen Before Talk) function. Before transmitting a packet,
monitor the in-band CCA (Clear Channel Assessment). If the airborne carrier energy is too high, abandon
the packet transmission. Enabling this feature may potentially decrease BLE performance. In certain
countries and regions, when the maximum transmission power exceeds a certain limit, support for LBT
interference avoidance mechanisms is required. If the maximum transmission power does not reach the limit,
it may not be necessary to enable this function.
Please refer to the relevant certification regulations for details.
config BT_LE_CCA_RSSI_THRESH
int "Power threshold to refrain packet transmission in unit of -1 dBm"
depends on BT_LE_TX_CCA_ENABLED
range 1 100
default 75
help
If a carrier signal above the threshold is detected in the air, refrain from packet transmission.

Wyświetl plik

@ -665,7 +665,7 @@ void ble_controller_scan_duplicate_config(void)
uint32_t duplicate_mode = FILTER_DUPLICATE_DEFAULT;
uint32_t cache_size = 100;
#if CONFIG_BT_LE_SCAN_DUPL == true
cache_size = CONFIG_BT_LE_SCAN_DUPL_CACHE_SIZE;
cache_size = CONFIG_BT_LE_LL_DUP_SCAN_LIST_COUNT;
if (CONFIG_BT_LE_SCAN_DUPL_TYPE == 0) {
duplicate_mode = FILTER_DUPLICATE_ADDRESS | FILTER_DUPLICATE_PDUTYPE;
} else if (CONFIG_BT_LE_SCAN_DUPL_TYPE == 1) {
@ -911,9 +911,9 @@ esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode)
esp_pm_lock_acquire(s_pm_lock);
#endif // CONFIG_PM_ENABLE
esp_phy_enable(PHY_MODEM_BT);
esp_btbb_enable();
s_ble_active = true;
}
esp_btbb_enable();
#if CONFIG_SW_COEXIST_ENABLE
coex_enable();
#endif // CONFIG_SW_COEXIST_ENABLE
@ -929,8 +929,8 @@ error:
#if CONFIG_SW_COEXIST_ENABLE
coex_disable();
#endif
esp_btbb_disable();
if (s_ble_active) {
esp_btbb_disable();
esp_phy_disable(PHY_MODEM_BT);
#if CONFIG_PM_ENABLE
esp_pm_lock_release(s_pm_lock);
@ -952,8 +952,8 @@ esp_err_t esp_bt_controller_disable(void)
#if CONFIG_SW_COEXIST_ENABLE
coex_disable();
#endif
esp_btbb_disable();
if (s_ble_active) {
esp_btbb_disable();
esp_phy_disable(PHY_MODEM_BT);
#if CONFIG_PM_ENABLE
esp_pm_lock_release(s_pm_lock);
@ -1192,7 +1192,7 @@ void esp_ble_controller_log_dump_all(bool output)
esp_panic_handler_reconfigure_wdts(5000);
BT_ASSERT_PRINT("\r\n[DUMP_START:");
ble_log_async_output_dump_all(output);
BT_ASSERT_PRINT("]\r\n");
BT_ASSERT_PRINT(":DUMP_END]\r\n");
portEXIT_CRITICAL_SAFE(&spinlock);
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED

Wyświetl plik

@ -373,7 +373,7 @@ config BT_LE_WHITELIST_SIZE
config BT_LE_LL_DUP_SCAN_LIST_COUNT
int "BLE duplicate scan list count"
range 1 100
range 5 100
default 20
help
config the max count of duplicate scan list
@ -535,16 +535,6 @@ config BT_LE_SCAN_DUPL_TYPE
default 2 if BT_LE_SCAN_DUPL_TYPE_DATA_DEVICE
default 0
config BT_LE_SCAN_DUPL_CACHE_SIZE
int "Maximum number of devices in scan duplicate filter"
depends on BT_LE_SCAN_DUPL
range 10 1000
default 100
help
Maximum number of devices which can be recorded in scan duplicate filter.
When the maximum amount of device in the filter is reached, the cache will be refreshed.
config BT_LE_SCAN_DUPL_CACHE_REFRESH_PERIOD
int "Duplicate scan list refresh period (seconds)"
depends on BT_LE_SCAN_DUPL
@ -564,23 +554,3 @@ config BT_LE_SCAN_DUPL_CACHE_REFRESH_PERIOD
config BT_LE_MSYS_INIT_IN_CONTROLLER
bool
default y
config BT_LE_TX_CCA_ENABLED
bool "BLE enable TX CCA feature"
default n
help
Enable the BLE (Bluetooth Low Energy) LBT (Listen Before Talk) function. Before transmitting a packet,
monitor the in-band CCA (Clear Channel Assessment). If the airborne carrier energy is too high, abandon
the packet transmission. Enabling this feature may potentially decrease BLE performance. In certain
countries and regions, when the maximum transmission power exceeds a certain limit, support for LBT
interference avoidance mechanisms is required. If the maximum transmission power does not reach the limit,
it may not be necessary to enable this function.
Please refer to the relevant certification regulations for details.
config BT_LE_CCA_RSSI_THRESH
int "Power threshold to refrain packet transmission in unit of -1 dBm"
depends on BT_LE_TX_CCA_ENABLED
range 1 100
default 75
help
If a carrier signal above the threshold is detected in the air, refrain from packet transmission.

Wyświetl plik

@ -640,7 +640,7 @@ void ble_controller_scan_duplicate_config(void)
uint32_t duplicate_mode = FILTER_DUPLICATE_DEFAULT;
uint32_t cache_size = 100;
#if CONFIG_BT_LE_SCAN_DUPL == true
cache_size = CONFIG_BT_LE_SCAN_DUPL_CACHE_SIZE;
cache_size = CONFIG_BT_LE_LL_DUP_SCAN_LIST_COUNT;
if (CONFIG_BT_LE_SCAN_DUPL_TYPE == 0) {
duplicate_mode = FILTER_DUPLICATE_ADDRESS | FILTER_DUPLICATE_PDUTYPE;
} else if (CONFIG_BT_LE_SCAN_DUPL_TYPE == 1) {
@ -1164,7 +1164,7 @@ void esp_ble_controller_log_dump_all(bool output)
esp_panic_handler_reconfigure_wdts(5000);
BT_ASSERT_PRINT("\r\n[DUMP_START:");
ble_log_async_output_dump_all(output);
BT_ASSERT_PRINT("]\r\n");
BT_ASSERT_PRINT(":DUMP_END]\r\n");
portEXIT_CRITICAL_SAFE(&spinlock);
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED

@ -1 +1 @@
Subproject commit 909c8bca55acdcbba1c32620482a7d1a10c28a07
Subproject commit 7f3eb5f5568439cdb32dfe9dbf69d99e9c72e69f

@ -1 +1 @@
Subproject commit c832dbc04d6894a380fe7b92c303602a5241ef16
Subproject commit e4d0d86b6f4fe4233f53e71d7dfa18faa0f19f27

@ -1 +1 @@
Subproject commit 49a90d0ad509a1ec95fcacfc67d578a97de4c1ee
Subproject commit 90793e83195547303e0fd190c890c8bff754d5d3

Wyświetl plik

@ -122,6 +122,7 @@ struct npl_funcs_t {
void (*p_ble_npl_hw_exit_critical)(uint32_t);
uint32_t (*p_ble_npl_get_time_forever)(void);
uint8_t (*p_ble_npl_hw_is_in_critical)(void);
void (*p_ble_npl_eventq_put_to_front)(struct ble_npl_eventq *, struct ble_npl_event *);
};
extern struct npl_funcs_t *npl_funcs;

Wyświetl plik

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: Apache-2.0
*
* SPDX-FileContributor: 2019-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileContributor: 2019-2023 Espressif Systems (Shanghai) CO LTD
*/
#include <assert.h>
@ -37,11 +37,19 @@ static const char *TAG = "Timer";
#error "not defined SOC_ESP_NIMBLE_CONTROLLER or SOC_ESP_NIMBLE_CONTROLLER is zero"
#endif
#if CONFIG_BT_NIMBLE_ENABLED
#define BLE_HOST_CO_COUNT (8)
#define BLE_HOST_EV_COUNT (11 + BLE_HOST_CO_COUNT)
#define BLE_HOST_EVQ_COUNT (3)
#define BLE_HOST_SEM_COUNT (10)
#define BLE_HOST_MUTEX_COUNT (4)
#else
#define BLE_HOST_CO_COUNT (0)
#define BLE_HOST_EV_COUNT (0)
#define BLE_HOST_EVQ_COUNT (0)
#define BLE_HOST_SEM_COUNT (0)
#define BLE_HOST_MUTEX_COUNT (0)
#endif
struct os_mempool ble_freertos_ev_pool;
static os_membuf_t *ble_freertos_ev_buf = NULL;
@ -240,6 +248,32 @@ IRAM_ATTR npl_freertos_eventq_put(struct ble_npl_eventq *evq, struct ble_npl_eve
BLE_LL_ASSERT(ret == pdPASS);
}
void
IRAM_ATTR npl_freertos_eventq_put_to_front(struct ble_npl_eventq *evq, struct ble_npl_event *ev)
{
BaseType_t woken;
BaseType_t ret;
struct ble_npl_eventq_freertos *eventq = (struct ble_npl_eventq_freertos *)evq->eventq;
struct ble_npl_event_freertos *event = (struct ble_npl_event_freertos *)ev->event;
if (event->queued) {
return;
}
event->queued = true;
if (in_isr()) {
ret = xQueueSendToFrontFromISR(eventq->q, &ev, &woken);
if( woken == pdTRUE ) {
portYIELD_FROM_ISR();
}
} else {
ret = xQueueSendToFront(eventq->q, &ev, portMAX_DELAY);
}
BLE_LL_ASSERT(ret == pdPASS);
}
void
IRAM_ATTR npl_freertos_eventq_remove(struct ble_npl_eventq *evq,
struct ble_npl_event *ev)
@ -986,6 +1020,7 @@ const struct npl_funcs_t npl_funcs_ro = {
.p_ble_npl_eventq_deinit = npl_freertos_eventq_deinit,
.p_ble_npl_eventq_get = npl_freertos_eventq_get,
.p_ble_npl_eventq_put = npl_freertos_eventq_put,
.p_ble_npl_eventq_put_to_front = npl_freertos_eventq_put_to_front,
.p_ble_npl_eventq_remove = npl_freertos_eventq_remove,
.p_ble_npl_event_run = npl_freertos_event_run,
.p_ble_npl_eventq_is_empty = npl_freertos_eventq_is_empty,

Wyświetl plik

@ -19,4 +19,5 @@ CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP=y
# Sleep Config
#
CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=y
CONFIG_ESP_SLEEP_CACHE_SAFE_ASSERTION=y
# end of Sleep Config

Wyświetl plik

@ -22,4 +22,5 @@ CONFIG_FREERTOS_USE_TICKLESS_IDLE=y
#
CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=y
CONFIG_ESP_PHY_MAC_BB_PD=y
CONFIG_ESP_SLEEP_CACHE_SAFE_ASSERTION=y
# end of Sleep Config

Wyświetl plik

@ -17,3 +17,4 @@ CONFIG_XTAL_FREQ=26
# Sleep Config
#
CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=y
CONFIG_ESP_SLEEP_CACHE_SAFE_ASSERTION=y

Wyświetl plik

@ -22,6 +22,7 @@ CONFIG_FREERTOS_USE_TICKLESS_IDLE=y
#
CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=y
CONFIG_ESP_PHY_MAC_BB_PD=y
CONFIG_ESP_SLEEP_CACHE_SAFE_ASSERTION=y
# end of Sleep Config
#

Wyświetl plik

@ -19,6 +19,7 @@ CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP=y
# Sleep Config
#
CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=y
CONFIG_ESP_SLEEP_CACHE_SAFE_ASSERTION=y
# end of Sleep Config
#