forked from espressif/esp-idf
Merge branch 'change/ble_update_lib_20250313_v5.3' into 'release/v5.3'
change(ble): [AUTO_MR] 20250313 - Update ESP BLE Controller Lib (v5.3) See merge request espressif/esp-idf!37821
This commit is contained in:
@@ -939,12 +939,15 @@ if(CONFIG_BT_ENABLED)
|
||||
target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--wrap=esp_panic_handler")
|
||||
endif()
|
||||
if(CONFIG_IDF_TARGET_ESP32C6)
|
||||
add_prebuilt_library(libble_app "controller/lib_${target}/${target}-bt-lib/esp32c6/libble_app.a")
|
||||
add_prebuilt_library(libble_app "controller/lib_${target}/${target}-bt-lib/esp32c6/libble_app.a"
|
||||
REQUIRES esp_phy)
|
||||
else()
|
||||
if(CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY AND CONFIG_IDF_TARGET_ESP32C2)
|
||||
add_prebuilt_library(libble_app "controller/lib_${target}/${target}-bt-lib/libble_app_flash.a")
|
||||
add_prebuilt_library(libble_app "controller/lib_${target}/${target}-bt-lib/libble_app_flash.a"
|
||||
REQUIRES esp_phy)
|
||||
else()
|
||||
add_prebuilt_library(libble_app "controller/lib_${target}/${target}-bt-lib/libble_app.a")
|
||||
add_prebuilt_library(libble_app "controller/lib_${target}/${target}-bt-lib/libble_app.a"
|
||||
REQUIRES esp_phy)
|
||||
endif()
|
||||
endif()
|
||||
target_link_libraries(${COMPONENT_LIB} PRIVATE libble_app)
|
||||
|
@@ -9,9 +9,18 @@ config BT_ALARM_MAX_NUM
|
||||
config BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
bool "Output ble logs to SPI bus (Experimental)"
|
||||
default n
|
||||
select SPI_MASTER_IN_IRAM
|
||||
help
|
||||
Output ble logs to SPI bus
|
||||
|
||||
config BT_BLE_LOG_SPI_OUT_UL_TASK_BUF_SIZE
|
||||
int "SPI transaction buffer size for upper layer task logs"
|
||||
depends on BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
default 512
|
||||
help
|
||||
SPI transaction buffer size for upper layer task logs.
|
||||
There will be 2 SPI DMA buffers with the same size.
|
||||
|
||||
config BT_BLE_LOG_SPI_OUT_HCI_ENABLED
|
||||
bool "Enable HCI log output to SPI"
|
||||
depends on BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
@@ -27,51 +36,61 @@ config BT_BLE_LOG_SPI_OUT_HOST_ENABLED
|
||||
This configuration applies to the logs of both Bluedroid Host and NimBLE Host.
|
||||
When BLE SPI log output is enabled, this option allows host logs to be transmitted via SPI.
|
||||
|
||||
config BT_BLE_LOG_SPI_OUT_QUEUE_SIZE
|
||||
int "Number of ble log async SPI output queues"
|
||||
config BT_BLE_LOG_SPI_OUT_LL_ENABLED
|
||||
bool "Enable Controller log output to SPI"
|
||||
depends on BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
default 4
|
||||
depends on BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
default n
|
||||
help
|
||||
The number of ble log async SPI output queues
|
||||
Enable controller log output to SPI bus.
|
||||
|
||||
config BT_BLE_LOG_SPI_OUT_TRANS_BUF_SIZE
|
||||
int "Size of ble log async SPI output transaction buffer size"
|
||||
depends on BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
default 2048
|
||||
config BT_BLE_LOG_SPI_OUT_LL_TASK_BUF_SIZE
|
||||
int "SPI transaction buffer size for lower layer task logs"
|
||||
depends on BT_BLE_LOG_SPI_OUT_LL_ENABLED
|
||||
default 1024
|
||||
help
|
||||
The size of ble log async SPI output transaction buffer size
|
||||
SPI transaction buffer size for upper layer task logs.
|
||||
There will be 2 SPI DMA buffers with the same size.
|
||||
|
||||
config BT_BLE_LOG_SPI_OUT_LL_ISR_BUF_SIZE
|
||||
int "SPI transaction buffer size for lower layer ISR logs"
|
||||
depends on BT_BLE_LOG_SPI_OUT_LL_ENABLED
|
||||
default 512
|
||||
help
|
||||
SPI transaction buffer size for upper layer ISR logs.
|
||||
There will be 2 SPI DMA buffers with the same size.
|
||||
|
||||
config BT_BLE_LOG_SPI_OUT_MOSI_IO_NUM
|
||||
int "GPIO number of SPI MOSI"
|
||||
depends on BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
default 0
|
||||
help
|
||||
GPIO number of SPI MOSI
|
||||
GPIO number of SPI MOSI
|
||||
|
||||
config BT_BLE_LOG_SPI_OUT_SCLK_IO_NUM
|
||||
int "GPIO number of SPI SCLK"
|
||||
depends on BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
default 1
|
||||
help
|
||||
GPIO number of SPI SCLK
|
||||
GPIO number of SPI SCLK
|
||||
|
||||
config BT_BLE_LOG_SPI_OUT_CS_IO_NUM
|
||||
int "GPIO number of SPI CS"
|
||||
depends on BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
default 2
|
||||
help
|
||||
GPIO number of SPI CS
|
||||
GPIO number of SPI CS
|
||||
|
||||
config BT_BLE_LOG_SPI_OUT_TS_SYNC_ENABLED
|
||||
bool "Enable ble log & logic analyzer log time sync"
|
||||
depends on BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
default y
|
||||
help
|
||||
Enable ble log & logic analyzer log time sync
|
||||
Enable ble log & logic analyzer log time sync
|
||||
|
||||
config BT_BLE_LOG_SPI_OUT_SYNC_IO_NUM
|
||||
int "GPIO number of SYNC IO"
|
||||
depends on BT_BLE_LOG_SPI_OUT_TS_SYNC_ENABLED
|
||||
default 3
|
||||
help
|
||||
GPIO number of SYNC IO
|
||||
GPIO number of SYNC IO
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -11,6 +11,7 @@
|
||||
#include "driver/spi_master.h"
|
||||
#include "driver/gpio.h"
|
||||
#include "esp_timer.h"
|
||||
#include "esp_log.h"
|
||||
#include "freertos/semphr.h"
|
||||
|
||||
// Public typedefs
|
||||
@@ -20,6 +21,8 @@
|
||||
#define BLE_LOG_SPI_OUT_SOURCE_NIMBLE 3
|
||||
#define BLE_LOG_SPI_OUT_SOURCE_HCI_UPSTREAM 4
|
||||
#define BLE_LOG_SPI_OUT_SOURCE_HCI_DOWNSTREAM 5
|
||||
#define BLE_LOG_SPI_OUT_SOURCE_ESP_ISR 6
|
||||
#define BLE_LOG_SPI_OUT_SOURCE_ESP_LEGACY_ISR 7
|
||||
#define BLE_LOG_SPI_OUT_SOURCE_USER 0x10
|
||||
#define BLE_LOG_SPI_OUT_SOURCE_SYNC 0xFE
|
||||
#define BLE_LOG_SPI_OUT_SOURCE_LOSS 0xFF
|
||||
@@ -34,14 +37,18 @@
|
||||
#define BLE_LOG_SPI_OUT_LEVEL_MAX 6 /*!< Number of SPI log levels supported */
|
||||
|
||||
// Public functions
|
||||
void ble_log_spi_out_init(void);
|
||||
int ble_log_spi_out_init(void);
|
||||
void ble_log_spi_out_deinit(void);
|
||||
void ble_log_spi_out_write(uint8_t source, const uint8_t *addr, uint16_t len);
|
||||
void ble_log_spi_out_write_esp(uint32_t len, const uint8_t *addr, bool end);
|
||||
void ble_log_spi_out_timer_control(bool enable);
|
||||
int ble_log_spi_out_write(uint8_t source, const uint8_t *addr, uint16_t len);
|
||||
void ble_log_spi_out_ll_write(uint32_t len, const uint8_t *addr, uint32_t len_append,\
|
||||
const uint8_t *addr_append, uint32_t flag);
|
||||
void ble_log_spi_out_ll_log_ev_proc(void);
|
||||
void ble_log_spi_out_ts_sync_start(void);
|
||||
void ble_log_spi_out_ts_sync_stop(void);
|
||||
int ble_log_spi_out_printf(uint8_t source, const char *format, ...);
|
||||
int ble_log_spi_out_printf_enh(uint8_t source, uint8_t level, const char *tag, const char *format, ...);
|
||||
void ble_log_spi_out_write_with_ts(uint8_t source, const uint8_t *addr, uint16_t len);
|
||||
int ble_log_spi_out_write_with_ts(uint8_t source, const uint8_t *addr, uint16_t len);
|
||||
void ble_log_spi_out_dump_all(void);
|
||||
|
||||
#endif // __BT_SPI_OUT_H__
|
||||
|
@@ -1699,7 +1699,10 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
||||
#endif
|
||||
|
||||
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
ble_log_spi_out_init();
|
||||
if (ble_log_spi_out_init() != 0) {
|
||||
ESP_LOGE(BTDM_LOG_TAG, "BLE Log SPI output init failed");
|
||||
goto error;
|
||||
}
|
||||
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
|
||||
btdm_cfg_mask = btdm_config_mask_load();
|
||||
@@ -1728,6 +1731,10 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
||||
|
||||
error:
|
||||
|
||||
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
ble_log_spi_out_deinit();
|
||||
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
|
||||
bt_controller_deinit_internal();
|
||||
|
||||
return err;
|
||||
|
@@ -689,3 +689,33 @@ config BT_LE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS
|
||||
Enabling this option will add stricter verification of the Access Address in the CONNECT_IND PDU.
|
||||
This improves security by ensuring that only connection requests with valid Access Addresses are accepted.
|
||||
If disabled, only basic checks are applied, improving compatibility.
|
||||
|
||||
menu "BLE disconnects when Instant Passed (0x28) occurs"
|
||||
config BT_LE_CTRL_LLCP_CONN_UPDATE
|
||||
bool "BLE ACL connection update procedure"
|
||||
default n
|
||||
help
|
||||
If this option is enabled, Controller will terminate the connection
|
||||
when Instant Passed (0x28) error occurs during connection update procedure.
|
||||
|
||||
config BT_LE_CTRL_LLCP_CHAN_MAP_UPDATE
|
||||
bool "BLE ACL channel map update procedure"
|
||||
default n
|
||||
help
|
||||
If this option is enabled, Controller will terminate the connection
|
||||
when Instant Passed (0x28) error occurs in channel map update procedure.
|
||||
|
||||
config BT_LE_CTRL_LLCP_PHY_UPDATE
|
||||
bool "BLE ACL PHY update procedure"
|
||||
default n
|
||||
help
|
||||
If this option is enabled, Controller will terminate the connection
|
||||
when Instant Passed (0x28) error occurs in PHY update procedure.
|
||||
endmenu
|
||||
|
||||
config BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX
|
||||
int "The value of upperlimitmax during scan backoff procedure"
|
||||
range 1 256
|
||||
default 32
|
||||
help
|
||||
The value of upperlimitmax needs to be a power of 2.
|
||||
|
@@ -12,9 +12,14 @@
|
||||
************************************************************************
|
||||
*/
|
||||
#if (CONFIG_BT_NIMBLE_ENABLED || CONFIG_BT_BLUEDROID_ENABLED)
|
||||
void adv_stack_enableClearLegacyAdvVsCmd(bool en);
|
||||
void scan_stack_enableAdvFlowCtrlVsCmd(bool en);
|
||||
void adv_stack_enableClearLegacyAdvVsCmd(bool en);
|
||||
void chanSel_stack_enableSetCsaVsCmd(bool en);
|
||||
void hci_stack_enableSetVsEvtMaskVsCmd(bool en);
|
||||
|
||||
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
|
||||
@@ -32,10 +37,18 @@ void ble_stack_enableVsCmds(bool en)
|
||||
#endif // DEFAULT_BT_LE_ROLE_OBSERVER
|
||||
|
||||
chanSel_stack_enableSetCsaVsCmd(en);
|
||||
hci_stack_enableSetVsEvtMaskVsCmd(en);
|
||||
}
|
||||
|
||||
void ble_stack_enableVsEvents(bool en)
|
||||
{
|
||||
#if DEFAULT_BT_LE_ROLE_BROADCASTER
|
||||
adv_stack_enableScanReqRxdVsEvent(en);
|
||||
#endif // DEFAULT_BT_LE_ROLE_BROADCASTER
|
||||
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)
|
||||
|
||||
|
@@ -65,11 +65,9 @@
|
||||
#include "hal/efuse_ll.h"
|
||||
#include "soc/rtc.h"
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
#include "ble_log/ble_log_spi_out.h"
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
|
||||
/* Macro definition
|
||||
************************************************************************
|
||||
@@ -119,7 +117,7 @@ struct ext_funcs_t {
|
||||
};
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
typedef void (*interface_func_t) (uint32_t len, const uint8_t*addr, bool end);
|
||||
typedef void (*interface_func_t) (uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag);
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
|
||||
/* External functions or variables
|
||||
@@ -128,8 +126,10 @@ typedef void (*interface_func_t) (uint32_t len, const uint8_t*addr, bool end);
|
||||
extern int ble_osi_coex_funcs_register(struct osi_coex_funcs_t *coex_funcs);
|
||||
extern int ble_controller_init(esp_bt_controller_config_t *cfg);
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
extern int ble_log_init_async(interface_func_t bt_controller_log_interface, bool task_create, uint8_t buffers, uint32_t *bufs_size);
|
||||
extern int ble_log_init_async(interface_func_t interface, bool task_create, uint8_t buffers, uint32_t *bufs_size);
|
||||
extern int ble_log_deinit_async(void);
|
||||
extern int ble_log_init_simple(interface_func_t interface, void *handler);
|
||||
extern void ble_log_deinit_simple(void);
|
||||
extern void ble_log_async_output_dump_all(bool output);
|
||||
extern void esp_panic_handler_feed_wdts(void);
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
@@ -198,10 +198,12 @@ static int esp_ecc_gen_key_pair(uint8_t *pub, uint8_t *priv);
|
||||
static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer_pub_key_y,
|
||||
const uint8_t *our_priv_key, uint8_t *out_dhkey);
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end);
|
||||
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag);
|
||||
#endif // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
static void esp_bt_ctrl_log_partition_get_and_erase_first_block(void);
|
||||
#endif // #if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
/* Local variable definition
|
||||
***************************************************************************
|
||||
@@ -211,50 +213,29 @@ void *g_ble_lll_rfmgmt_env_p;
|
||||
#endif
|
||||
/* Static variable declare */
|
||||
static DRAM_ATTR esp_bt_controller_status_t ble_controller_status = ESP_BT_CONTROLLER_STATUS_IDLE;
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
const static uint32_t log_bufs_size[] = {CONFIG_BT_LE_LOG_CTRL_BUF1_SIZE, CONFIG_BT_LE_LOG_HCI_BUF_SIZE, CONFIG_BT_LE_LOG_CTRL_BUF2_SIZE};
|
||||
enum log_out_mode {
|
||||
LOG_DUMP_MEMORY,
|
||||
LOG_ASYNC_OUT,
|
||||
LOG_STORAGE_TO_FLASH,
|
||||
LOG_SPI_OUT,
|
||||
};
|
||||
static bool log_is_inited = false;
|
||||
|
||||
bool log_is_inited = false;
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
|
||||
uint8_t log_output_mode = LOG_DUMP_MEMORY;
|
||||
#else
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
uint8_t log_output_mode = LOG_STORAGE_TO_FLASH;
|
||||
#elif CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
uint8_t log_output_mode = LOG_SPI_OUT;
|
||||
#else
|
||||
uint8_t log_output_mode = LOG_ASYNC_OUT;
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
|
||||
|
||||
void esp_bt_log_output_mode_set(uint8_t output_mode)
|
||||
esp_err_t esp_bt_controller_log_init(void)
|
||||
{
|
||||
log_output_mode = output_mode;
|
||||
}
|
||||
|
||||
uint8_t esp_bt_log_output_mode_get(void)
|
||||
{
|
||||
return log_output_mode;
|
||||
}
|
||||
|
||||
esp_err_t esp_bt_controller_log_init(uint8_t log_output_mode)
|
||||
{
|
||||
esp_err_t ret = ESP_OK;
|
||||
interface_func_t bt_controller_log_interface;
|
||||
bt_controller_log_interface = esp_bt_controller_log_interface;
|
||||
bool task_create;
|
||||
uint8_t buffers = 0;
|
||||
|
||||
if (log_is_inited) {
|
||||
return ret;
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
if (ble_log_spi_out_init() != 0) {
|
||||
goto spi_out_init_failed;
|
||||
}
|
||||
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
if (ble_log_init_simple(ble_log_spi_out_ll_write, ble_log_spi_out_ll_log_ev_proc) != 0) {
|
||||
goto log_init_failed;
|
||||
}
|
||||
#else // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
uint8_t buffers = 0;
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
|
||||
buffers |= ESP_BLE_LOG_BUF_CONTROLLER;
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
|
||||
@@ -262,44 +243,41 @@ esp_err_t esp_bt_controller_log_init(uint8_t log_output_mode)
|
||||
buffers |= ESP_BLE_LOG_BUF_HCI;
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
|
||||
|
||||
switch (log_output_mode) {
|
||||
case LOG_DUMP_MEMORY:
|
||||
task_create = false;
|
||||
break;
|
||||
case LOG_ASYNC_OUT:
|
||||
case LOG_STORAGE_TO_FLASH:
|
||||
task_create = true;
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
if (log_output_mode == LOG_STORAGE_TO_FLASH) {
|
||||
esp_bt_ctrl_log_partition_get_and_erase_first_block();
|
||||
}
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
break;
|
||||
case LOG_SPI_OUT:
|
||||
task_create = true;
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
ble_log_spi_out_init();
|
||||
bt_controller_log_interface = ble_log_spi_out_write_esp;
|
||||
bool task_create = true;
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
|
||||
task_create = false;
|
||||
#elif CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
esp_bt_ctrl_log_partition_get_and_erase_first_block();
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
}
|
||||
|
||||
ret = ble_log_init_async(bt_controller_log_interface, task_create, buffers, (uint32_t *)log_bufs_size);
|
||||
if (ret == ESP_OK) {
|
||||
log_is_inited = true;
|
||||
if (ble_log_init_async(esp_bt_controller_log_interface, task_create, buffers, (uint32_t *)log_bufs_size) != 0) {
|
||||
goto log_init_failed;
|
||||
}
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
|
||||
return ret;
|
||||
log_is_inited = true;
|
||||
return ESP_OK;
|
||||
|
||||
log_init_failed:
|
||||
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
ble_log_spi_out_deinit();
|
||||
spi_out_init_failed:
|
||||
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
return ESP_FAIL;
|
||||
}
|
||||
|
||||
void esp_bt_ontroller_log_deinit(void)
|
||||
void esp_bt_controller_log_deinit(void)
|
||||
{
|
||||
ble_log_deinit_async();
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
ble_log_spi_out_deinit();
|
||||
#endif
|
||||
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
ble_log_deinit_simple();
|
||||
#else // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
ble_log_deinit_async();
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
|
||||
log_is_inited = false;
|
||||
}
|
||||
|
||||
@@ -394,11 +372,11 @@ void esp_bt_read_ctrl_log_from_flash(bool output)
|
||||
portENTER_CRITICAL_SAFE(&spinlock);
|
||||
esp_panic_handler_feed_wdts();
|
||||
ble_log_async_output_dump_all(true);
|
||||
esp_bt_controller_log_deinit();
|
||||
stop_write = true;
|
||||
esp_bt_ontroller_log_deinit();
|
||||
portEXIT_CRITICAL_SAFE(&spinlock);
|
||||
|
||||
buffer = (const uint8_t *)mapped_ptr;
|
||||
esp_panic_handler_feed_wdts();
|
||||
if (is_filled) {
|
||||
read_index = next_erase_index;
|
||||
} else {
|
||||
@@ -410,7 +388,7 @@ void esp_bt_read_ctrl_log_from_flash(bool output)
|
||||
while (read_index != write_index) {
|
||||
esp_rom_printf("%02x ", buffer[read_index]);
|
||||
if (print_len > max_print_len) {
|
||||
vTaskDelay(2);
|
||||
esp_panic_handler_feed_wdts();
|
||||
print_len = 0;
|
||||
}
|
||||
|
||||
@@ -418,45 +396,55 @@ void esp_bt_read_ctrl_log_from_flash(bool output)
|
||||
read_index = (read_index + 1) % MAX_STORAGE_SIZE;
|
||||
}
|
||||
esp_rom_printf(":DUMP_END]\r\n");
|
||||
portEXIT_CRITICAL_SAFE(&spinlock);
|
||||
esp_partition_munmap(mmap_handle);
|
||||
err = esp_bt_controller_log_init(log_output_mode);
|
||||
err = esp_bt_controller_log_init();
|
||||
assert(err == ESP_OK);
|
||||
|
||||
}
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end)
|
||||
{
|
||||
if (log_output_mode == LOG_STORAGE_TO_FLASH) {
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
esp_bt_controller_log_storage(len, addr, end);
|
||||
#endif //CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
} else {
|
||||
for (int i = 0; i < len; i++) {
|
||||
esp_rom_printf("%02x ", addr[i]);
|
||||
}
|
||||
|
||||
if (end) {
|
||||
esp_rom_printf("\n");
|
||||
}
|
||||
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag)
|
||||
{
|
||||
bool end = flag ? true : false;
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
esp_bt_controller_log_storage(len, addr, end);
|
||||
#else // !CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
|
||||
portENTER_CRITICAL_SAFE(&spinlock);
|
||||
esp_panic_handler_feed_wdts();
|
||||
for (int i = 0; i < len; i++) {
|
||||
esp_rom_printf("%02x ", addr[i]);
|
||||
}
|
||||
|
||||
if (end) {
|
||||
esp_rom_printf("\n");
|
||||
}
|
||||
portEXIT_CRITICAL_SAFE(&spinlock);
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
}
|
||||
#endif // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
|
||||
void esp_ble_controller_log_dump_all(bool output)
|
||||
{
|
||||
if (log_output_mode == LOG_STORAGE_TO_FLASH) {
|
||||
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
ble_log_spi_out_dump_all();
|
||||
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
esp_bt_read_ctrl_log_from_flash(output);
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
} else {
|
||||
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
|
||||
portENTER_CRITICAL_SAFE(&spinlock);
|
||||
esp_panic_handler_feed_wdts();
|
||||
BT_ASSERT_PRINT("\r\n[DUMP_START:");
|
||||
ble_log_async_output_dump_all(output);
|
||||
BT_ASSERT_PRINT(":DUMP_END]\r\n");
|
||||
portEXIT_CRITICAL_SAFE(&spinlock);
|
||||
}
|
||||
esp_bt_read_ctrl_log_from_flash(output);
|
||||
#elif !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
|
||||
portENTER_CRITICAL_SAFE(&spinlock);
|
||||
esp_panic_handler_feed_wdts();
|
||||
BT_ASSERT_PRINT("\r\n[DUMP_START:");
|
||||
ble_log_async_output_dump_all(output);
|
||||
BT_ASSERT_PRINT(":DUMP_END]\r\n");
|
||||
portEXIT_CRITICAL_SAFE(&spinlock);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_TASK_WDT_USER_HANDLER_ENABLE
|
||||
void esp_task_wdt_isr_user_handler(void)
|
||||
{
|
||||
@@ -876,7 +864,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
||||
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "ble rom commit:[%s]", r_ble_controller_get_rom_compile_version());
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
ret = esp_bt_controller_log_init(log_output_mode);
|
||||
ret = esp_bt_controller_log_init();
|
||||
if (ret != ESP_OK) {
|
||||
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_controller_log_init failed %d", ret);
|
||||
goto controller_init_err;
|
||||
@@ -917,7 +905,7 @@ free_controller:
|
||||
controller_sleep_deinit();
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
controller_init_err:
|
||||
esp_bt_ontroller_log_deinit();
|
||||
esp_bt_controller_log_deinit();
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
ble_controller_deinit();
|
||||
modem_deint:
|
||||
@@ -946,7 +934,7 @@ esp_err_t esp_bt_controller_deinit(void)
|
||||
controller_sleep_deinit();
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
esp_bt_ontroller_log_deinit();
|
||||
esp_bt_controller_log_deinit();
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
ble_controller_deinit();
|
||||
|
||||
|
@@ -226,6 +226,32 @@ extern "C" {
|
||||
#define DEFAULT_BT_LE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS (0)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BT_LE_CTRL_LLCP_CONN_UPDATE
|
||||
#define BT_CTRL_BLE_LLCP_CONN_UPDATE (1<<0)
|
||||
#else
|
||||
#define BT_CTRL_BLE_LLCP_CONN_UPDATE (0<<0)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BT_LE_CTRL_LLCP_CHAN_MAP_UPDATE
|
||||
#define BT_CTRL_BLE_LLCP_CHAN_MAP_UPDATE (1<<1)
|
||||
#else
|
||||
#define BT_CTRL_BLE_LLCP_CHAN_MAP_UPDATE (0<<1)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BT_LE_CTRL_LLCP_PHY_UPDATE
|
||||
#define BT_CTRL_BLE_LLCP_PHY_UPDATE (1<<2)
|
||||
#else
|
||||
#define BT_CTRL_BLE_LLCP_PHY_UPDATE (0<<2)
|
||||
#endif
|
||||
|
||||
#define BT_LE_CTRL_LLCP_DISC_FLAG (BT_CTRL_BLE_LLCP_CONN_UPDATE | BT_CTRL_BLE_LLCP_CHAN_MAP_UPDATE | BT_CTRL_BLE_LLCP_PHY_UPDATE)
|
||||
|
||||
#ifdef CONFIG_BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX
|
||||
#define BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX (CONFIG_BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX)
|
||||
#else
|
||||
#define BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX (256)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART
|
||||
#define HCI_UART_EN CONFIG_BT_LE_HCI_INTERFACE_USE_UART
|
||||
#else
|
||||
|
@@ -539,7 +539,7 @@ static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, b
|
||||
#if CONFIG_BT_CTRL_LE_LOG_SPI_OUT_EN
|
||||
static IRAM_ATTR void esp_bt_controller_spi_log_interface(uint32_t len, const uint8_t *addr, bool end)
|
||||
{
|
||||
return ble_log_spi_out_write(BLE_LOG_SPI_OUT_SOURCE_ESP_LEGACY, addr, len);
|
||||
ble_log_spi_out_write(BLE_LOG_SPI_OUT_SOURCE_ESP_LEGACY, addr, len);
|
||||
}
|
||||
#endif // CONFIG_BT_CTRL_LE_LOG_SPI_OUT_EN
|
||||
|
||||
@@ -1755,7 +1755,10 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
||||
#endif
|
||||
|
||||
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
ble_log_spi_out_init();
|
||||
if (ble_log_spi_out_init() != 0) {
|
||||
ESP_LOGE(BT_LOG_TAG, "BLE Log SPI output init failed");
|
||||
goto error;
|
||||
}
|
||||
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
|
||||
periph_module_enable(PERIPH_BT_MODULE);
|
||||
@@ -1790,6 +1793,10 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
||||
|
||||
error:
|
||||
|
||||
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
ble_log_spi_out_deinit();
|
||||
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
|
||||
bt_controller_deinit_internal();
|
||||
|
||||
return err;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -57,6 +57,11 @@
|
||||
|
||||
#include "hal/efuse_hal.h"
|
||||
#include "soc/rtc.h"
|
||||
|
||||
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
#include "ble_log/ble_log_spi_out.h"
|
||||
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
|
||||
/* Macro definition
|
||||
************************************************************************
|
||||
*/
|
||||
@@ -100,7 +105,7 @@ struct ext_funcs_t {
|
||||
};
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
typedef void (*interface_func_t) (uint32_t len, const uint8_t*addr, bool end);
|
||||
typedef void (*interface_func_t) (uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag);
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
|
||||
/* External functions or variables
|
||||
@@ -109,8 +114,10 @@ typedef void (*interface_func_t) (uint32_t len, const uint8_t*addr, bool end);
|
||||
extern int ble_osi_coex_funcs_register(struct osi_coex_funcs_t *coex_funcs);
|
||||
extern int r_ble_controller_init(esp_bt_controller_config_t *cfg);
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
extern int r_ble_log_init_async(interface_func_t bt_controller_log_interface, bool task_create, uint8_t buffers, uint32_t *bufs_size);
|
||||
extern int r_ble_log_init_async(interface_func_t interface, bool task_create, uint8_t buffers, uint32_t *bufs_size);
|
||||
extern int r_ble_log_deinit_async(void);
|
||||
extern int r_ble_log_init_simple(interface_func_t interface, void *handler);
|
||||
extern void r_ble_log_deinit_simple(void);
|
||||
extern void r_ble_log_async_select_dump_buffers(uint8_t buffers);
|
||||
extern void r_ble_log_async_output_dump_all(bool output);
|
||||
extern void esp_panic_handler_feed_wdts(void);
|
||||
@@ -173,15 +180,232 @@ static int esp_ecc_gen_key_pair(uint8_t *pub, uint8_t *priv);
|
||||
static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer_pub_key_y,
|
||||
const uint8_t *our_priv_key, uint8_t *out_dhkey);
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end);
|
||||
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag);
|
||||
#endif // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
static void esp_bt_ctrl_log_partition_get_and_erase_first_block(void);
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
/* Local variable definition
|
||||
***************************************************************************
|
||||
*/
|
||||
/* Static variable declare */
|
||||
static DRAM_ATTR esp_bt_controller_status_t ble_controller_status = ESP_BT_CONTROLLER_STATUS_IDLE;
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
const static uint32_t log_bufs_size[] = {CONFIG_BT_LE_LOG_CTRL_BUF1_SIZE, CONFIG_BT_LE_LOG_HCI_BUF_SIZE, CONFIG_BT_LE_LOG_CTRL_BUF2_SIZE};
|
||||
static bool log_is_inited = false;
|
||||
|
||||
esp_err_t esp_bt_controller_log_init(void)
|
||||
{
|
||||
if (log_is_inited) {
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
if (ble_log_spi_out_init() != 0) {
|
||||
goto spi_out_init_failed;
|
||||
}
|
||||
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
if (r_ble_log_init_simple(ble_log_spi_out_ll_write, ble_log_spi_out_ll_log_ev_proc) != 0) {
|
||||
goto log_init_failed;
|
||||
}
|
||||
#else // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
uint8_t buffers = 0;
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
|
||||
buffers |= ESP_BLE_LOG_BUF_CONTROLLER;
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
|
||||
buffers |= ESP_BLE_LOG_BUF_HCI;
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
|
||||
|
||||
bool task_create = true;
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
|
||||
task_create = false;
|
||||
#elif CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
esp_bt_ctrl_log_partition_get_and_erase_first_block();
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
|
||||
if (r_ble_log_init_async(esp_bt_controller_log_interface, task_create, buffers, (uint32_t *)log_bufs_size) != 0) {
|
||||
goto log_init_failed;
|
||||
}
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
|
||||
if (r_ble_log_ctrl_level_and_mod(CONFIG_BT_LE_CONTROLLER_LOG_OUTPUT_LEVEL, CONFIG_BT_LE_CONTROLLER_LOG_MOD_OUTPUT_SWITCH) != ESP_OK) {
|
||||
goto ctrl_level_init_failed;
|
||||
}
|
||||
log_is_inited = true;
|
||||
return ESP_OK;
|
||||
|
||||
ctrl_level_init_failed:
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
r_ble_log_deinit_simple();
|
||||
#else // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
r_ble_log_deinit_async();
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
log_init_failed:
|
||||
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
ble_log_spi_out_deinit();
|
||||
spi_out_init_failed:
|
||||
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
return ESP_FAIL;
|
||||
}
|
||||
|
||||
void esp_bt_controller_log_deinit(void)
|
||||
{
|
||||
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
ble_log_spi_out_deinit();
|
||||
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
r_ble_log_deinit_simple();
|
||||
#else // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
r_ble_log_deinit_async();
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
|
||||
log_is_inited = false;
|
||||
}
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
#include "esp_partition.h"
|
||||
#include "hal/wdt_hal.h"
|
||||
|
||||
#define MAX_STORAGE_SIZE (CONFIG_BT_LE_CONTROLLER_LOG_PARTITION_SIZE)
|
||||
#define BLOCK_SIZE (4096)
|
||||
#define THRESHOLD (3072)
|
||||
#define PARTITION_NAME "bt_ctrl_log"
|
||||
|
||||
static const esp_partition_t *log_partition;
|
||||
static uint32_t write_index = 0;
|
||||
static uint32_t next_erase_index = BLOCK_SIZE;
|
||||
static bool block_erased = false;
|
||||
static bool stop_write = false;
|
||||
static bool is_filled = false;
|
||||
|
||||
static void esp_bt_ctrl_log_partition_get_and_erase_first_block(void)
|
||||
{
|
||||
log_partition = NULL;
|
||||
assert(MAX_STORAGE_SIZE % BLOCK_SIZE == 0);
|
||||
// Find the partition map in the partition table
|
||||
log_partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_ANY, PARTITION_NAME);
|
||||
assert(log_partition != NULL);
|
||||
// Prepare data to be read later using the mapped address
|
||||
ESP_ERROR_CHECK(esp_partition_erase_range(log_partition, 0, BLOCK_SIZE));
|
||||
write_index = 0;
|
||||
next_erase_index = BLOCK_SIZE;
|
||||
block_erased = false;
|
||||
is_filled = false;
|
||||
stop_write = false;
|
||||
}
|
||||
|
||||
static int esp_bt_controller_log_storage(uint32_t len, const uint8_t *addr, bool end)
|
||||
{
|
||||
if (len > MAX_STORAGE_SIZE) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (stop_write) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (((write_index) % BLOCK_SIZE) >= THRESHOLD && !block_erased) {
|
||||
// esp_rom_printf("Ers nxt: %d,%d\n", next_erase_index, write_index);
|
||||
esp_partition_erase_range(log_partition, next_erase_index, BLOCK_SIZE);
|
||||
next_erase_index = (next_erase_index + BLOCK_SIZE) % MAX_STORAGE_SIZE;
|
||||
block_erased = true;
|
||||
}
|
||||
|
||||
if (((write_index + len) / BLOCK_SIZE) > (write_index / BLOCK_SIZE)) {
|
||||
block_erased = false;
|
||||
}
|
||||
|
||||
if (write_index + len <= MAX_STORAGE_SIZE) {
|
||||
esp_partition_write(log_partition, write_index, addr, len);
|
||||
write_index = (write_index + len) % MAX_STORAGE_SIZE;
|
||||
} else {
|
||||
uint32_t first_part_len = MAX_STORAGE_SIZE - write_index;
|
||||
esp_partition_write(log_partition, write_index, addr, first_part_len);
|
||||
esp_partition_write(log_partition, 0, addr + first_part_len, len - first_part_len);
|
||||
write_index = len - first_part_len;
|
||||
is_filled = true;
|
||||
// esp_rom_printf("old idx: %d,%d\n",next_erase_index, write_index);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void esp_bt_read_ctrl_log_from_flash(bool output)
|
||||
{
|
||||
esp_partition_mmap_handle_t mmap_handle;
|
||||
uint32_t read_index;
|
||||
const void *mapped_ptr;
|
||||
const uint8_t *buffer;
|
||||
uint32_t print_len;
|
||||
uint32_t max_print_len;
|
||||
esp_err_t err;
|
||||
|
||||
print_len = 0;
|
||||
max_print_len = 4096;
|
||||
err = esp_partition_mmap(log_partition, 0, MAX_STORAGE_SIZE, ESP_PARTITION_MMAP_DATA, &mapped_ptr, &mmap_handle);
|
||||
if (err != ESP_OK) {
|
||||
ESP_LOGE("FLASH", "Mmap failed: %s", esp_err_to_name(err));
|
||||
return;
|
||||
}
|
||||
|
||||
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
|
||||
portENTER_CRITICAL_SAFE(&spinlock);
|
||||
esp_panic_handler_feed_wdts();
|
||||
r_ble_log_async_output_dump_all(true);
|
||||
esp_bt_controller_log_deinit();
|
||||
stop_write = true;
|
||||
|
||||
buffer = (const uint8_t *)mapped_ptr;
|
||||
esp_panic_handler_feed_wdts();
|
||||
if (is_filled) {
|
||||
read_index = next_erase_index;
|
||||
} else {
|
||||
read_index = 0;
|
||||
}
|
||||
|
||||
esp_rom_printf("\r\nREAD_CHECK:%ld,%ld,%d\r\n",read_index, write_index, is_filled);
|
||||
esp_rom_printf("\r\n[DUMP_START:");
|
||||
while (read_index != write_index) {
|
||||
esp_rom_printf("%02x ", buffer[read_index]);
|
||||
if (print_len > max_print_len) {
|
||||
esp_panic_handler_feed_wdts();
|
||||
print_len = 0;
|
||||
}
|
||||
|
||||
print_len++;
|
||||
read_index = (read_index + 1) % MAX_STORAGE_SIZE;
|
||||
}
|
||||
|
||||
esp_rom_printf(":DUMP_END]\r\n");
|
||||
portEXIT_CRITICAL_SAFE(&spinlock);
|
||||
esp_partition_munmap(mmap_handle);
|
||||
err = esp_bt_controller_log_init();
|
||||
assert(err == ESP_OK);
|
||||
}
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_TASK_WDT_USER_HANDLER_ENABLE
|
||||
void esp_task_wdt_isr_user_handler(void)
|
||||
{
|
||||
esp_ble_controller_log_dump_all(true);
|
||||
}
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_TASK_WDT_USER_HANDLER_ENABLE
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_WRAP_PANIC_HANDLER_ENABLE
|
||||
void __real_esp_panic_handler(void *info);
|
||||
void __wrap_esp_panic_handler (void *info)
|
||||
{
|
||||
esp_ble_controller_log_dump_all(true);
|
||||
__real_esp_panic_handler(info);
|
||||
}
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_WRAP_PANIC_HANDLER_ENABLE
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
|
||||
/* This variable tells if BLE is running */
|
||||
@@ -664,20 +888,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
||||
#endif // CONFIG_SW_COEXIST_ENABLE
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
interface_func_t bt_controller_log_interface;
|
||||
bt_controller_log_interface = esp_bt_controller_log_interface;
|
||||
uint8_t buffers = 0;
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
|
||||
buffers |= ESP_BLE_LOG_BUF_CONTROLLER;
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
|
||||
buffers |= ESP_BLE_LOG_BUF_HCI;
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
|
||||
ret = r_ble_log_init_async(bt_controller_log_interface, false, buffers, (uint32_t *)log_bufs_size);
|
||||
#else
|
||||
ret = r_ble_log_init_async(bt_controller_log_interface, true, buffers, (uint32_t *)log_bufs_size);
|
||||
#endif // CONFIG_BT_CONTROLLER_LOG_DUMP
|
||||
ret = esp_bt_controller_log_init();
|
||||
if (ret != ESP_OK) {
|
||||
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_controller_log_init failed %d", ret);
|
||||
goto modem_deint;
|
||||
@@ -738,7 +949,7 @@ free_controller:
|
||||
modem_deint:
|
||||
esp_ble_unregister_bb_funcs();
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
r_ble_log_deinit_async();
|
||||
esp_bt_controller_log_deinit();
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
esp_phy_modem_deinit();
|
||||
// modem_clock_deselect_lp_clock_source(PERIPH_BT_MODULE);
|
||||
@@ -774,7 +985,7 @@ esp_err_t esp_bt_controller_deinit(void)
|
||||
r_ble_controller_deinit();
|
||||
esp_ble_unregister_bb_funcs();
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
r_ble_log_deinit_async();
|
||||
esp_bt_controller_log_deinit();
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
|
||||
#if CONFIG_BT_NIMBLE_ENABLED
|
||||
@@ -1092,26 +1303,45 @@ esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t po
|
||||
}
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end)
|
||||
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag)
|
||||
{
|
||||
bool end = flag ? true : false;
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
esp_bt_controller_log_storage(len, addr, end);
|
||||
#else // !CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
|
||||
portENTER_CRITICAL_SAFE(&spinlock);
|
||||
esp_panic_handler_feed_wdts();
|
||||
for (int i = 0; i < len; i++) {
|
||||
esp_rom_printf("%02x ", addr[i]);
|
||||
}
|
||||
|
||||
if (end) {
|
||||
esp_rom_printf("\n");
|
||||
}
|
||||
portEXIT_CRITICAL_SAFE(&spinlock);
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
}
|
||||
#endif // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
|
||||
void esp_ble_controller_log_dump_all(bool output)
|
||||
{
|
||||
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
|
||||
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
ble_log_spi_out_dump_all();
|
||||
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
esp_bt_read_ctrl_log_from_flash(output);
|
||||
#elif !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
|
||||
portENTER_CRITICAL_SAFE(&spinlock);
|
||||
esp_panic_handler_feed_wdts();
|
||||
BT_ASSERT_PRINT("\r\n[DUMP_START:");
|
||||
r_ble_log_async_output_dump_all(output);
|
||||
BT_ASSERT_PRINT(":DUMP_END]\r\n");
|
||||
portEXIT_CRITICAL_SAFE(&spinlock);
|
||||
#endif
|
||||
}
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -38,9 +38,14 @@ 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
|
||||
@@ -57,12 +62,20 @@ void ble_stack_enableVsCmds(bool 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)
|
||||
|
||||
|
@@ -61,11 +61,9 @@
|
||||
#include "hal/efuse_hal.h"
|
||||
#include "soc/rtc.h"
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
#include "ble_log/ble_log_spi_out.h"
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
|
||||
/* Macro definition
|
||||
************************************************************************
|
||||
@@ -110,7 +108,7 @@ struct ext_funcs_t {
|
||||
};
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
typedef void (*interface_func_t) (uint32_t len, const uint8_t*addr, bool end);
|
||||
typedef void (*interface_func_t) (uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag);
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
|
||||
/* External functions or variables
|
||||
@@ -120,8 +118,10 @@ extern int ble_osi_coex_funcs_register(struct osi_coex_funcs_t *coex_funcs);
|
||||
extern int r_ble_controller_init(esp_bt_controller_config_t *cfg);
|
||||
extern void esp_ble_controller_info_capture(uint32_t cycle_times);
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
extern int r_ble_log_init_async(interface_func_t bt_controller_log_interface, bool task_create, uint8_t buffers, uint32_t *bufs_size);
|
||||
extern int r_ble_log_init_async(interface_func_t interface, bool task_create, uint8_t buffers, uint32_t *bufs_size);
|
||||
extern int r_ble_log_deinit_async(void);
|
||||
extern int r_ble_log_init_simple(interface_func_t interface, void *handler);
|
||||
extern void r_ble_log_deinit_simple(void);
|
||||
extern void r_ble_log_async_select_dump_buffers(uint8_t buffers);
|
||||
extern void r_ble_log_async_output_dump_all(bool output);
|
||||
extern void esp_panic_handler_feed_wdts(void);
|
||||
@@ -190,60 +190,41 @@ static int esp_ecc_gen_key_pair(uint8_t *pub, uint8_t *priv);
|
||||
static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer_pub_key_y,
|
||||
const uint8_t *our_priv_key, uint8_t *out_dhkey);
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end);
|
||||
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag);
|
||||
#endif // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
static void esp_bt_ctrl_log_partition_get_and_erase_first_block(void);
|
||||
#endif // #if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
/* Local variable definition
|
||||
***************************************************************************
|
||||
*/
|
||||
/* Static variable declare */
|
||||
static DRAM_ATTR esp_bt_controller_status_t ble_controller_status = ESP_BT_CONTROLLER_STATUS_IDLE;
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
const static uint32_t log_bufs_size[] = {CONFIG_BT_LE_LOG_CTRL_BUF1_SIZE, CONFIG_BT_LE_LOG_HCI_BUF_SIZE, CONFIG_BT_LE_LOG_CTRL_BUF2_SIZE};
|
||||
enum log_out_mode {
|
||||
LOG_DUMP_MEMORY,
|
||||
LOG_ASYNC_OUT,
|
||||
LOG_STORAGE_TO_FLASH,
|
||||
LOG_SPI_OUT,
|
||||
};
|
||||
static bool log_is_inited = false;
|
||||
|
||||
bool log_is_inited = false;
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
|
||||
uint8_t log_output_mode = LOG_DUMP_MEMORY;
|
||||
#else
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
uint8_t log_output_mode = LOG_STORAGE_TO_FLASH;
|
||||
#elif CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
uint8_t log_output_mode = LOG_SPI_OUT;
|
||||
#else
|
||||
uint8_t log_output_mode = LOG_ASYNC_OUT;
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
|
||||
|
||||
void esp_bt_log_output_mode_set(uint8_t output_mode)
|
||||
esp_err_t esp_bt_controller_log_init(void)
|
||||
{
|
||||
log_output_mode = output_mode;
|
||||
}
|
||||
|
||||
uint8_t esp_bt_log_output_mode_get(void)
|
||||
{
|
||||
return log_output_mode;
|
||||
}
|
||||
|
||||
esp_err_t esp_bt_controller_log_init(uint8_t log_output_mode)
|
||||
{
|
||||
esp_err_t ret = ESP_OK;
|
||||
interface_func_t bt_controller_log_interface;
|
||||
bt_controller_log_interface = esp_bt_controller_log_interface;
|
||||
bool task_create;
|
||||
uint8_t buffers = 0;
|
||||
|
||||
if (log_is_inited) {
|
||||
return ret;
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
if (ble_log_spi_out_init() != 0) {
|
||||
goto spi_out_init_failed;
|
||||
}
|
||||
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
if (r_ble_log_init_simple(ble_log_spi_out_ll_write, ble_log_spi_out_ll_log_ev_proc) != 0) {
|
||||
goto log_init_failed;
|
||||
}
|
||||
#else // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
uint8_t buffers = 0;
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
|
||||
buffers |= ESP_BLE_LOG_BUF_CONTROLLER;
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
|
||||
@@ -251,48 +232,50 @@ esp_err_t esp_bt_controller_log_init(uint8_t log_output_mode)
|
||||
buffers |= ESP_BLE_LOG_BUF_HCI;
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
|
||||
|
||||
switch (log_output_mode) {
|
||||
case LOG_DUMP_MEMORY:
|
||||
task_create = false;
|
||||
break;
|
||||
case LOG_ASYNC_OUT:
|
||||
case LOG_STORAGE_TO_FLASH:
|
||||
task_create = true;
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
if (log_output_mode == LOG_STORAGE_TO_FLASH) {
|
||||
esp_bt_ctrl_log_partition_get_and_erase_first_block();
|
||||
}
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
break;
|
||||
case LOG_SPI_OUT:
|
||||
task_create = true;
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
ble_log_spi_out_init();
|
||||
bt_controller_log_interface = ble_log_spi_out_write_esp;
|
||||
bool task_create = true;
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
|
||||
task_create = false;
|
||||
#elif CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
esp_bt_ctrl_log_partition_get_and_erase_first_block();
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
}
|
||||
|
||||
ret = r_ble_log_init_async(bt_controller_log_interface, task_create, buffers, (uint32_t *)log_bufs_size);
|
||||
if (ret != ESP_OK) {
|
||||
return ret;
|
||||
if (r_ble_log_init_async(esp_bt_controller_log_interface, task_create, buffers, (uint32_t *)log_bufs_size) != 0) {
|
||||
goto log_init_failed;
|
||||
}
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
|
||||
ret = r_ble_log_ctrl_level_and_mod(CONFIG_BT_LE_CONTROLLER_LOG_OUTPUT_LEVEL, CONFIG_BT_LE_CONTROLLER_LOG_MOD_OUTPUT_SWITCH);
|
||||
if (ret == ESP_OK) {
|
||||
log_is_inited = true;
|
||||
if (r_ble_log_ctrl_level_and_mod(CONFIG_BT_LE_CONTROLLER_LOG_OUTPUT_LEVEL, CONFIG_BT_LE_CONTROLLER_LOG_MOD_OUTPUT_SWITCH) != ESP_OK) {
|
||||
goto ctrl_level_init_failed;
|
||||
}
|
||||
return ret;
|
||||
log_is_inited = true;
|
||||
return ESP_OK;
|
||||
|
||||
ctrl_level_init_failed:
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
r_ble_log_deinit_simple();
|
||||
#else // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
r_ble_log_deinit_async();
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
log_init_failed:
|
||||
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
ble_log_spi_out_deinit();
|
||||
spi_out_init_failed:
|
||||
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
return ESP_FAIL;
|
||||
}
|
||||
|
||||
void esp_bt_ontroller_log_deinit(void)
|
||||
void esp_bt_controller_log_deinit(void)
|
||||
{
|
||||
r_ble_log_deinit_async();
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
ble_log_spi_out_deinit();
|
||||
#endif
|
||||
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
r_ble_log_deinit_simple();
|
||||
#else // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
r_ble_log_deinit_async();
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
|
||||
log_is_inited = false;
|
||||
}
|
||||
|
||||
@@ -386,7 +369,7 @@ void esp_bt_read_ctrl_log_from_flash(bool output)
|
||||
portENTER_CRITICAL_SAFE(&spinlock);
|
||||
esp_panic_handler_feed_wdts();
|
||||
r_ble_log_async_output_dump_all(true);
|
||||
esp_bt_ontroller_log_deinit();
|
||||
esp_bt_controller_log_deinit();
|
||||
stop_write = true;
|
||||
|
||||
buffer = (const uint8_t *)mapped_ptr;
|
||||
@@ -948,7 +931,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
||||
#endif // CONFIG_SW_COEXIST_ENABLE
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
ret = esp_bt_controller_log_init(log_output_mode);
|
||||
ret = esp_bt_controller_log_init();
|
||||
if (ret != ESP_OK) {
|
||||
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_controller_log_init failed %d", ret);
|
||||
goto modem_deint;
|
||||
@@ -1020,7 +1003,7 @@ free_controller:
|
||||
modem_deint:
|
||||
esp_ble_unregister_bb_funcs();
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
esp_bt_ontroller_log_deinit();
|
||||
esp_bt_controller_log_deinit();
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
esp_phy_modem_deinit();
|
||||
modem_clock_deselect_lp_clock_source(PERIPH_BT_MODULE);
|
||||
@@ -1057,7 +1040,7 @@ esp_err_t esp_bt_controller_deinit(void)
|
||||
r_ble_controller_deinit();
|
||||
esp_ble_unregister_bb_funcs();
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
esp_bt_ontroller_log_deinit();
|
||||
esp_bt_controller_log_deinit();
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
|
||||
#if CONFIG_BT_NIMBLE_ENABLED
|
||||
@@ -1405,42 +1388,45 @@ esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t po
|
||||
}
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end)
|
||||
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag)
|
||||
{
|
||||
if (log_output_mode == LOG_STORAGE_TO_FLASH) {
|
||||
bool end = flag ? true : false;
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
esp_bt_controller_log_storage(len, addr, end);
|
||||
#endif //CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
} else {
|
||||
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
|
||||
portENTER_CRITICAL_SAFE(&spinlock);
|
||||
esp_panic_handler_feed_wdts();
|
||||
for (int i = 0; i < len; i++) {
|
||||
esp_rom_printf("%02x ", addr[i]);
|
||||
}
|
||||
|
||||
if (end) {
|
||||
esp_rom_printf("\n");
|
||||
}
|
||||
portEXIT_CRITICAL_SAFE(&spinlock);
|
||||
esp_bt_controller_log_storage(len, addr, end);
|
||||
#else // !CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
|
||||
portENTER_CRITICAL_SAFE(&spinlock);
|
||||
esp_panic_handler_feed_wdts();
|
||||
for (int i = 0; i < len; i++) {
|
||||
esp_rom_printf("%02x ", addr[i]);
|
||||
}
|
||||
|
||||
if (end) {
|
||||
esp_rom_printf("\n");
|
||||
}
|
||||
portEXIT_CRITICAL_SAFE(&spinlock);
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
}
|
||||
#endif // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
|
||||
void esp_ble_controller_log_dump_all(bool output)
|
||||
{
|
||||
if (log_output_mode == LOG_STORAGE_TO_FLASH) {
|
||||
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
ble_log_spi_out_dump_all();
|
||||
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
esp_bt_read_ctrl_log_from_flash(output);
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
} else {
|
||||
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
|
||||
portENTER_CRITICAL_SAFE(&spinlock);
|
||||
esp_panic_handler_feed_wdts();
|
||||
BT_ASSERT_PRINT("\r\n[DUMP_START:");
|
||||
r_ble_log_async_output_dump_all(output);
|
||||
BT_ASSERT_PRINT(":DUMP_END]\r\n");
|
||||
portEXIT_CRITICAL_SAFE(&spinlock);
|
||||
}
|
||||
esp_bt_read_ctrl_log_from_flash(output);
|
||||
#elif !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
|
||||
portENTER_CRITICAL_SAFE(&spinlock);
|
||||
esp_panic_handler_feed_wdts();
|
||||
BT_ASSERT_PRINT("\r\n[DUMP_START:");
|
||||
r_ble_log_async_output_dump_all(output);
|
||||
BT_ASSERT_PRINT(":DUMP_END]\r\n");
|
||||
portEXIT_CRITICAL_SAFE(&spinlock);
|
||||
#endif
|
||||
}
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -1,6 +1,5 @@
|
||||
|
||||
menu "HCI Config"
|
||||
|
||||
choice BT_LE_HCI_INTERFACE
|
||||
prompt "HCI mode"
|
||||
default BT_LE_HCI_INTERFACE_USE_RAM
|
||||
@@ -438,6 +437,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
|
||||
|
@@ -38,9 +38,11 @@ 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);
|
||||
|
||||
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
|
||||
@@ -57,12 +59,17 @@ void ble_stack_enableVsCmds(bool en)
|
||||
chanSel_stack_enableSetCsaVsCmd(en);
|
||||
log_stack_enableLogsRelatedVsCmd(en);
|
||||
hci_stack_enableSetVsEvtMaskVsCmd(en);
|
||||
winWiden_stack_enableSetConstPeerScaVsCmd(en);
|
||||
}
|
||||
|
||||
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)
|
||||
|
||||
|
@@ -54,11 +54,9 @@
|
||||
#include "esp_sleep.h"
|
||||
#include "soc/rtc.h"
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
#include "ble_log/ble_log_spi_out.h"
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
|
||||
/* Macro definition
|
||||
************************************************************************
|
||||
@@ -103,7 +101,7 @@ struct ext_funcs_t {
|
||||
};
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
typedef void (*interface_func_t) (uint32_t len, const uint8_t*addr, bool end);
|
||||
typedef void (*interface_func_t) (uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag);
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
/* External functions or variables
|
||||
************************************************************************
|
||||
@@ -112,8 +110,10 @@ extern int ble_osi_coex_funcs_register(struct osi_coex_funcs_t *coex_funcs);
|
||||
extern int r_ble_controller_init(esp_bt_controller_config_t *cfg);
|
||||
extern void esp_ble_controller_info_capture(uint32_t cycle_times);
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
extern int r_ble_log_init_async(interface_func_t bt_controller_log_interface, bool task_create, uint8_t buffers, uint32_t *bufs_size);
|
||||
extern int r_ble_log_init_async(interface_func_t interface, bool task_create, uint8_t buffers, uint32_t *bufs_size);
|
||||
extern int r_ble_log_deinit_async(void);
|
||||
extern int r_ble_log_init_simple(interface_func_t interface, void *handler);
|
||||
extern void r_ble_log_deinit_simple(void);
|
||||
extern void r_ble_log_async_select_dump_buffers(uint8_t buffers);
|
||||
extern void r_ble_log_async_output_dump_all(bool output);
|
||||
extern void esp_panic_handler_feed_wdts(void);
|
||||
@@ -185,60 +185,41 @@ static int esp_ecc_gen_key_pair(uint8_t *pub, uint8_t *priv);
|
||||
static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer_pub_key_y,
|
||||
const uint8_t *our_priv_key, uint8_t *out_dhkey);
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end);
|
||||
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag);
|
||||
#endif // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
static void esp_bt_ctrl_log_partition_get_and_erase_first_block(void);
|
||||
#endif // #if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
/* Local variable definition
|
||||
***************************************************************************
|
||||
*/
|
||||
/* Static variable declare */
|
||||
static DRAM_ATTR esp_bt_controller_status_t ble_controller_status = ESP_BT_CONTROLLER_STATUS_IDLE;
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
const static uint32_t log_bufs_size[] = {CONFIG_BT_LE_LOG_CTRL_BUF1_SIZE, CONFIG_BT_LE_LOG_HCI_BUF_SIZE, CONFIG_BT_LE_LOG_CTRL_BUF2_SIZE};
|
||||
enum log_out_mode {
|
||||
LOG_DUMP_MEMORY,
|
||||
LOG_ASYNC_OUT,
|
||||
LOG_STORAGE_TO_FLASH,
|
||||
LOG_SPI_OUT,
|
||||
};
|
||||
static bool log_is_inited = false;
|
||||
|
||||
bool log_is_inited = false;
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
|
||||
uint8_t log_output_mode = LOG_DUMP_MEMORY;
|
||||
#else
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
uint8_t log_output_mode = LOG_STORAGE_TO_FLASH;
|
||||
#elif CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
uint8_t log_output_mode = LOG_SPI_OUT;
|
||||
#else
|
||||
uint8_t log_output_mode = LOG_ASYNC_OUT;
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
|
||||
|
||||
void esp_bt_log_output_mode_set(uint8_t output_mode)
|
||||
esp_err_t esp_bt_controller_log_init(void)
|
||||
{
|
||||
log_output_mode = output_mode;
|
||||
}
|
||||
|
||||
uint8_t esp_bt_log_output_mode_get(void)
|
||||
{
|
||||
return log_output_mode;
|
||||
}
|
||||
|
||||
esp_err_t esp_bt_controller_log_init(uint8_t log_output_mode)
|
||||
{
|
||||
esp_err_t ret = ESP_OK;
|
||||
interface_func_t bt_controller_log_interface;
|
||||
bt_controller_log_interface = esp_bt_controller_log_interface;
|
||||
bool task_create;
|
||||
uint8_t buffers = 0;
|
||||
|
||||
if (log_is_inited) {
|
||||
return ret;
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
if (ble_log_spi_out_init() != 0) {
|
||||
goto spi_out_init_failed;
|
||||
}
|
||||
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
if (r_ble_log_init_simple(ble_log_spi_out_ll_write, ble_log_spi_out_ll_log_ev_proc) != 0) {
|
||||
goto log_init_failed;
|
||||
}
|
||||
#else // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
uint8_t buffers = 0;
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
|
||||
buffers |= ESP_BLE_LOG_BUF_CONTROLLER;
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
|
||||
@@ -246,48 +227,50 @@ esp_err_t esp_bt_controller_log_init(uint8_t log_output_mode)
|
||||
buffers |= ESP_BLE_LOG_BUF_HCI;
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
|
||||
|
||||
switch (log_output_mode) {
|
||||
case LOG_DUMP_MEMORY:
|
||||
task_create = false;
|
||||
break;
|
||||
case LOG_ASYNC_OUT:
|
||||
case LOG_STORAGE_TO_FLASH:
|
||||
task_create = true;
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
if (log_output_mode == LOG_STORAGE_TO_FLASH) {
|
||||
esp_bt_ctrl_log_partition_get_and_erase_first_block();
|
||||
}
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
break;
|
||||
case LOG_SPI_OUT:
|
||||
task_create = true;
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
ble_log_spi_out_init();
|
||||
bt_controller_log_interface = ble_log_spi_out_write_esp;
|
||||
bool task_create = true;
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
|
||||
task_create = false;
|
||||
#elif CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
esp_bt_ctrl_log_partition_get_and_erase_first_block();
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
}
|
||||
|
||||
ret = r_ble_log_init_async(bt_controller_log_interface, task_create, buffers, (uint32_t *)log_bufs_size);
|
||||
if (ret != ESP_OK) {
|
||||
return ret;
|
||||
if (r_ble_log_init_async(esp_bt_controller_log_interface, task_create, buffers, (uint32_t *)log_bufs_size) != 0) {
|
||||
goto log_init_failed;
|
||||
}
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
|
||||
ret = r_ble_log_ctrl_level_and_mod(CONFIG_BT_LE_CONTROLLER_LOG_OUTPUT_LEVEL, CONFIG_BT_LE_CONTROLLER_LOG_MOD_OUTPUT_SWITCH);
|
||||
if (ret == ESP_OK) {
|
||||
log_is_inited = true;
|
||||
if (r_ble_log_ctrl_level_and_mod(CONFIG_BT_LE_CONTROLLER_LOG_OUTPUT_LEVEL, CONFIG_BT_LE_CONTROLLER_LOG_MOD_OUTPUT_SWITCH) != ESP_OK) {
|
||||
goto ctrl_level_init_failed;
|
||||
}
|
||||
return ret;
|
||||
log_is_inited = true;
|
||||
return ESP_OK;
|
||||
|
||||
ctrl_level_init_failed:
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
r_ble_log_deinit_simple();
|
||||
#else // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
r_ble_log_deinit_async();
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
log_init_failed:
|
||||
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
ble_log_spi_out_deinit();
|
||||
spi_out_init_failed:
|
||||
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
return ESP_FAIL;
|
||||
}
|
||||
|
||||
void esp_bt_ontroller_log_deinit(void)
|
||||
void esp_bt_controller_log_deinit(void)
|
||||
{
|
||||
r_ble_log_deinit_async();
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
ble_log_spi_out_deinit();
|
||||
#endif
|
||||
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
r_ble_log_deinit_simple();
|
||||
#else // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
r_ble_log_deinit_async();
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
|
||||
log_is_inited = false;
|
||||
}
|
||||
|
||||
@@ -381,7 +364,7 @@ void esp_bt_read_ctrl_log_from_flash(bool output)
|
||||
portENTER_CRITICAL_SAFE(&spinlock);
|
||||
esp_panic_handler_feed_wdts();
|
||||
r_ble_log_async_output_dump_all(true);
|
||||
esp_bt_ontroller_log_deinit();
|
||||
esp_bt_controller_log_deinit();
|
||||
stop_write = true;
|
||||
|
||||
buffer = (const uint8_t *)mapped_ptr;
|
||||
@@ -408,7 +391,7 @@ void esp_bt_read_ctrl_log_from_flash(bool output)
|
||||
esp_rom_printf(":DUMP_END]\r\n");
|
||||
portEXIT_CRITICAL_SAFE(&spinlock);
|
||||
esp_partition_munmap(mmap_handle);
|
||||
err = esp_bt_controller_log_init(log_output_mode);
|
||||
err = esp_bt_controller_log_init();
|
||||
assert(err == ESP_OK);
|
||||
}
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
@@ -929,7 +912,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
||||
#endif // CONFIG_SW_COEXIST_ENABLE
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
ret = esp_bt_controller_log_init(log_output_mode);
|
||||
ret = esp_bt_controller_log_init();
|
||||
if (ret != ESP_OK) {
|
||||
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_controller_log_init failed %d", ret);
|
||||
goto modem_deint;
|
||||
@@ -1001,7 +984,7 @@ free_controller:
|
||||
modem_deint:
|
||||
esp_ble_unregister_bb_funcs();
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
esp_bt_ontroller_log_deinit();
|
||||
esp_bt_controller_log_deinit();
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
modem_clock_deselect_lp_clock_source(PERIPH_BT_MODULE);
|
||||
modem_clock_module_disable(PERIPH_BT_MODULE);
|
||||
@@ -1036,7 +1019,7 @@ esp_err_t esp_bt_controller_deinit(void)
|
||||
r_ble_controller_deinit();
|
||||
esp_ble_unregister_bb_funcs();
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
esp_bt_ontroller_log_deinit();
|
||||
esp_bt_controller_log_deinit();
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
|
||||
#if CONFIG_BT_NIMBLE_ENABLED
|
||||
@@ -1384,41 +1367,45 @@ esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t po
|
||||
}
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end)
|
||||
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag)
|
||||
{
|
||||
if (log_output_mode == LOG_STORAGE_TO_FLASH) {
|
||||
bool end = flag ? true : false;
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
esp_bt_controller_log_storage(len, addr, end);
|
||||
#endif //CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
} else {
|
||||
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
|
||||
portENTER_CRITICAL_SAFE(&spinlock);
|
||||
esp_panic_handler_feed_wdts();
|
||||
for (int i = 0; i < len; i++) {
|
||||
esp_rom_printf("%02x ", addr[i]);
|
||||
}
|
||||
|
||||
if (end) {
|
||||
esp_rom_printf("\n");
|
||||
}
|
||||
portEXIT_CRITICAL_SAFE(&spinlock);
|
||||
esp_bt_controller_log_storage(len, addr, end);
|
||||
#else // !CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
|
||||
portENTER_CRITICAL_SAFE(&spinlock);
|
||||
esp_panic_handler_feed_wdts();
|
||||
for (int i = 0; i < len; i++) {
|
||||
esp_rom_printf("%02x ", addr[i]);
|
||||
}
|
||||
|
||||
if (end) {
|
||||
esp_rom_printf("\n");
|
||||
}
|
||||
portEXIT_CRITICAL_SAFE(&spinlock);
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
}
|
||||
#endif // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
|
||||
void esp_ble_controller_log_dump_all(bool output)
|
||||
{
|
||||
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
ble_log_spi_out_dump_all();
|
||||
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
esp_bt_read_ctrl_log_from_flash(output);
|
||||
#else
|
||||
#elif !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
|
||||
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
|
||||
|
||||
portENTER_CRITICAL_SAFE(&spinlock);
|
||||
esp_panic_handler_feed_wdts();
|
||||
BT_ASSERT_PRINT("\r\n[DUMP_START:");
|
||||
r_ble_log_async_output_dump_all(output);
|
||||
BT_ASSERT_PRINT(":DUMP_END]\r\n");
|
||||
portEXIT_CRITICAL_SAFE(&spinlock);
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
|
||||
#endif
|
||||
}
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
|
||||
|
@@ -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
|
||||
|
Submodule components/bt/controller/lib_esp32c2/esp32c2-bt-lib updated: 1e88fa4606...c0d98a9a03
Submodule components/bt/controller/lib_esp32c6/esp32c6-bt-lib updated: b75747061f...246541ab93
Submodule components/bt/controller/lib_esp32h2/esp32h2-bt-lib updated: cd36ec849c...a3192174a9
@@ -228,6 +228,9 @@ typedef struct {
|
||||
uint8_t ignore_wl_for_direct_adv; /*!< Ignore the white list for directed advertising */
|
||||
uint8_t csa2_select; /*!< Select CSA#2 */
|
||||
uint8_t ble_aa_check; /*!< True if adds a verification step for the Access Address within the CONNECT_IND PDU; false otherwise. Configurable in menuconfig */
|
||||
uint8_t ble_llcp_disc_flag; /*!< Flag indicating whether the Controller disconnects after Instant Passed (0x28) error occurs. Configurable in menuconfig.
|
||||
- The Controller does not disconnect after Instant Passed (0x28) by default. */
|
||||
uint16_t scan_backoff_upperlimitmax; /*!< The value of upperlimitmax is 2^n, The maximum value is 256 */
|
||||
uint8_t vhci_enabled; /*!< VHCI mode is enabled */
|
||||
uint32_t config_magic; /*!< Configuration magic value */
|
||||
} esp_bt_controller_config_t;
|
||||
@@ -276,6 +279,8 @@ typedef struct {
|
||||
.ignore_wl_for_direct_adv = 0, \
|
||||
.csa2_select = DEFAULT_BT_LE_50_FEATURE_SUPPORT, \
|
||||
.ble_aa_check = DEFAULT_BT_LE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS, \
|
||||
.ble_llcp_disc_flag = BT_LE_CTRL_LLCP_DISC_FLAG, \
|
||||
.scan_backoff_upperlimitmax = BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX, \
|
||||
.vhci_enabled = DEFAULT_BT_LE_VHCI_ENABLED, \
|
||||
.config_magic = CONFIG_MAGIC, \
|
||||
}
|
||||
|
@@ -413,11 +413,9 @@ extern int esp_ble_hw_get_static_addr(esp_ble_addr_t *addr);
|
||||
void esp_ble_controller_log_dump_all(bool output);
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
|
||||
#if CONFIG_PM_ENABLE
|
||||
modem_clock_lpclk_src_t esp_bt_get_lpclk_src(void);
|
||||
|
||||
void esp_bt_set_lpclk_src(modem_clock_lpclk_src_t clk_src);
|
||||
#endif // CONFIG_PM_ENABLE
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@@ -223,6 +223,7 @@ typedef struct {
|
||||
- 0 - Disable (default)
|
||||
- 1 - Enable */
|
||||
uint8_t vhci_enabled; /*!< VHCI mode is enabled */
|
||||
uint8_t ptr_check_enabled; /*!< Enable boundary check for internal memory. */
|
||||
uint32_t config_magic; /*!< Magic number for configuration validation */
|
||||
} esp_bt_controller_config_t;
|
||||
|
||||
@@ -278,6 +279,7 @@ typedef struct {
|
||||
.ble_chan_ass_en = DEFAULT_BT_LE_CTRL_CHAN_ASS_EN, \
|
||||
.ble_data_lenth_zero_aux = DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX, \
|
||||
.vhci_enabled = DEFAULT_BT_LE_VHCI_ENABLED, \
|
||||
.ptr_check_enabled = DEFAULT_BT_LE_PTR_CHECK_ENABLED, \
|
||||
.config_magic = CONFIG_MAGIC, \
|
||||
}
|
||||
|
||||
@@ -434,11 +436,9 @@ extern int esp_ble_hw_get_static_addr(esp_ble_addr_t *addr);
|
||||
void esp_ble_controller_log_dump_all(bool output);
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
|
||||
#if CONFIG_PM_ENABLE
|
||||
modem_clock_lpclk_src_t esp_bt_get_lpclk_src(void);
|
||||
|
||||
void esp_bt_set_lpclk_src(modem_clock_lpclk_src_t clk_src);
|
||||
#endif // CONFIG_PM_ENABLE
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@@ -227,6 +227,7 @@ typedef struct {
|
||||
- 0 - Disable (default)
|
||||
- 1 - Enable */
|
||||
uint8_t vhci_enabled; /*!< VHCI is enabled */
|
||||
uint8_t ptr_check_enabled; /*!< Enable boundary check for internal memory. */
|
||||
uint32_t config_magic; /*!< Configuration magic value */
|
||||
} esp_bt_controller_config_t;
|
||||
|
||||
@@ -282,6 +283,7 @@ typedef struct {
|
||||
.ble_chan_ass_en = DEFAULT_BT_LE_CTRL_CHAN_ASS_EN, \
|
||||
.ble_data_lenth_zero_aux = DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX, \
|
||||
.vhci_enabled = DEFAULT_BT_LE_VHCI_ENABLED, \
|
||||
.ptr_check_enabled = DEFAULT_BT_LE_PTR_CHECK_ENABLED, \
|
||||
.config_magic = CONFIG_MAGIC, \
|
||||
}
|
||||
|
||||
@@ -438,11 +440,9 @@ extern int esp_ble_hw_get_static_addr(esp_ble_addr_t *addr);
|
||||
void esp_ble_controller_log_dump_all(bool output);
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
|
||||
#if CONFIG_PM_ENABLE
|
||||
modem_clock_lpclk_src_t esp_bt_get_lpclk_src(void);
|
||||
|
||||
void esp_bt_set_lpclk_src(modem_clock_lpclk_src_t clk_src);
|
||||
#endif // CONFIG_PM_ENABLE
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@@ -108,7 +108,7 @@ r_ble_ll_adv_clear_all = 0x40000bf8;
|
||||
r_ble_ll_adv_conn_req_rxd = 0x40000bfc;
|
||||
r_ble_ll_adv_deinit = 0x40000c00;
|
||||
r_ble_ll_adv_enabled = 0x40000c04;
|
||||
r_ble_ll_adv_env_init = 0x40000c08;
|
||||
//r_ble_ll_adv_env_init = 0x40000c08;
|
||||
r_ble_ll_adv_ext_set_adv_data = 0x40000c0c;
|
||||
r_ble_ll_adv_ext_set_enable = 0x40000c10;
|
||||
//r_ble_ll_adv_ext_set_param = 0x40000c14;
|
||||
@@ -144,7 +144,7 @@ r_ble_ll_adv_reset = 0x40000c88;
|
||||
r_ble_ll_adv_rpa_timeout = 0x40000c8c;
|
||||
r_ble_ll_adv_rpa_update = 0x40000c90;
|
||||
r_ble_ll_adv_rx_pkt_in = 0x40000c94;
|
||||
r_ble_ll_adv_scan_req_rxd = 0x40000c98;
|
||||
//r_ble_ll_adv_scan_req_rxd = 0x40000c98;
|
||||
r_ble_ll_adv_scan_rsp_legacy_pdu_make = 0x40000c9c;
|
||||
r_ble_ll_adv_scan_rsp_pdu_make = 0x40000ca0;
|
||||
r_ble_ll_adv_scheduled = 0x40000ca4;
|
||||
@@ -202,7 +202,7 @@ r_ble_ll_conn_cth_flow_is_enabled = 0x40000d70;
|
||||
r_ble_ll_conn_cth_flow_process_cmd = 0x40000d74;
|
||||
r_ble_ll_conn_cth_flow_set_buffers = 0x40000d78;
|
||||
r_ble_ll_conn_enqueue_pkt = 0x40000d7c;
|
||||
r_ble_ll_conn_env_init = 0x40000d80;
|
||||
//r_ble_ll_conn_env_init = 0x40000d80;
|
||||
r_ble_ll_conn_ext_master_init = 0x40000d84;
|
||||
r_ble_ll_conn_find_active_conn = 0x40000d88;
|
||||
r_ble_ll_conn_get_active_conn = 0x40000d8c;
|
||||
@@ -257,7 +257,7 @@ r_ble_ll_conn_tx_pkt_in = 0x40000e4c;
|
||||
r_ble_ll_conn_update_eff_data_len = 0x40000e50;
|
||||
r_ble_ll_ctrl_chanmap_req_make = 0x40000e54;
|
||||
r_ble_ll_ctrl_chk_proc_start = 0x40000e58;
|
||||
r_ble_ll_ctrl_conn_param_pdu_make = 0x40000e5c;
|
||||
//r_ble_ll_ctrl_conn_param_pdu_make = 0x40000e5c;
|
||||
r_ble_ll_ctrl_conn_param_pdu_proc = 0x40000e60;
|
||||
r_ble_ll_ctrl_conn_param_reply = 0x40000e64;
|
||||
r_ble_ll_ctrl_conn_upd_make = 0x40000e68;
|
||||
@@ -284,7 +284,7 @@ r_ble_ll_ctrl_proc_unk_rsp = 0x40000eb8;
|
||||
r_ble_ll_ctrl_proc_with_instant_initiated = 0x40000ebc;
|
||||
r_ble_ll_ctrl_rej_ext_ind_make = 0x40000ec0;
|
||||
r_ble_ll_ctrl_reject_ind_send = 0x40000ec4;
|
||||
r_ble_ll_ctrl_rx_chanmap_req = 0x40000ec8;
|
||||
//r_ble_ll_ctrl_rx_chanmap_req = 0x40000ec8;
|
||||
r_ble_ll_ctrl_rx_conn_param_req = 0x40000ecc;
|
||||
//r_ble_ll_ctrl_rx_conn_param_rsp = 0x40000ed0;
|
||||
//r_ble_ll_ctrl_rx_conn_update = 0x40000ed4;
|
||||
@@ -298,7 +298,7 @@ r_ble_ll_ctrl_rx_pdu = 0x40000ef0;
|
||||
r_ble_ll_ctrl_rx_periodic_sync_ind = 0x40000ef4;
|
||||
r_ble_ll_ctrl_rx_phy_req = 0x40000ef8;
|
||||
r_ble_ll_ctrl_rx_phy_rsp = 0x40000efc;
|
||||
r_ble_ll_ctrl_rx_phy_update_ind = 0x40000f00;
|
||||
//r_ble_ll_ctrl_rx_phy_update_ind = 0x40000f00;
|
||||
r_ble_ll_ctrl_rx_ping_rsp = 0x40000f04;
|
||||
r_ble_ll_ctrl_rx_reject_ind = 0x40000f08;
|
||||
r_ble_ll_ctrl_rx_sca_req = 0x40000f0c;
|
||||
@@ -346,7 +346,7 @@ r_ble_ll_hci_cmd_rx = 0x40000fb0;
|
||||
r_ble_ll_hci_ctlr_bb_cmd_proc = 0x40000fb4;
|
||||
r_ble_ll_hci_deinit = 0x40000fb8;
|
||||
r_ble_ll_hci_disconnect = 0x40000fbc;
|
||||
r_ble_ll_hci_env_init = 0x40000fc0;
|
||||
//r_ble_ll_hci_env_init = 0x40000fc0;
|
||||
r_ble_ll_hci_ev_conn_update = 0x40000fc4;
|
||||
r_ble_ll_hci_ev_databuf_overflow = 0x40000fc8;
|
||||
r_ble_ll_hci_ev_datalen_chg = 0x40000fcc;
|
||||
@@ -755,7 +755,7 @@ r_ble_lll_hci_dtm_tx_test_v2 = 0x40001614;
|
||||
r_ble_lll_hci_dtm_tx_test_v2_ext = 0x40001618;
|
||||
r_ble_lll_init = 0x4000161c;
|
||||
r_ble_lll_init_pre_process = 0x40001620;
|
||||
r_ble_lll_init_rx_pkt_isr = 0x40001624;
|
||||
//r_ble_lll_init_rx_pkt_isr = 0x40001624;
|
||||
r_ble_lll_per_adv_coex_dpc_calc_pti_update_itvl = 0x40001628;
|
||||
r_ble_lll_per_adv_coex_dpc_process = 0x4000162c;
|
||||
r_ble_lll_per_adv_coex_dpc_pti_get = 0x40001630;
|
||||
@@ -805,7 +805,7 @@ r_ble_lll_scan_npl_store = 0x400016dc;
|
||||
r_ble_lll_scan_period_timer_cb = 0x400016e0;
|
||||
r_ble_lll_scan_process_adv_in_isr = 0x400016e4;
|
||||
r_ble_lll_scan_process_rsp_in_isr = 0x400016e8;
|
||||
r_ble_lll_scan_req_backoff = 0x400016ec;
|
||||
//r_ble_lll_scan_req_backoff = 0x400016ec;
|
||||
r_ble_lll_scan_restart = 0x400016f0;
|
||||
r_ble_lll_scan_rx_isr_on_aux = 0x400016f4;
|
||||
r_ble_lll_scan_rx_isr_on_legacy = 0x400016f8;
|
||||
@@ -1216,7 +1216,7 @@ r_ble_lll_scan_filter_out_useless_adv = 0x40002ff4;
|
||||
r_ble_hw_whitelist_check_in_wl = 0x40002ff8;
|
||||
r_ble_phy_stats_reset = 0x40002ffc;
|
||||
r_ble_phy_ramup_time_set = 0x40003000;
|
||||
r_ble_lll_rfmgmt_should_skip_light_sleep_check = 0x40003004;
|
||||
//r_ble_lll_rfmgmt_should_skip_light_sleep_check = 0x40003004;
|
||||
r_ble_phy_rx_err_record = 0x40003008;
|
||||
r_ble_lll_rfmgmt_wake_up_overhead_set = 0x4000300c;
|
||||
//r_ble_lll_conn_event_delete_and_reschedule = 0x40003010;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -118,7 +118,7 @@ r_ble_ll_adv_rd_sup_adv_sets = 0x40000c7c;
|
||||
r_ble_ll_adv_read_txpwr = 0x40000c80;
|
||||
r_ble_ll_adv_rpa_timeout = 0x40000c8c;
|
||||
r_ble_ll_adv_rpa_update = 0x40000c90;
|
||||
r_ble_ll_adv_scan_req_rxd = 0x40000c98;
|
||||
//r_ble_ll_adv_scan_req_rxd = 0x40000c98;
|
||||
r_ble_ll_adv_scan_rsp_legacy_pdu_make = 0x40000c9c;
|
||||
r_ble_ll_adv_scan_rsp_pdu_make = 0x40000ca0;
|
||||
r_ble_ll_adv_scheduled = 0x40000ca4;
|
||||
@@ -202,7 +202,7 @@ r_ble_ll_conn_sm_get = 0x40000e3c;
|
||||
r_ble_ll_conn_tx_pkt_in = 0x40000e4c;
|
||||
r_ble_ll_conn_update_eff_data_len = 0x40000e50;
|
||||
r_ble_ll_ctrl_chanmap_req_make = 0x40000e54;
|
||||
r_ble_ll_ctrl_conn_param_pdu_make = 0x40000e5c;
|
||||
//r_ble_ll_ctrl_conn_param_pdu_make = 0x40000e5c;
|
||||
r_ble_ll_ctrl_conn_param_pdu_proc = 0x40000e60;
|
||||
r_ble_ll_ctrl_conn_param_reply = 0x40000e64;
|
||||
r_ble_ll_ctrl_datalen_upd_make = 0x40000e6c;
|
||||
@@ -224,7 +224,7 @@ r_ble_ll_ctrl_proc_stop = 0x40000eb4;
|
||||
r_ble_ll_ctrl_proc_with_instant_initiated = 0x40000ebc;
|
||||
r_ble_ll_ctrl_rej_ext_ind_make = 0x40000ec0;
|
||||
r_ble_ll_ctrl_reject_ind_send = 0x40000ec4;
|
||||
r_ble_ll_ctrl_rx_chanmap_req = 0x40000ec8;
|
||||
//r_ble_ll_ctrl_rx_chanmap_req = 0x40000ec8;
|
||||
r_ble_ll_ctrl_rx_conn_param_req = 0x40000ecc;
|
||||
r_ble_ll_ctrl_rx_enc_req = 0x40000ed8;
|
||||
r_ble_ll_ctrl_rx_enc_rsp = 0x40000edc;
|
||||
@@ -234,7 +234,7 @@ r_ble_ll_ctrl_rx_pause_enc_rsp = 0x40000eec;
|
||||
r_ble_ll_ctrl_rx_periodic_sync_ind = 0x40000ef4;
|
||||
r_ble_ll_ctrl_rx_phy_req = 0x40000ef8;
|
||||
r_ble_ll_ctrl_rx_phy_rsp = 0x40000efc;
|
||||
r_ble_ll_ctrl_rx_phy_update_ind = 0x40000f00;
|
||||
//r_ble_ll_ctrl_rx_phy_update_ind = 0x40000f00;
|
||||
r_ble_ll_ctrl_rx_ping_rsp = 0x40000f04;
|
||||
r_ble_ll_ctrl_rx_reject_ind = 0x40000f08;
|
||||
r_ble_ll_ctrl_rx_sca_req = 0x40000f0c;
|
||||
@@ -636,7 +636,7 @@ r_ble_lll_scan_npl_restore = 0x400016d8;
|
||||
r_ble_lll_scan_npl_store = 0x400016dc;
|
||||
r_ble_lll_scan_period_timer_cb = 0x400016e0;
|
||||
r_ble_lll_scan_process_adv_in_isr = 0x400016e4;
|
||||
r_ble_lll_scan_req_backoff = 0x400016ec;
|
||||
//r_ble_lll_scan_req_backoff = 0x400016ec;
|
||||
r_ble_lll_scan_sched_next_aux = 0x40001700;
|
||||
r_ble_lll_scan_sched_remove = 0x40001704;
|
||||
r_ble_lll_scan_start = 0x40001708;
|
||||
|
Reference in New Issue
Block a user