Skip to content

Commit b87b0dd

Browse files
committed
Merge branch 'change/ble_update_lib_20250709' into 'master'
change(ble): [AUTO_MR] 20250709 - Update ESP BLE Controller Lib Closes BLERP-2067 See merge request espressif/esp-idf!40465
2 parents ce92b0a + f1838ae commit b87b0dd

File tree

23 files changed

+363
-97
lines changed

23 files changed

+363
-97
lines changed

components/bt/controller/esp32c2/Kconfig.in

Lines changed: 86 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -281,94 +281,103 @@ config BT_LE_CONTROLLER_TASK_STACK_SIZE
281281
help
282282
This configures stack size of NimBLE controller task
283283

284-
menuconfig BT_LE_CONTROLLER_LOG_ENABLED
285-
bool "Controller log enable"
286-
default n
287-
help
288-
Enable controller log
284+
menu "Controller debug features"
285+
menuconfig BT_LE_CONTROLLER_LOG_ENABLED
286+
bool "Controller log enable"
287+
default n
288+
help
289+
Enable controller log
289290

290-
config BT_LE_CONTROLLER_LOG_CTRL_ENABLED
291-
bool "enable controller log module"
292-
depends on BT_LE_CONTROLLER_LOG_ENABLED
293-
default y
294-
help
295-
Enable controller log module
291+
config BT_LE_CONTROLLER_LOG_CTRL_ENABLED
292+
bool "enable controller log module"
293+
depends on BT_LE_CONTROLLER_LOG_ENABLED
294+
default y
295+
help
296+
Enable controller log module
296297

297-
config BT_LE_CONTROLLER_LOG_HCI_ENABLED
298-
bool "enable HCI log module"
299-
depends on BT_LE_CONTROLLER_LOG_ENABLED
300-
default y
301-
help
302-
Enable hci log module
298+
config BT_LE_CONTROLLER_LOG_HCI_ENABLED
299+
bool "enable HCI log module"
300+
depends on BT_LE_CONTROLLER_LOG_ENABLED
301+
default y
302+
help
303+
Enable hci log module
303304

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

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

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

328-
config BT_LE_CONTROLLER_LOG_PARTITION_SIZE
329-
int "size of ble controller log partition(Multiples of 4K)"
330-
depends on BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
331-
default 65536
332-
help
333-
The size of ble controller log partition shall be a multiples of 4K.
334-
The name of log partition shall be "bt_ctrl_log".
335-
The partition type shall be ESP_PARTITION_TYPE_DATA.
336-
The partition sub_type shall be ESP_PARTITION_SUBTYPE_ANY.
329+
config BT_LE_CONTROLLER_LOG_PARTITION_SIZE
330+
int "size of ble controller log partition(Multiples of 4K)"
331+
depends on BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
332+
default 65536
333+
help
334+
The size of ble controller log partition shall be a multiples of 4K.
335+
The name of log partition shall be "bt_ctrl_log".
336+
The partition type shall be ESP_PARTITION_TYPE_DATA.
337+
The partition sub_type shall be ESP_PARTITION_SUBTYPE_ANY.
338+
339+
config BT_LE_LOG_CTRL_BUF1_SIZE
340+
int "size of the first BLE controller LOG buffer"
341+
depends on BT_LE_CONTROLLER_LOG_ENABLED
342+
default 4096
343+
help
344+
Configure the size of the first BLE controller LOG buffer.
337345

338-
config BT_LE_LOG_CTRL_BUF1_SIZE
339-
int "size of the first BLE controller LOG buffer"
340-
depends on BT_LE_CONTROLLER_LOG_ENABLED
341-
default 4096
342-
help
343-
Configure the size of the first BLE controller LOG buffer.
346+
config BT_LE_LOG_CTRL_BUF2_SIZE
347+
int "size of the second BLE controller LOG buffer"
348+
depends on BT_LE_CONTROLLER_LOG_ENABLED
349+
default 1024
350+
help
351+
Configure the size of the second BLE controller LOG buffer.
344352

