Skip to content

Commit 1ce54a5

Browse files
feat(ble): support memory allocation check debug feature on ESP32-C5
1 parent 7ef90d4 commit 1ce54a5

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

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/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/include/esp32c5/include/esp_bt.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,10 @@ uint32_t esp_bt_get_lpclk_freq(void);
459459

460460
void esp_bt_set_lpclk_freq(uint32_t clk_freq);
461461

462+
#if CONFIG_BT_LE_MEM_CHECK_ENABLED
463+
void ble_memory_count_limit_set(uint16_t count_limit);
464+
#endif // CONFIG_BT_LE_MEM_CHECK_ENABLED
465+
462466
#ifdef __cplusplus
463467
}
464468
#endif

0 commit comments

Comments
 (0)