Skip to content

Commit 6b1d8db

Browse files
committed
Merge branch 'change/ble_update_lib_20250217' into 'master'
change(ble): [AUTO_MR] 20250217 - Update ESP BLE Controller Lib Closes BLERP-1562 See merge request espressif/esp-idf!37025
2 parents 8ad16fd + 3df8f30 commit 6b1d8db

File tree

16 files changed

+766
-252
lines changed

16 files changed

+766
-252
lines changed

components/bt/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ if(CONFIG_BT_ENABLED)
9191
endif()
9292
set(ldscripts "linker_esp32c2.lf")
9393
else()
94+
list(APPEND srcs "controller/${target_name}/ble.c")
9495
list(APPEND ldscripts "linker_esp_ble_controller.lf")
9596
endif()
9697

components/bt/controller/esp32c5/Kconfig.in

Lines changed: 92 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -283,110 +283,120 @@ config BT_LE_CONTROLLER_TASK_STACK_SIZE
283283
help
284284
This configures stack size of NimBLE controller task
285285

286-
menuconfig BT_LE_CONTROLLER_LOG_ENABLED
287-
bool "Controller log enable"
288-
default n
289-
help
290-
Enable controller log
286+
menu "Controller debug features"
287+
menuconfig BT_LE_CONTROLLER_LOG_ENABLED
288+
bool "Controller log enable"
289+
default n
290+
help
291+
Enable controller log
291292

292-
config BT_LE_CONTROLLER_LOG_CTRL_ENABLED
293-
bool "enable controller log module"
294-
depends on BT_LE_CONTROLLER_LOG_ENABLED
295-
default y
296-
help
293+
config BT_LE_CONTROLLER_LOG_CTRL_ENABLED
294+
bool "enable controller log module"
295+
depends on BT_LE_CONTROLLER_LOG_ENABLED
296+
default y
297+
help
297298
Enable controller log module
298299

299-
config BT_LE_CONTROLLER_LOG_HCI_ENABLED
300-
bool "enable HCI log module"
301-
depends on BT_LE_CONTROLLER_LOG_ENABLED
302-
default y
303-
help
300+
config BT_LE_CONTROLLER_LOG_HCI_ENABLED
301+
bool "enable HCI log module"
302+
depends on BT_LE_CONTROLLER_LOG_ENABLED
303+
default y
304+
help
304305
Enable hci log module
305306

306-
config BT_LE_CONTROLLER_LOG_DUMP_ONLY
307-
bool "Controller log dump mode only"
308-
depends on BT_LE_CONTROLLER_LOG_ENABLED
309-
default y
310-
help
307+
config BT_LE_CONTROLLER_LOG_DUMP_ONLY
308+
bool "Controller log dump mode only"
309+
depends on BT_LE_CONTROLLER_LOG_ENABLED
310+
default y
311+
help
311312
Only operate in dump mode
312313

313-
config BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
314-
bool "Output ble controller logs to SPI bus (Experimental)"
315-
depends on BT_LE_CONTROLLER_LOG_ENABLED
316-
depends on !BT_LE_CONTROLLER_LOG_DUMP_ONLY
317-
select BT_BLE_LOG_SPI_OUT_ENABLED
318-
default n
319-
help
320-
Output ble controller logs to SPI bus
314+
config BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
315+
bool "Output ble controller logs to SPI bus (Experimental)"
316+
depends on BT_LE_CONTROLLER_LOG_ENABLED
317+
depends on !BT_LE_CONTROLLER_LOG_DUMP_ONLY
318+
select BT_BLE_LOG_SPI_OUT_ENABLED
319+
default n
320+
help
321+
Output ble controller logs to SPI bus
321322

322-
config BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
323-
bool "Store ble controller logs to flash(Experimental)"
324-
depends on !BT_LE_CONTROLLER_LOG_DUMP_ONLY
325-
depends on BT_LE_CONTROLLER_LOG_ENABLED
326-
default n
327-
help
323+
config BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
324+
bool "Store ble controller logs to flash(Experimental)"
325+
depends on !BT_LE_CONTROLLER_LOG_DUMP_ONLY
326+
depends on BT_LE_CONTROLLER_LOG_ENABLED
327+
default n
328+
help
328329
Store ble controller logs to flash memory.
329330

330-
config BT_LE_CONTROLLER_LOG_PARTITION_SIZE
331-
int "size of ble controller log partition(Multiples of 4K)"
332-
depends on BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
333-
default 65536
334-
help
331+
config BT_LE_CONTROLLER_LOG_PARTITION_SIZE
332+
int "size of ble controller log partition(Multiples of 4K)"
333+
depends on BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
334+
default 65536
335+
help
335336
The size of ble controller log partition shall be a multiples of 4K.
336337
The name of log partition shall be "bt_ctrl_log".
337338
The partition type shall be ESP_PARTITION_TYPE_DATA.
338339
The partition sub_type shall be ESP_PARTITION_SUBTYPE_ANY.
339340

