Skip to content

Commit a9b005b

Browse files
authored
Merge branch 'espressif:release/v5.4' into release/v5.4
2 parents 392802f + 473771b commit a9b005b

File tree

169 files changed

+3143
-1315
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

169 files changed

+3143
-1315
lines changed

components/bt/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ if(CONFIG_BT_ENABLED)
890890
add_prebuilt_library(libble_app
891891
"${CMAKE_CURRENT_LIST_DIR}/controller/lib_esp32c6/esp32c6-bt-lib/esp32c61/libble_app.a")
892892
else()
893-
if(CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY)
893+
if(CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY AND CONFIG_IDF_TARGET_ESP32C2)
894894
add_prebuilt_library(libble_app
895895
"controller/lib_${target_name}/${target_name}-bt-lib/libble_app_flash.a")
896896
else()

components/bt/controller/esp32c2/bt.c

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -1147,9 +1147,17 @@ esp_err_t esp_ble_tx_power_set(esp_ble_power_type_t power_type, esp_power_level_
11471147

11481148
switch (power_type) {
11491149
case ESP_BLE_PWR_TYPE_DEFAULT:
1150+
if (ble_txpwr_set(ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT, 0, power_level) == 0) {
1151+
stat = ESP_OK;
1152+
}
1153+
break;
11501154
case ESP_BLE_PWR_TYPE_ADV:
1155+
if (ble_txpwr_set(ESP_BLE_ENHANCED_PWR_TYPE_ADV, 0xFF, power_level) == 0) {
1156+
stat = ESP_OK;
1157+
}
1158+
break;
11511159
case ESP_BLE_PWR_TYPE_SCAN:
1152-
if (ble_txpwr_set(ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT, 0, power_level) == 0) {
1160+
if (ble_txpwr_set(ESP_BLE_ENHANCED_PWR_TYPE_SCAN, 0, power_level) == 0) {
11531161
stat = ESP_OK;
11541162
}
11551163
break;
@@ -1179,9 +1187,13 @@ esp_err_t esp_ble_tx_power_set_enhanced(esp_ble_enhanced_power_type_t power_type
11791187
esp_err_t stat = ESP_FAIL;
11801188
switch (power_type) {
11811189
case ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT:
1190+
if (ble_txpwr_set(ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT, 0, power_level) == 0) {
1191+
stat = ESP_OK;
1192+
}
1193+
break;
11821194
case ESP_BLE_ENHANCED_PWR_TYPE_SCAN:
11831195
case ESP_BLE_ENHANCED_PWR_TYPE_INIT:
1184-
if (ble_txpwr_set(ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT, 0, power_level) == 0) {
1196+
if (ble_txpwr_set(ESP_BLE_ENHANCED_PWR_TYPE_SCAN, 0, power_level) == 0) {
11851197
stat = ESP_OK;
11861198
}
11871199
break;
@@ -1204,11 +1216,15 @@ esp_power_level_t esp_ble_tx_power_get(esp_ble_power_type_t power_type)
12041216
int tx_level = 0;
12051217

12061218
switch (power_type) {
1207-
case ESP_BLE_PWR_TYPE_ADV:
1208-
case ESP_BLE_PWR_TYPE_SCAN:
12091219
case ESP_BLE_PWR_TYPE_DEFAULT:
12101220
tx_level = ble_txpwr_get(ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT, 0);
12111221
break;
1222+
case ESP_BLE_PWR_TYPE_ADV:
1223+
tx_level = ble_txpwr_get(ESP_BLE_ENHANCED_PWR_TYPE_ADV, 0);
1224+
break;
1225+
case ESP_BLE_PWR_TYPE_SCAN:
1226+
tx_level = ble_txpwr_get(ESP_BLE_ENHANCED_PWR_TYPE_SCAN, 0);
1227+
break;
12121228
case ESP_BLE_PWR_TYPE_CONN_HDL0:
12131229
case ESP_BLE_PWR_TYPE_CONN_HDL1:
12141230
case ESP_BLE_PWR_TYPE_CONN_HDL2:
@@ -1237,9 +1253,11 @@ esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t po
12371253

12381254
switch (power_type) {
12391255
case ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT:
1256+
tx_level = ble_txpwr_get(ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT, 0);
1257+
break;
12401258
case ESP_BLE_ENHANCED_PWR_TYPE_SCAN:
12411259
case ESP_BLE_ENHANCED_PWR_TYPE_INIT:
1242-
tx_level = ble_txpwr_get(ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT, 0);
1260+
tx_level = ble_txpwr_get(ESP_BLE_ENHANCED_PWR_TYPE_SCAN, 0);
12431261
break;
12441262
case ESP_BLE_ENHANCED_PWR_TYPE_ADV:
12451263
case ESP_BLE_ENHANCED_PWR_TYPE_CONN:

components/bt/controller/esp32c5/Kconfig.in

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,24 @@ config BT_LE_CONTROLLER_LOG_DUMP_ONLY
310310
help
311311
Only operate in dump mode
312312

313+
config BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
314+
bool "Store ble controller logs to flash(Experimental)"
315+
depends on !BT_LE_CONTROLLER_LOG_DUMP_ONLY
316+
depends on BT_LE_CONTROLLER_LOG_ENABLED
317+
default n
318+
help
319+
Store ble controller logs to flash memory.
320+
321+
config BT_LE_CONTROLLER_LOG_PARTITION_SIZE
322+
int "size of ble controller log partition(Multiples of 4K)"
323+
depends on BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
324+
default 65536
325+
help
326+
The size of ble controller log partition shall be a multiples of 4K.
327+
The name of log partition shall be "bt_ctrl_log".
328+
The partition type shall be ESP_PARTITION_TYPE_DATA.
329+
The partition sub_type shall be ESP_PARTITION_SUBTYPE_ANY.
330+
313331
config BT_LE_LOG_CTRL_BUF1_SIZE
314332
int "size of the first BLE controller LOG buffer"
315333
depends on BT_LE_CONTROLLER_LOG_ENABLED
@@ -575,3 +593,89 @@ config BT_LE_SCAN_DUPL_CACHE_REFRESH_PERIOD
575593
config BT_LE_MSYS_INIT_IN_CONTROLLER
576594
bool "Msys Mbuf Init in Controller"
577595
default y
596+
597+
config BT_LE_TX_CCA_ENABLED
598+
bool "Enable TX CCA feature"
599+
default n
600+
help
601+
Enable CCA feature to cancel sending the packet if the signal power is stronger than CCA threshold.
602+
603+
config BT_LE_CCA_RSSI_THRESH
604+
int "CCA RSSI threshold value"
605+
depends on BT_LE_TX_CCA_ENABLED
606+
range 20 100
607+
default 20
608+
help
609+
Power threshold of CCA in unit of -1 dBm.
610+
611+
choice BT_LE_DFT_TX_POWER_LEVEL_DBM
612+
prompt "BLE default Tx power level(dBm)"
613+
default BT_LE_DFT_TX_POWER_LEVEL_P9
614+
help
615+
Specify default Tx power level(dBm).
616+
config BT_LE_DFT_TX_POWER_LEVEL_N24
617+
bool "-24dBm"
618+
config BT_LE_DFT_TX_POWER_LEVEL_N21
619+
bool "-21dBm"
620+
config BT_LE_DFT_TX_POWER_LEVEL_N18
621+
bool "-18dBm"
622+
config BT_LE_DFT_TX_POWER_LEVEL_N15
623+
bool "-15dBm"
624+
config BT_LE_DFT_TX_POWER_LEVEL_N12
625+
bool "-12dBm"
626+
config BT_LE_DFT_TX_POWER_LEVEL_N9
627+
bool "-9dBm"
628+
config BT_LE_DFT_TX_POWER_LEVEL_N6
629+
bool "-6dBm"
630+
config BT_LE_DFT_TX_POWER_LEVEL_N3
631+
bool "-3dBm"
632+
config BT_LE_DFT_TX_POWER_LEVEL_N0
633+
bool "0dBm"
634+
config BT_LE_DFT_TX_POWER_LEVEL_P3
635+
bool "+3dBm"
636+
config BT_LE_DFT_TX_POWER_LEVEL_P6
637+
bool "+6dBm"
638+
config BT_LE_DFT_TX_POWER_LEVEL_P9
639+
bool "+9dBm"
640+
config BT_LE_DFT_TX_POWER_LEVEL_P12
641+
bool "+12dBm"
642+
config BT_LE_DFT_TX_POWER_LEVEL_P15
643+
bool "+15dBm"
644+
config BT_LE_DFT_TX_POWER_LEVEL_P18
645+
bool "+18dBm"
646+
config BT_LE_DFT_TX_POWER_LEVEL_P20
647+
bool "+20dBm"
648+
endchoice
649+
650+
config BT_LE_DFT_TX_POWER_LEVEL_DBM_EFF
651+
int
652+
default -15 if BT_LE_DFT_TX_POWER_LEVEL_N15
653+
default -12 if BT_LE_DFT_TX_POWER_LEVEL_N12
654+
default -9 if BT_LE_DFT_TX_POWER_LEVEL_N9
655+
default -6 if BT_LE_DFT_TX_POWER_LEVEL_N6
656+
default -3 if BT_LE_DFT_TX_POWER_LEVEL_N3
657+
default 0 if BT_LE_DFT_TX_POWER_LEVEL_N0
658+
default 3 if BT_LE_DFT_TX_POWER_LEVEL_P3
659+
default 6 if BT_LE_DFT_TX_POWER_LEVEL_P6
660+
default 9 if BT_LE_DFT_TX_POWER_LEVEL_P9
661+
default 12 if BT_LE_DFT_TX_POWER_LEVEL_P12
662+
default 15 if BT_LE_DFT_TX_POWER_LEVEL_P15
663+
default 18 if BT_LE_DFT_TX_POWER_LEVEL_P18
664+
default 20 if BT_LE_DFT_TX_POWER_LEVEL_P20
665+
default 0
666+
667+
config BT_LE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS
668+
bool "Enable enhanced Access Address check in CONNECT_IND"
669+
default n
670+
help
671+
Enabling this option will add stricter verification of the Access Address in the CONNECT_IND PDU.
672+
This improves security by ensuring that only connection requests with valid Access Addresses are accepted.
673+
If disabled, only basic checks are applied, improving compatibility.
674+
675+
config BT_CTRL_RUN_IN_FLASH_ONLY
676+
bool "Reduce BLE IRAM usage (READ DOCS FIRST) (EXPERIMENTAL)"
677+
default n
678+
help
679+
Move most IRAM into flash. This will increase the usage of flash and reduce ble performance.
680+
Because the code is moved to the flash, the execution speed of the code is reduced.
681+
To have a small impact on performance, you need to enable flash suspend (SPI_FLASH_AUTO_SUSPEND).

0 commit comments

Comments
 (0)