Skip to content

Commit 241afda

Browse files
committed
Merge branch 'bugfix/fix_ble_controller_only_error_if_hci_uart_enabled' into 'master'
fix(ble/controller): Fixed controller flash only bug if hci-uart is enabled Closes BLERP-1696 and BLERP-1703 See merge request espressif/esp-idf!38001
2 parents 5f3097f + 1354037 commit 241afda

File tree

6 files changed

+30
-12
lines changed

6 files changed

+30
-12
lines changed

components/bt/controller/esp32c3/Kconfig.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ config BT_CTRL_BLE_SCAN
550550
default y
551551

552552
config BT_CTRL_BLE_SECURITY_ENABLE
553-
depends on BT_CTRL_RUN_IN_FLASH_ONLY && BT_CONTROLLER_ONLY
553+
depends on BT_CTRL_RUN_IN_FLASH_ONLY
554554
bool "Enable BLE security feature"
555555
default y
556556

components/bt/host/bluedroid/api/include/api/esp_gap_ble_api.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,6 +1026,13 @@ typedef struct {
10261026
uint16_t sync_handle; /*!< periodic advertising train handle */
10271027
uint8_t tx_power; /*!< periodic advertising tx power*/
10281028
int8_t rssi; /*!< periodic advertising rssi */
1029+
#if (CONFIG_BT_BLE_FEAT_CTE_EN) // #if (BLE_FEAT_CTE_EN == TRUE)
1030+
uint8_t cte_type; /*!< The type of Constant Tone Extension
1031+
0x00: AoA Constant Tone Extension
1032+
0x01: AoD Constant Tone Extension with 1 μs slots
1033+
0x02: AoD Constant Tone Extension with 2 μs slots
1034+
0xFF: No Constant Tone Extension */
1035+
#endif // BT_BLE_FEAT_CTE_EN
10291036
esp_ble_gap_ext_adv_data_status_t data_status; /*!< periodic advertising data type*/
10301037
uint8_t data_length; /*!< periodic advertising data length */
10311038
uint8_t data[251]; /*!< periodic advertising data */

components/bt/host/bluedroid/btc/profile/std/gap/btc_gap_ble.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,8 +1167,14 @@ void btc_ble_5_gap_callback(tBTA_DM_BLE_5_GAP_EVENT event,
11671167
#if (BLE_50_EXTEND_SYNC_EN == TRUE)
11681168
case BTA_DM_BLE_5_GAP_PERIODIC_ADV_REPORT_EVT: {
11691169
msg.act = ESP_GAP_BLE_PERIODIC_ADV_REPORT_EVT;
1170-
memcpy(&param.period_adv_report, &params->period_adv_report,
1171-
sizeof(esp_ble_gap_periodic_adv_report_t));
1170+
param.period_adv_report.params.sync_handle = params->period_adv_report.sync_handle;
1171+
param.period_adv_report.params.tx_power = params->period_adv_report.tx_power;
1172+
param.period_adv_report.params.rssi = params->period_adv_report.rssi;
1173+
#if (BLE_FEAT_CTE_EN == TRUE)
1174+
param.period_adv_report.params.cte_type = params->period_adv_report.cte_type;
1175+
#endif // #if (BLE_FEAT_CTE_EN == TRUE)
1176+
param.period_adv_report.params.data_status = params->period_adv_report.data_status;
1177+
param.period_adv_report.params.data_length = params->period_adv_report.data_length;
11721178
if (params->period_adv_report.data) {
11731179
memcpy(param.period_adv_report.params.data, params->period_adv_report.data,
11741180
params->period_adv_report.data_length);

components/bt/host/bluedroid/stack/btu/btu_hcif.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2578,7 +2578,7 @@ static void btu_ble_periodic_adv_report_evt(UINT8 *p, UINT8 evt_len)
25782578
STREAM_TO_UINT16(adv_report.sync_handle, p);
25792579
STREAM_TO_UINT8(adv_report.tx_power, p);
25802580
STREAM_TO_UINT8(adv_report.rssi, p);
2581-
STREAM_TO_UINT8(unused, p);
2581+
STREAM_TO_UINT8(adv_report.cte_type, p);
25822582
STREAM_TO_UINT8(adv_report.data_status, p);
25832583
STREAM_TO_UINT8(adv_report.data_length, p);
25842584

components/bt/host/bluedroid/stack/include/stack/btm_ble_api.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,6 +1330,7 @@ typedef struct {
13301330
UINT16 sync_handle;
13311331
UINT8 tx_power;
13321332
INT8 rssi;
1333+
UINT8 cte_type;
13331334
tBTM_BLE_EXT_ADV_DATA_STATUS data_status;
13341335
UINT8 data_length;
13351336
UINT8 *data;

components/esp_rom/CMakeLists.txt

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -221,17 +221,19 @@ else() # Regular app build
221221
endif()
222222

223223
elseif(target STREQUAL "esp32c3")
224-
if(CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY)
224+
if(CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY AND NOT CONFIG_BT_CTRL_HCI_MODE_UART_H4)
225225
if(NOT CONFIG_BT_CTRL_BLE_MASTER)
226226
rom_linker_script("ble_master")
227227
endif()
228-
if(NOT CONFIG_BT_NIMBLE_50_FEATURE_SUPPORT AND NOT CONFIG_BT_BLE_50_FEATURES_SUPPORTED)
229-
rom_linker_script("ble_50")
228+
if(NOT CONFIG_BT_CONTROLLER_ONLY)
229+
if(NOT CONFIG_BT_NIMBLE_50_FEATURE_SUPPORT AND NOT CONFIG_BT_BLE_50_FEATURES_SUPPORTED)
230+
rom_linker_script("ble_50")
231+
endif()
230232
endif()
231233
if(CONFIG_BT_BLE_CCA_MODE_NONE)
232234
rom_linker_script("ble_cca")
233235
endif()
234-
if(NOT CONFIG_BT_NIMBLE_SECURITY_ENABLE AND NOT CONFIG_BT_BLE_SMP_ENABLE)
236+
if(NOT CONFIG_BT_CTRL_BLE_SECURITY_ENABLE)
235237
rom_linker_script("ble_smp")
236238
endif()
237239
if(NOT CONFIG_BT_CTRL_DTM_ENABLE)
@@ -259,17 +261,19 @@ else() # Regular app build
259261
endif()
260262
endif()
261263
elseif(target STREQUAL "esp32s3")
262-
if(CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY)
264+
if(CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY AND NOT CONFIG_BT_CTRL_HCI_MODE_UART_H4)
263265
if(NOT CONFIG_BT_CTRL_BLE_MASTER)
264266
rom_linker_script("ble_master")
265267
endif()
266-
if(NOT CONFIG_BT_NIMBLE_50_FEATURE_SUPPORT AND NOT CONFIG_BT_BLE_50_FEATURES_SUPPORTED)
267-
rom_linker_script("ble_50")
268+
if(NOT CONFIG_BT_CONTROLLER_ONLY)
269+
if(NOT CONFIG_BT_NIMBLE_50_FEATURE_SUPPORT AND NOT CONFIG_BT_BLE_50_FEATURES_SUPPORTED)
270+
rom_linker_script("ble_50")
271+
endif()
268272
endif()
269273
if(CONFIG_BT_BLE_CCA_MODE_NONE)
270274
rom_linker_script("ble_cca")
271275
endif()
272-
if(NOT CONFIG_BT_NIMBLE_SECURITY_ENABLE AND NOT CONFIG_BT_BLE_SMP_ENABLE)
276+
if(NOT CONFIG_BT_CTRL_BLE_SECURITY_ENABLE)
273277
rom_linker_script("ble_smp")
274278
endif()
275279
if(NOT CONFIG_BT_CTRL_DTM_ENABLE)

0 commit comments

Comments
 (0)