mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-07 20:00:53 +00:00
feat(ble/controller): Added memory boundary check for ESP32-C6 and ESP32-H2
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
|
||||
menu "HCI Config"
|
||||
|
||||
choice BT_LE_HCI_INTERFACE
|
||||
prompt "HCI mode"
|
||||
default BT_LE_HCI_INTERFACE_USE_RAM
|
||||
@@ -444,6 +443,10 @@ menu "Controller debug features"
|
||||
default n
|
||||
help
|
||||
Retain scene with GDB to capture info, requires disabling WDT (CONFIG_ESP_INT_WDT, CONFIG_ESP_TASK_WDT_EN).
|
||||
|
||||
config BT_LE_PTR_CHECK_ENABLED
|
||||
bool "Enable boundary check for internal memory"
|
||||
default n
|
||||
endmenu
|
||||
|
||||
config BT_LE_LL_RESOLV_LIST_SIZE
|
||||
|
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "sdkconfig.h"
|
||||
#include "esp_bt_cfg.h"
|
||||
#include "esp_bit_defs.h"
|
||||
|
||||
/* External functions or variables
|
||||
************************************************************************
|
||||
@@ -28,9 +29,56 @@ int conn_errorSim_enable(void);
|
||||
void conn_errorSim_disable(void);
|
||||
#endif // CONFIG_BT_LE_ERROR_SIM_ENABLED
|
||||
|
||||
#if (CONFIG_BT_NIMBLE_ENABLED || CONFIG_BT_BLUEDROID_ENABLED)
|
||||
void adv_stack_enableClearLegacyAdvVsCmd(bool en);
|
||||
void scan_stack_enableAdvFlowCtrlVsCmd(bool en);
|
||||
void advFilter_stack_enableDupExcListVsCmd(bool en);
|
||||
void arr_stack_enableMultiConnVsCmd(bool en);
|
||||
void pcl_stack_enableSetRssiThreshVsCmd(bool en);
|
||||
void chanSel_stack_enableSetCsaVsCmd(bool en);
|
||||
void log_stack_enableLogsRelatedVsCmd(bool en);
|
||||
void hci_stack_enableSetVsEvtMaskVsCmd(bool en);
|
||||
void winWiden_stack_enableSetConstPeerScaVsCmd(bool en);
|
||||
#if CONFIG_IDF_TARGET_ESP32C61_ECO3
|
||||
void conn_stack_enableSetPrefTxRxCntVsCmd(bool en);
|
||||
#endif // CONFIG_IDF_TARGET_ESP32C61_ECO3
|
||||
|
||||
void adv_stack_enableScanReqRxdVsEvent(bool en);
|
||||
void conn_stack_enableChanMapUpdCompVsEvent(bool en);
|
||||
void sleep_stack_enableWakeupVsEvent(bool en);
|
||||
#endif // (CONFIG_BT_NIMBLE_ENABLED || CONFIG_BT_BLUEDROID_ENABLED)
|
||||
|
||||
/* Local functions definition
|
||||
***************************************************************************
|
||||
*/
|
||||
#if (CONFIG_BT_NIMBLE_ENABLED || CONFIG_BT_BLUEDROID_ENABLED)
|
||||
void ble_stack_enableVsCmds(bool en)
|
||||
{
|
||||
adv_stack_enableClearLegacyAdvVsCmd(en);
|
||||
advFilter_stack_enableDupExcListVsCmd(en);
|
||||
scan_stack_enableAdvFlowCtrlVsCmd(en);
|
||||
arr_stack_enableMultiConnVsCmd(en);
|
||||
pcl_stack_enableSetRssiThreshVsCmd(en);
|
||||
chanSel_stack_enableSetCsaVsCmd(en);
|
||||
log_stack_enableLogsRelatedVsCmd(en);
|
||||
hci_stack_enableSetVsEvtMaskVsCmd(en);
|
||||
winWiden_stack_enableSetConstPeerScaVsCmd(en);
|
||||
#if CONFIG_IDF_TARGET_ESP32C61_ECO3
|
||||
conn_stack_enableSetPrefTxRxCntVsCmd(en);
|
||||
#endif // CONFIG_IDF_TARGET_ESP32C61_ECO3
|
||||
}
|
||||
|
||||
void ble_stack_enableVsEvents(bool en)
|
||||
{
|
||||
adv_stack_enableScanReqRxdVsEvent(en);
|
||||
conn_stack_enableChanMapUpdCompVsEvent(en);
|
||||
|
||||
#if CONFIG_BT_LE_SLEEP_ENABLE
|
||||
sleep_stack_enableWakeupVsEvent(en);
|
||||
#endif // CONFIG_BT_LE_SLEEP_ENABLE
|
||||
}
|
||||
#endif // (CONFIG_BT_NIMBLE_ENABLED || CONFIG_BT_BLUEDROID_ENABLED)
|
||||
|
||||
int ble_stack_initEnv(void)
|
||||
{
|
||||
int rc;
|
||||
@@ -90,11 +138,21 @@ int ble_stack_enable(void)
|
||||
#endif // CONFIG_BT_LE_ERROR_SIM_ENABLED
|
||||
#endif // DEFAULT_BT_LE_MAX_CONNECTIONS
|
||||
|
||||
#if (CONFIG_BT_NIMBLE_ENABLED || CONFIG_BT_BLUEDROID_ENABLED)
|
||||
ble_stack_enableVsCmds(true);
|
||||
ble_stack_enableVsEvents(true);
|
||||
#endif // (CONFIG_BT_NIMBLE_ENABLED || CONFIG_BT_BLUEDROID_ENABLED)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ble_stack_disable(void)
|
||||
{
|
||||
#if (CONFIG_BT_NIMBLE_ENABLED || CONFIG_BT_BLUEDROID_ENABLED)
|
||||
ble_stack_enableVsEvents(false);
|
||||
ble_stack_enableVsCmds(false);
|
||||
#endif // (CONFIG_BT_NIMBLE_ENABLED || CONFIG_BT_BLUEDROID_ENABLED)
|
||||
|
||||
#if DEFAULT_BT_LE_MAX_CONNECTIONS
|
||||
#if CONFIG_BT_LE_ERROR_SIM_ENABLED
|
||||
conn_errorSim_disable();
|
||||
|
@@ -204,6 +204,12 @@ extern "C" {
|
||||
#define DEFAULT_BT_LE_VHCI_ENABLED (0)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BT_LE_PTR_CHECK_ENABLED
|
||||
#define DEFAULT_BT_LE_PTR_CHECK_ENABLED (CONFIG_BT_LE_PTR_CHECK_ENABLED)
|
||||
#else
|
||||
#define DEFAULT_BT_LE_PTR_CHECK_ENABLED (0)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BT_LE_SLEEP_ENABLE
|
||||
#define NIMBLE_SLEEP_ENABLE CONFIG_BT_LE_SLEEP_ENABLE
|
||||
#else
|
||||
|
Reference in New Issue
Block a user