340-
config BT_LE_LOG_CTRL_BUF1_SIZE
341-
int "size of the first BLE controller LOG buffer"
342-
depends on BT_LE_CONTROLLER_LOG_ENABLED
343-
default 4096
344-
help
341+
config BT_LE_LOG_CTRL_BUF1_SIZE
342+
int "size of the first BLE controller LOG buffer"
343+
depends on BT_LE_CONTROLLER_LOG_ENABLED
344+
default 4096
345+
help
345346
Configure the size of the first BLE controller LOG buffer.
346347

347-
config BT_LE_LOG_CTRL_BUF2_SIZE
348-
int "size of the second BLE controller LOG buffer"
349-
depends on BT_LE_CONTROLLER_LOG_ENABLED
350-
default 1024
351-
help
348+
config BT_LE_LOG_CTRL_BUF2_SIZE
349+
int "size of the second BLE controller LOG buffer"
350+
depends on BT_LE_CONTROLLER_LOG_ENABLED
351+
default 1024
352+
help
352353
Configure the size of the second BLE controller LOG buffer.
353354

354-
config BT_LE_LOG_HCI_BUF_SIZE
355-
int "size of the BLE HCI LOG buffer"
356-
depends on BT_LE_CONTROLLER_LOG_ENABLED
357-
default 4096
358-
help
355+
config BT_LE_LOG_HCI_BUF_SIZE
356+
int "size of the BLE HCI LOG buffer"
357+
depends on BT_LE_CONTROLLER_LOG_ENABLED
358+
default 4096
359+
help
359360
Configure the size of the BLE HCI LOG buffer.
360361

361-
config BT_LE_CONTROLLER_LOG_WRAP_PANIC_HANDLER_ENABLE
362-
bool "Enable wrap panic handler"
363-
depends on BT_LE_CONTROLLER_LOG_ENABLED
364-
default n
365-
help
366-
Wrap esp_panic_handler to get controller logs when PC pointer exception crashes.
362+
config BT_LE_CONTROLLER_LOG_WRAP_PANIC_HANDLER_ENABLE
363+
bool "Enable wrap panic handler"
364+
depends on BT_LE_CONTROLLER_LOG_ENABLED
365+
default n
366+
help
367+
Wrap esp_panic_handler to get controller logs when PC pointer exception crashes.
367368

368-
config BT_LE_CONTROLLER_LOG_TASK_WDT_USER_HANDLER_ENABLE
369-
bool "Enable esp_task_wdt_isr_user_handler implementation"
370-
depends on BT_LE_CONTROLLER_LOG_ENABLED
371-
default n
372-
help
373-
Implement esp_task_wdt_isr_user_handler to get controller logs when task wdt issue is triggered.
369+
config BT_LE_CONTROLLER_LOG_TASK_WDT_USER_HANDLER_ENABLE
370+
bool "Enable esp_task_wdt_isr_user_handler implementation"
371+
depends on BT_LE_CONTROLLER_LOG_ENABLED
372+
default n
373+
help
374+
Implement esp_task_wdt_isr_user_handler to get controller logs when task wdt issue is triggered.
374375

375-
config BT_LE_CONTROLLER_LOG_OUTPUT_LEVEL
376-
int "The output level of controller log"
377-
depends on BT_LE_CONTROLLER_LOG_ENABLED
378-
range 0 5
379-
default 1
380-
help
381-
The output level of controller log.
376+
config BT_LE_CONTROLLER_LOG_OUTPUT_LEVEL
377+
int "The output level of controller log"
378+
depends on BT_LE_CONTROLLER_LOG_ENABLED
379+
range 0 5
380+
default 1
381+
help
382+
The output level of controller log.
382383

383-
config BT_LE_CONTROLLER_LOG_MOD_OUTPUT_SWITCH
384-
hex "The switch of module log output"
385-
depends on BT_LE_CONTROLLER_LOG_ENABLED
386-
range 0 0xFFFFFFFF
387-
default 0xFFFFFFFF
388-
help
389-
The switch of module log output, this is an unsigned 32-bit hexadecimal value.
384+
config BT_LE_CONTROLLER_LOG_MOD_OUTPUT_SWITCH
385+
hex "The switch of module log output"
386+
depends on BT_LE_CONTROLLER_LOG_ENABLED
387+
range 0 0xFFFFFFFF
388+
default 0xFFFFFFFF
389+
help
390+
The switch of module log output, this is an unsigned 32-bit hexadecimal value.
391+
392+
config BT_LE_ERROR_SIM_ENABLED
393+
bool "Enable controller features for internal testing"
394+
default n
395+
396+
config BT_LE_ASSERT_WHEN_ABNORMAL_DISCONN_ENABLED
397+
bool "When ACL disconnects abnormally, assertion processing is performed(Experimental)"
398+
default n
399+
endmenu
390400

