diff --git a/components/bt/controller/esp32c2/bt.c b/components/bt/controller/esp32c2/bt.c index bdfdc48ac12..c9b227a5f7a 100644 --- a/components/bt/controller/esp32c2/bt.c +++ b/components/bt/controller/esp32c2/bt.c @@ -749,7 +749,7 @@ void controller_wakeup_cb(void *arg) #if CONFIG_FREERTOS_USE_TICKLESS_IDLE static bool esp_bt_check_wakeup_by_bt(void) { - return (esp_sleep_get_wakeup_causes() & ESP_SLEEP_WAKEUP_BT); + return (esp_sleep_get_wakeup_causes() & BIT(ESP_SLEEP_WAKEUP_BT)); } #endif // CONFIG_FREERTOS_USE_TICKLESS_IDLE diff --git a/components/bt/controller/esp32c6/Kconfig.in b/components/bt/controller/esp32c6/Kconfig.in index 20a58944001..93ba3784542 100644 --- a/components/bt/controller/esp32c6/Kconfig.in +++ b/components/bt/controller/esp32c6/Kconfig.in @@ -915,3 +915,65 @@ endmenu config BT_LE_DTM_ENABLED bool "Enable Direct Test Mode (DTM) feature" default n + +menu "Scheduling Priority Level Config" + choice BT_LE_ADV_SCHED_PRIO_LEVEL + prompt "The Adv scheduling priority level" + default BT_LE_ADV_SCHED_PRIO_LOW_LEVEL + help + The Adv scheduling priority level is used for arbitration when internal scheduling conflicts. + config BT_LE_ADV_SCHED_PRIO_LOW_LEVEL + bool "low priority level" + config BT_LE_ADV_SCHED_PRIO_MID_LEVEL + bool "medium priority level" + config BT_LE_ADV_SCHED_PRIO_HIGH_LEVEL + bool "high priority level" + endchoice + + config BT_LE_DFT_ADV_SCHED_PRIO_LEVEL + int + default 0 if BT_LE_ADV_SCHED_PRIO_LOW_LEVEL + default 1 if BT_LE_ADV_SCHED_PRIO_MID_LEVEL + default 2 if BT_LE_ADV_SCHED_PRIO_HIGH_LEVEL + default 0 + + choice BT_LE_PERIODIC_ADV_SCHED_PRIO_LEVEL + prompt "The Periodic Adv scheduling priority level" + default BT_LE_PERIODIC_ADV_SCHED_PRIO_MID_LEVEL + help + The Periodic Adv scheduling priority level is used for arbitration when internal scheduling conflicts. + config BT_LE_PERIODIC_ADV_SCHED_PRIO_LOW_LEVEL + bool "low priority level" + config BT_LE_PERIODIC_ADV_SCHED_PRIO_MID_LEVEL + bool "medium priority level" + config BT_LE_PERIODIC_ADV_SCHED_PRIO_HIGH_LEVEL + bool "high priority level" + endchoice + + config BT_LE_DFT_PERIODIC_ADV_SCHED_PRIO_LEVEL + int + default 0 if BT_LE_PERIODIC_ADV_SCHED_PRIO_LOW_LEVEL + default 1 if BT_LE_PERIODIC_ADV_SCHED_PRIO_MID_LEVEL + default 2 if BT_LE_PERIODIC_ADV_SCHED_PRIO_HIGH_LEVEL + default 1 + + choice BT_LE_SYNC_SCHED_PRIO_LEVEL + prompt "The Sync scheduling priority level" + default BT_LE_SYNC_SCHED_PRIO_MID_LEVEL + help + The SYNC scheduling priority level is used for arbitration when internal scheduling conflicts. + config BT_LE_SYNC_SCHED_PRIO_LOW_LEVEL + bool "low priority level" + config BT_LE_SYNC_SCHED_PRIO_MID_LEVEL + bool "medium priority level" + config BT_LE_SYNC_SCHED_PRIO_HIGH_LEVEL + bool "high priority level" + endchoice + + config BT_LE_DFT_SYNC_SCHED_PRIO_LEVEL + int + default 0 if BT_LE_SYNC_SCHED_PRIO_LOW_LEVEL + default 1 if BT_LE_SYNC_SCHED_PRIO_MID_LEVEL + default 2 if BT_LE_SYNC_SCHED_PRIO_HIGH_LEVEL + default 1 +endmenu diff --git a/components/bt/controller/esp32c6/bt.c b/components/bt/controller/esp32c6/bt.c index b26d3cbf084..0b7825de344 100644 --- a/components/bt/controller/esp32c6/bt.c +++ b/components/bt/controller/esp32c6/bt.c @@ -796,7 +796,7 @@ IRAM_ATTR void controller_wakeup_cb(void *arg) #if CONFIG_FREERTOS_USE_TICKLESS_IDLE static bool esp_bt_check_wakeup_by_bt(void) { - return (esp_sleep_get_wakeup_causes() & ESP_SLEEP_WAKEUP_BT); + return (esp_sleep_get_wakeup_causes() & BIT(ESP_SLEEP_WAKEUP_BT)); } static esp_err_t sleep_modem_ble_mac_retention_init(void *arg) diff --git a/components/bt/controller/esp32c6/esp_bt_cfg.h b/components/bt/controller/esp32c6/esp_bt_cfg.h index 07a3acdb5eb..2586976c90d 100644 --- a/components/bt/controller/esp32c6/esp_bt_cfg.h +++ b/components/bt/controller/esp32c6/esp_bt_cfg.h @@ -300,6 +300,7 @@ extern "C" { #define RUN_BQB_TEST (0) #define RUN_QA_TEST (0) #define NIMBLE_DISABLE_SCAN_BACKOFF (0) +#define BT_LL_CTRL_PRIO_LVL_CFG ((CONFIG_BT_LE_DFT_SYNC_SCHED_PRIO_LEVEL << 4) | (CONFIG_BT_LE_DFT_PERIODIC_ADV_SCHED_PRIO_LEVEL << 2) | CONFIG_BT_LE_DFT_ADV_SCHED_PRIO_LEVEL) #ifdef __cplusplus } diff --git a/components/bt/controller/esp32h2/Kconfig.in b/components/bt/controller/esp32h2/Kconfig.in index f3ff6a4d238..17a1d9abf2c 100644 --- a/components/bt/controller/esp32h2/Kconfig.in +++ b/components/bt/controller/esp32h2/Kconfig.in @@ -919,3 +919,65 @@ endmenu config BT_LE_DTM_ENABLED bool "Enable Direct Test Mode (DTM) feature" default n + +menu "Scheduling Priority Level Config" + choice BT_LE_ADV_SCHED_PRIO_LEVEL + prompt "The Adv scheduling priority level" + default BT_LE_ADV_SCHED_PRIO_LOW_LEVEL + help + The Adv scheduling priority level is used for arbitration when internal scheduling conflicts. + config BT_LE_ADV_SCHED_PRIO_LOW_LEVEL + bool "low priority level" + config BT_LE_ADV_SCHED_PRIO_MID_LEVEL + bool "medium priority level" + config BT_LE_ADV_SCHED_PRIO_HIGH_LEVEL + bool "high priority level" + endchoice + + config BT_LE_DFT_ADV_SCHED_PRIO_LEVEL + int + default 0 if BT_LE_ADV_SCHED_PRIO_LOW_LEVEL + default 1 if BT_LE_ADV_SCHED_PRIO_MID_LEVEL + default 2 if BT_LE_ADV_SCHED_PRIO_HIGH_LEVEL + default 0 + + choice BT_LE_PERIODIC_ADV_SCHED_PRIO_LEVEL + prompt "The Periodic Adv scheduling priority level" + default BT_LE_PERIODIC_ADV_SCHED_PRIO_MID_LEVEL + help + The Periodic Adv scheduling priority level is used for arbitration when internal scheduling conflicts. + config BT_LE_PERIODIC_ADV_SCHED_PRIO_LOW_LEVEL + bool "low priority level" + config BT_LE_PERIODIC_ADV_SCHED_PRIO_MID_LEVEL + bool "medium priority level" + config BT_LE_PERIODIC_ADV_SCHED_PRIO_HIGH_LEVEL + bool "high priority level" + endchoice + + config BT_LE_DFT_PERIODIC_ADV_SCHED_PRIO_LEVEL + int + default 0 if BT_LE_PERIODIC_ADV_SCHED_PRIO_LOW_LEVEL + default 1 if BT_LE_PERIODIC_ADV_SCHED_PRIO_MID_LEVEL + default 2 if BT_LE_PERIODIC_ADV_SCHED_PRIO_HIGH_LEVEL + default 1 + + choice BT_LE_SYNC_SCHED_PRIO_LEVEL + prompt "The Sync scheduling priority level" + default BT_LE_SYNC_SCHED_PRIO_MID_LEVEL + help + The SYNC scheduling priority level is used for arbitration when internal scheduling conflicts. + config BT_LE_SYNC_SCHED_PRIO_LOW_LEVEL + bool "low priority level" + config BT_LE_SYNC_SCHED_PRIO_MID_LEVEL + bool "medium priority level" + config BT_LE_SYNC_SCHED_PRIO_HIGH_LEVEL + bool "high priority level" + endchoice + + config BT_LE_DFT_SYNC_SCHED_PRIO_LEVEL + int + default 0 if BT_LE_SYNC_SCHED_PRIO_LOW_LEVEL + default 1 if BT_LE_SYNC_SCHED_PRIO_MID_LEVEL + default 2 if BT_LE_SYNC_SCHED_PRIO_HIGH_LEVEL + default 1 +endmenu diff --git a/components/bt/controller/esp32h2/bt.c b/components/bt/controller/esp32h2/bt.c index b23c018d8d0..4daa9d3fbeb 100644 --- a/components/bt/controller/esp32h2/bt.c +++ b/components/bt/controller/esp32h2/bt.c @@ -764,7 +764,7 @@ IRAM_ATTR void controller_wakeup_cb(void *arg) #ifdef CONFIG_FREERTOS_USE_TICKLESS_IDLE static bool esp_bt_check_wakeup_by_bt(void) { - return (esp_sleep_get_wakeup_causes() & ESP_SLEEP_WAKEUP_BT); + return (esp_sleep_get_wakeup_causes() & BIT(ESP_SLEEP_WAKEUP_BT)); } static esp_err_t sleep_modem_ble_mac_retention_init(void *arg) diff --git a/components/bt/controller/esp32h2/esp_bt_cfg.h b/components/bt/controller/esp32h2/esp_bt_cfg.h index 4734737c5a4..e79eb742e2d 100644 --- a/components/bt/controller/esp32h2/esp_bt_cfg.h +++ b/components/bt/controller/esp32h2/esp_bt_cfg.h @@ -297,7 +297,7 @@ extern "C" { #define RUN_BQB_TEST (0) #define RUN_QA_TEST (0) #define NIMBLE_DISABLE_SCAN_BACKOFF (0) - +#define BT_LL_CTRL_PRIO_LVL_CFG ((CONFIG_BT_LE_DFT_SYNC_SCHED_PRIO_LEVEL << 4) | (CONFIG_BT_LE_DFT_PERIODIC_ADV_SCHED_PRIO_LEVEL << 2) | CONFIG_BT_LE_DFT_ADV_SCHED_PRIO_LEVEL) #ifdef __cplusplus } #endif diff --git a/components/bt/controller/lib_esp32c2/esp32c2-bt-lib b/components/bt/controller/lib_esp32c2/esp32c2-bt-lib index 7778b43e355..c82c623de45 160000 --- a/components/bt/controller/lib_esp32c2/esp32c2-bt-lib +++ b/components/bt/controller/lib_esp32c2/esp32c2-bt-lib @@ -1 +1 @@ -Subproject commit 7778b43e35501ed4bf945dce37b15278a0724b5c +Subproject commit c82c623de457e1b06cf0dad5c963d023dbb6fe76 diff --git a/components/bt/controller/lib_esp32c6/esp32c6-bt-lib b/components/bt/controller/lib_esp32c6/esp32c6-bt-lib index bd5914cd7da..1495595b82f 160000 --- a/components/bt/controller/lib_esp32c6/esp32c6-bt-lib +++ b/components/bt/controller/lib_esp32c6/esp32c6-bt-lib @@ -1 +1 @@ -Subproject commit bd5914cd7da1b178e60f899d2acc14a9d3df6f2c +Subproject commit 1495595b82f5423d12b325960ae89bc604ebdcd4 diff --git a/components/bt/controller/lib_esp32h2/esp32h2-bt-lib b/components/bt/controller/lib_esp32h2/esp32h2-bt-lib index 3874210bfea..9cfbeb5f163 160000 --- a/components/bt/controller/lib_esp32h2/esp32h2-bt-lib +++ b/components/bt/controller/lib_esp32h2/esp32h2-bt-lib @@ -1 +1 @@ -Subproject commit 3874210bfea2a49a8c29d5102a6ae1ecb9fdfbce +Subproject commit 9cfbeb5f163788174073da19b3cd09c4d00cc860 diff --git a/components/bt/include/esp32c6/include/esp_bt.h b/components/bt/include/esp32c6/include/esp_bt.h index d3c67ad01a5..7181be6e43e 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 0x20250606 +#define CONFIG_VERSION 0x20251022 #define CONFIG_MAGIC 0x5A5AA5A5 /** @@ -234,6 +234,7 @@ typedef struct { 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 */ + uint8_t priority_level_cfg; /*!< The option for priority level configuration */ uint32_t config_magic; /*!< Magic number for configuration validation */ } esp_bt_controller_config_t; @@ -298,6 +299,7 @@ typedef struct { .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, \ + .priority_level_cfg = BT_LL_CTRL_PRIO_LVL_CFG, \ .config_magic = CONFIG_MAGIC, \ } #elif CONFIG_IDF_TARGET_ESP32C61 @@ -359,6 +361,7 @@ typedef struct { .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, \ + .priority_level_cfg = BT_LL_CTRL_PRIO_LVL_CFG, \ .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 601f5816a37..b6bb5bfb23b 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 0x20250606 +#define CONFIG_VERSION 0x20251022 #define CONFIG_MAGIC 0x5A5AA5A5 /** @@ -236,6 +236,7 @@ typedef struct { 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 */ + uint8_t priority_level_cfg; /*!< The option for priority level configuration */ uint32_t config_magic; /*!< Configuration magic value */ } esp_bt_controller_config_t; @@ -298,6 +299,7 @@ typedef struct { .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, \ + .priority_level_cfg = BT_LL_CTRL_PRIO_LVL_CFG, \ .config_magic = CONFIG_MAGIC, \ } diff --git a/components/esp_rom/esp32c2/ld/esp32c2.rom.ble-eco4.ld b/components/esp_rom/esp32c2/ld/esp32c2.rom.ble-eco4.ld index 59bd96d5c56..a76958638a7 100644 --- a/components/esp_rom/esp32c2/ld/esp32c2.rom.ble-eco4.ld +++ b/components/esp_rom/esp32c2/ld/esp32c2.rom.ble-eco4.ld @@ -661,7 +661,7 @@ r_ble_lll_adv_sync_tx_start_cb = 0x400014a8; r_ble_lll_adv_tx_done = 0x400014ac; r_ble_lll_adv_tx_start_cb = 0x400014b0; r_ble_lll_adv_update_rsp_offset = 0x400014b4; -r_ble_lll_aux_scan_cb = 0x400014b8; +//r_ble_lll_aux_scan_cb = 0x400014b8; r_ble_lll_aux_scan_drop = 0x400014bc; r_ble_lll_aux_scan_drop_event_cb = 0x400014c0; r_ble_lll_calc_us_convert_tick_unit = 0x400014c4; @@ -773,7 +773,7 @@ r_ble_lll_rfmgmt_release_ev = 0x40001668; //r_ble_lll_rfmgmt_reset = 0x4000166c; r_ble_lll_rfmgmt_scan_changed = 0x40001670; r_ble_lll_rfmgmt_sched_changed = 0x40001674; -r_ble_lll_rfmgmt_set_sleep_cb = 0x40001678; +//r_ble_lll_rfmgmt_set_sleep_cb = 0x40001678; r_ble_lll_rfmgmt_ticks_to_enabled = 0x4000167c; //r_ble_lll_rfmgmt_timer_exp = 0x40001680; //r_ble_lll_rfmgmt_timer_reschedule = 0x40001684; @@ -825,7 +825,7 @@ r_ble_lll_sched_dtm = 0x40001738; r_ble_lll_sched_env_init = 0x4000173c; r_ble_lll_sched_execute_check = 0x40001740; r_ble_lll_sched_execute_item = 0x40001744; -r_ble_lll_sched_init = 0x40001748; +//r_ble_lll_sched_init = 0x40001748; r_ble_lll_sched_insert_if_empty = 0x4000174c; r_ble_lll_sched_is_overlap = 0x40001750; r_ble_lll_sched_master_new = 0x40001754; @@ -904,7 +904,7 @@ r_ble_phy_sequence_is_running = 0x40001874; r_ble_phy_sequence_is_waiting_rsp = 0x40001878; r_ble_phy_sequence_single_end = 0x4000187c; r_ble_phy_sequence_tx_end_invoke = 0x40001880; -r_ble_phy_sequence_update_conn_ind_params = 0x40001884; +//r_ble_phy_sequence_update_conn_ind_params = 0x40001884; r_ble_phy_set_adv_mode = 0x40001888; r_ble_phy_set_coex_pti = 0x4000188c; r_ble_phy_set_conn_ind_pdu = 0x40001890; diff --git a/components/esp_rom/esp32c2/ld/esp32c2.rom.ble.ld b/components/esp_rom/esp32c2/ld/esp32c2.rom.ble.ld index a0d2795b4d6..90154f4b0eb 100644 --- a/components/esp_rom/esp32c2/ld/esp32c2.rom.ble.ld +++ b/components/esp_rom/esp32c2/ld/esp32c2.rom.ble.ld @@ -533,7 +533,7 @@ r_ble_lll_adv_sync_tx_start_cb = 0x400014a8; r_ble_lll_adv_tx_done = 0x400014ac; r_ble_lll_adv_tx_start_cb = 0x400014b0; r_ble_lll_adv_update_rsp_offset = 0x400014b4; -r_ble_lll_aux_scan_cb = 0x400014b8; +//r_ble_lll_aux_scan_cb = 0x400014b8; r_ble_lll_aux_scan_drop = 0x400014bc; r_ble_lll_aux_scan_drop_event_cb = 0x400014c0; r_ble_lll_calc_us_convert_tick_unit = 0x400014c4; @@ -613,7 +613,7 @@ r_ble_lll_per_adv_coex_dpc_update_on_start = 0x40001640; //r_ble_lll_rfmgmt_release = 0x40001664; r_ble_lll_rfmgmt_scan_changed = 0x40001670; r_ble_lll_rfmgmt_sched_changed = 0x40001674; -r_ble_lll_rfmgmt_set_sleep_cb = 0x40001678; +//r_ble_lll_rfmgmt_set_sleep_cb = 0x40001678; r_ble_lll_rfmgmt_ticks_to_enabled = 0x4000167c; r_ble_lll_rx_pdu_in = 0x40001688; r_ble_lll_rx_pkt_in = 0x4000168c; @@ -715,7 +715,7 @@ r_ble_phy_sequence_is_running = 0x40001874; r_ble_phy_sequence_is_waiting_rsp = 0x40001878; r_ble_phy_sequence_single_end = 0x4000187c; r_ble_phy_sequence_tx_end_invoke = 0x40001880; -r_ble_phy_sequence_update_conn_ind_params = 0x40001884; +//r_ble_phy_sequence_update_conn_ind_params = 0x40001884; r_ble_phy_set_coex_pti = 0x4000188c; r_ble_phy_set_conn_ind_pdu = 0x40001890; r_ble_phy_set_dev_address = 0x40001898;