345-
config BT_LE_LOG_CTRL_BUF2_SIZE
346-
int "size of the second BLE controller LOG buffer"
347-
depends on BT_LE_CONTROLLER_LOG_ENABLED
348-
default 1024
349-
help
350-
Configure the size of the second BLE controller LOG buffer.
353+
config BT_LE_LOG_HCI_BUF_SIZE
354+
int "size of the BLE HCI LOG buffer"
355+
depends on BT_LE_CONTROLLER_LOG_ENABLED
356+
default 4096
357+
help
358+
Configure the size of the BLE HCI LOG buffer.
351359

352-
config BT_LE_LOG_HCI_BUF_SIZE
353-
int "size of the BLE HCI LOG buffer"
354-
depends on BT_LE_CONTROLLER_LOG_ENABLED
355-
default 4096
356-
help
357-
Configure the size of the BLE HCI LOG buffer.
360+
config BT_LE_CONTROLLER_LOG_WRAP_PANIC_HANDLER_ENABLE
361+
bool "Enable wrap panic handler"
362+
depends on BT_LE_CONTROLLER_LOG_ENABLED
363+
default n
364+
help
365+
Wrap esp_panic_handler to get controller logs when PC pointer exception crashes.
358366

359-
config BT_LE_CONTROLLER_LOG_WRAP_PANIC_HANDLER_ENABLE
360-
bool "Enable wrap panic handler"
361-
depends on BT_LE_CONTROLLER_LOG_ENABLED
362-
default n
363-
help
364-
Wrap esp_panic_handler to get controller logs when PC pointer exception crashes.
367+
config BT_LE_CONTROLLER_LOG_TASK_WDT_USER_HANDLER_ENABLE
368+
bool "Enable esp_task_wdt_isr_user_handler implementation"
369+
depends on BT_LE_CONTROLLER_LOG_ENABLED
370+
default n
371+
help
372+
Implement esp_task_wdt_isr_user_handler to get controller logs when task wdt issue is triggered.
373+
374+
config BT_LE_MEM_CHECK_ENABLED
375+
bool "Enable memory allocation check"
376+
default n
377+
help
378+
Used in internal tests only. Enable the memory allocation check.
379+
endmenu
365380

366-
config BT_LE_CONTROLLER_LOG_TASK_WDT_USER_HANDLER_ENABLE
367-
bool "Enable esp_task_wdt_isr_user_handler implementation"
368-
depends on BT_LE_CONTROLLER_LOG_ENABLED
369-
default n
370-
help
371-
Implement esp_task_wdt_isr_user_handler to get controller logs when task wdt issue is triggered.
372381
config BT_LE_LL_RESOLV_LIST_SIZE
373382
int "BLE LL Resolving list size"
374383
range 1 5

components/bt/controller/esp32c2/bt.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1573,3 +1573,10 @@ int ble_sm_alg_gen_key_pair(uint8_t *pub, uint8_t *priv)
15731573

15741574
#endif // CONFIG_BT_LE_SM_LEGACY || CONFIG_BT_LE_SM_SC
15751575
#endif // (!CONFIG_BT_NIMBLE_ENABLED) && (CONFIG_BT_CONTROLLER_ENABLED)
1576+
1577+
#if CONFIG_BT_LE_MEM_CHECK_ENABLED
1578+
void ble_memory_count_limit_set(uint16_t count_limit)
1579+
{
1580+
bt_osi_mem_count_limit_set(count_limit);
1581+
}
1582+
#endif // CONFIG_BT_LE_MEM_CHECK_ENABLED

components/bt/controller/esp32c5/Kconfig.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,12 @@ menu "Controller debug features"
406406
config BT_LE_PTR_CHECK_ENABLED
407407
bool "Enable boundary check for internal memory"
408408
default n
409+
410+
config BT_LE_MEM_CHECK_ENABLED
411+
bool "Enable memory allocation check"
412+
default n
413+
help
414+
Used in internal tests only. Enable the memory allocation check.
409415
endmenu
410416

411417
config BT_LE_LL_RESOLV_LIST_SIZE

components/bt/controller/esp32c5/ble.c

Lines changed: 64 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,21 @@ void base_stack_deinitEnv(void);
1717
int base_stack_enable(void);
1818
void base_stack_disable(void);
1919