391401
config BT_LE_LL_RESOLV_LIST_SIZE
392402
int "BLE LL Resolving list size"
@@ -751,14 +761,14 @@ config BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX
751761
The value of upperlimitmax needs to be a power of 2.
752762

753763
config BT_LE_CTRL_CHAN_ASS_EN
754-
bool "Enable channel assessment"
764+
bool "Enable channel assessment(Experimental)"
755765
default n
756766
help
757767
If this option is enabled, The Controller will records the communication quality
758768
for each channel and then start a timer to check and update the channel map every 4 seconds.
759769

760770
config BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX
761-
bool "Enable aux packet when ext adv data length is zero"
771+
bool "Enable aux packet when ext adv data length is zero(Experimental)"
762772
default y
763773
help
764774
When this option is enabled, auxiliary packets will be present in the events of
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
#include <stdlib.h>
7+
8+
#include "sdkconfig.h"
9+
#include "esp_bt_cfg.h"
10+
11+
/* External functions or variables
12+
************************************************************************
13+
*/
14+
int base_stack_initEnv(void);
15+
void base_stack_deinitEnv(void);
16+
int base_stack_enable(void);
17+
void base_stack_disable(void);
18+
19+
int conn_stack_initEnv(void);
20+
void conn_stack_deinitEnv(void);
21+
int conn_stack_enable(void);
22+
void conn_stack_disable(void);
23+
24+
#if CONFIG_BT_LE_ERROR_SIM_ENABLED
25+
int conn_errorSim_initEnv(void);
26+
void conn_errorSim_deinitEnv(void);
27+
int conn_errorSim_enable(void);
28+
void conn_errorSim_disable(void);
29+
#endif // CONFIG_BT_LE_ERROR_SIM_ENABLED
30+
31+
/* Local functions definition
32+
***************************************************************************
33+
*/
34+
int ble_stack_initEnv(void)
35+
{
36+
int rc;
37+
38+
rc = base_stack_initEnv();
39+
if (rc) {
40+
return rc;
41+
}
42+
43+
#if DEFAULT_BT_LE_MAX_CONNECTIONS
44+
rc = conn_stack_initEnv();
45+
if (rc) {
46+
return rc;
47+
}
48+
#if CONFIG_BT_LE_ERROR_SIM_ENABLED
49+
rc = conn_errorSim_initEnv();
50+
if (rc) {
51+
return rc;
52+
}
53+
#endif // CONFIG_BT_LE_ERROR_SIM_ENABLED
54+
#endif // DEFAULT_BT_LE_MAX_CONNECTIONS
55+
56+
return 0;
57+
}
58+
59+
void ble_stack_deinitEnv(void)
60+
{
61+
#if DEFAULT_BT_LE_MAX_CONNECTIONS
62+
#if CONFIG_BT_LE_ERROR_SIM_ENABLED
63+
conn_errorSim_deinitEnv();
64+
#endif // CONFIG_BT_LE_ERROR_SIM_ENABLED
65+
conn_stack_deinitEnv();
66+
#endif // DEFAULT_BT_LE_MAX_CONNECTIONS
67+
68+
base_stack_deinitEnv();
69+
}
70+
71+
int ble_stack_enable(void)
72+
{
73+
int rc;
74+
75+
rc = base_stack_enable();
76+
if (rc) {
77+
return rc;
78+
}
79+
80+
#if DEFAULT_BT_LE_MAX_CONNECTIONS
81+
rc = conn_stack_enable();
82+
if (rc) {
83+
return rc;
84+
}
85+
#if CONFIG_BT_LE_ERROR_SIM_ENABLED
86+
rc = conn_errorSim_enable();
87+
if (rc) {
88+
return rc;
89+
}
90+
#endif // CONFIG_BT_LE_ERROR_SIM_ENABLED
91+
#endif // DEFAULT_BT_LE_MAX_CONNECTIONS
92+
93+
return 0;
94+
}
95+
96+
void ble_stack_disable(void)
97+
{
98+
#if DEFAULT_BT_LE_MAX_CONNECTIONS
99+
#if CONFIG_BT_LE_ERROR_SIM_ENABLED
100+
conn_errorSim_disable();
101+
#endif // CONFIG_BT_LE_ERROR_SIM_ENABLED
102+
conn_stack_disable();
103+
#endif // DEFAULT_BT_LE_MAX_CONNECTIONS
104+
105+
base_stack_disable();
106+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
int ble_stack_initEnv(void);
7+
8+
void ble_stack_deinitEnv(void);
9+
10+
int ble_stack_enable(void);
11+
12+
void ble_stack_disable(void);

0 commit comments

Comments
 (0)