Skip to content

Commit 265a874

Browse files
feat(ble): support memory allocation check debug feature on ESP32-H2
1 parent 027766e commit 265a874

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

components/bt/controller/esp32h2/Kconfig.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,12 @@ menu "Controller debug features"
441441
config BT_LE_PTR_CHECK_ENABLED
442442
bool "Enable boundary check for internal memory"
443443
default n
444+
445+
config BT_LE_MEM_CHECK_ENABLED
446+
bool "Enable memory allocation check"
447+
default n
448+
help
449+
Used in internal tests only. Enable the memory allocation check.
444450
endmenu
445451

446452
config BT_LE_LL_RESOLV_LIST_SIZE

components/bt/controller/esp32h2/bt.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1693,3 +1693,10 @@ ble_capture_info_user_handler(uint8_t type, uint32_t reason, uint32_t param1, ui
16931693
}
16941694
return 0;
16951695
}
1696+
1697+
#if CONFIG_BT_LE_MEM_CHECK_ENABLED
1698+
void ble_memory_count_limit_set(uint16_t count_limit)
1699+
{
1700+
bt_osi_mem_count_limit_set(count_limit);
1701+
}
1702+
#endif // CONFIG_BT_LE_MEM_CHECK_ENABLED

components/bt/include/esp32h2/include/esp_bt.h

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

463463
void esp_bt_set_lpclk_freq(uint32_t clk_freq);
464464

465+
#if CONFIG_BT_LE_MEM_CHECK_ENABLED
466+
void ble_memory_count_limit_set(uint16_t count_limit);
467+
#endif // CONFIG_BT_LE_MEM_CHECK_ENABLED
468+
465469
#ifdef __cplusplus
466470
}
467471
#endif

0 commit comments

Comments
 (0)