20+
int adv_stack_initEnv(void);
21+
void adv_stack_deinitEnv(void);
22+
int adv_stack_enable(void);
23+
void adv_stack_disable(void);
24+
25+
int extAdv_stack_initEnv(void);
26+
void extAdv_stack_deinitEnv(void);
27+
int extAdv_stack_enable(void);
28+
void extAdv_stack_disable(void);
29+
30+
int sync_stack_initEnv(void);
31+
void sync_stack_deinitEnv(void);
32+
int sync_stack_enable(void);
33+
void sync_stack_disable(void);
34+
2035
int conn_stack_initEnv(void);
2136
void conn_stack_deinitEnv(void);
2237
int conn_stack_enable(void);
@@ -85,6 +100,21 @@ int ble_stack_initEnv(void)
85100
return rc;
86101
}
87102

103+
rc = adv_stack_initEnv();
104+
if (rc) {
105+
return rc;
106+
}
107+
108+
rc = extAdv_stack_initEnv();
109+
if (rc) {
110+
return rc;
111+
}
112+
113+
rc = sync_stack_initEnv();
114+
if (rc) {
115+
return rc;
116+
}
117+
88118
#if DEFAULT_BT_LE_MAX_CONNECTIONS
89119
rc = conn_stack_initEnv();
90120
if (rc) {
@@ -109,7 +139,9 @@ void ble_stack_deinitEnv(void)
109139
#endif // CONFIG_BT_LE_ERROR_SIM_ENABLED
110140
conn_stack_deinitEnv();
111141
#endif // DEFAULT_BT_LE_MAX_CONNECTIONS
112-
142+
sync_stack_deinitEnv();
143+
extAdv_stack_deinitEnv();
144+
adv_stack_deinitEnv();
113145
base_stack_deinitEnv();
114146
}
115147

@@ -122,6 +154,21 @@ int ble_stack_enable(void)
122154
return rc;
123155
}
124156

157+
rc = adv_stack_enable();
158+
if (rc) {
159+
return rc;
160+
}
161+
162+
rc = extAdv_stack_enable();
163+
if (rc) {
164+
return rc;
165+
}
166+
167+
rc = sync_stack_enable();
168+
if (rc) {
169+
return rc;
170+
}
171+
125172
#if DEFAULT_BT_LE_MAX_CONNECTIONS
126173
rc = conn_stack_enable();
127174
if (rc) {
@@ -143,7 +190,20 @@ int ble_stack_enable(void)
143190
#if CONFIG_BT_LE_RXBUF_OPT_ENABLED
144191
mmgmt_enableRxbufOptFeature();
145192
#endif // CONFIG_BT_LE_RXBUF_OPT_ENABLED
193+
rc = adv_stack_enable();
194+
if (rc) {
195+
return rc;
196+
}
197+
198+
rc = extAdv_stack_enable();
199+
if (rc) {
200+
return rc;
201+
}
146202

203+
rc = sync_stack_enable();
204+
if (rc) {
205+
return rc;
206+
}
147207
return 0;
148208
}
149209

@@ -160,6 +220,8 @@ void ble_stack_disable(void)
160220
#endif // CONFIG_BT_LE_ERROR_SIM_ENABLED
161221
conn_stack_disable();
162222
#endif // DEFAULT_BT_LE_MAX_CONNECTIONS
163-
223+
sync_stack_disable();
224+
extAdv_stack_disable();
225+
adv_stack_disable();
164226
base_stack_disable();
165227
}

components/bt/controller/esp32c5/bt.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1700,3 +1700,10 @@ ble_capture_info_user_handler(uint8_t type, uint32_t reason, uint32_t param1, ui
17001700
}
17011701
return 0;
17021702
}
1703+
1704+
#if CONFIG_BT_LE_MEM_CHECK_ENABLED
1705+
void ble_memory_count_limit_set(uint16_t count_limit)
1706+
{
1707+
bt_osi_mem_count_limit_set(count_limit);
1708+
}
1709+
#endif // CONFIG_BT_LE_MEM_CHECK_ENABLED

components/bt/controller/esp32c6/Kconfig.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,12 @@ menu "Controller debug features"
447447
config BT_LE_PTR_CHECK_ENABLED
448448
bool "Enable boundary check for internal memory"
449449
default n
450+
451+
config BT_LE_MEM_CHECK_ENABLED
452+
bool "Enable memory allocation check"
453+
default n
454+
help
455+
Used in internal tests only. Enable the memory allocation check.
450456
endmenu
451457

452458
config BT_LE_LL_RESOLV_LIST_SIZE

0 commit comments

Comments
 (0)