diff --git a/components/bt/controller/esp32c2/bt.c b/components/bt/controller/esp32c2/bt.c index e78cdb6862..38ce336250 100644 --- a/components/bt/controller/esp32c2/bt.c +++ b/components/bt/controller/esp32c2/bt.c @@ -385,23 +385,6 @@ static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer return rc; } -#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED -static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end) -{ - if (!end) { - for (int i = 0; i < len; i++) { - esp_rom_printf("%02x,", addr[i]); - } - - } else { - for (int i = 0; i < len; i++) { - esp_rom_printf("%02x,", addr[i]); - } - esp_rom_printf("\n"); - } -} -#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED - #ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART static void hci_uart_start_tx_wrapper(int uart_no) { @@ -1006,11 +989,25 @@ uint8_t esp_ble_get_chip_rev_version(void) } #if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED +static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end) +{ + for (int i = 0; i < len; i++) { + esp_rom_printf("%02x,", addr[i]); + } + if (end) { + esp_rom_printf("\n"); + } +} + void esp_ble_controller_log_dump_all(bool output) { + portMUX_TYPE spinlock; + + portENTER_CRITICAL_SAFE(&spinlock); BT_ASSERT_PRINT("\r\n[DUMP_START:"); ble_log_async_output_dump_all(output); BT_ASSERT_PRINT("]\r\n"); + portEXIT_CRITICAL_SAFE(&spinlock); } #endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED diff --git a/components/bt/controller/esp32c6/bt.c b/components/bt/controller/esp32c6/bt.c index 94b0432be3..49d5050c19 100644 --- a/components/bt/controller/esp32c6/bt.c +++ b/components/bt/controller/esp32c6/bt.c @@ -377,23 +377,6 @@ static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer return rc; } -#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED -static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end) -{ - if (!end) { - for (int i = 0; i < len; i++) { - esp_rom_printf("%02x,", addr[i]); - } - - } else { - for (int i = 0; i < len; i++) { - esp_rom_printf("%02x,", addr[i]); - } - esp_rom_printf("\n"); - } -} -#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED - #ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART static void hci_uart_start_tx_wrapper(int uart_no) { @@ -1175,11 +1158,25 @@ 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) +{ + for (int i = 0; i < len; i++) { + esp_rom_printf("%02x,", addr[i]); + } + if (end) { + esp_rom_printf("\n"); + } +} + void esp_ble_controller_log_dump_all(bool output) { + portMUX_TYPE spinlock; + + portENTER_CRITICAL_SAFE(&spinlock); BT_ASSERT_PRINT("\r\n[DUMP_START:"); ble_log_async_output_dump_all(output); BT_ASSERT_PRINT("]\r\n"); + portEXIT_CRITICAL_SAFE(&spinlock); } #endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED diff --git a/components/bt/controller/esp32h2/bt.c b/components/bt/controller/esp32h2/bt.c index 29e5a85a36..d29822f90c 100644 --- a/components/bt/controller/esp32h2/bt.c +++ b/components/bt/controller/esp32h2/bt.c @@ -374,23 +374,6 @@ static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer return rc; } -#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED -static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end) -{ - if (!end) { - for (int i = 0; i < len; i++) { - esp_rom_printf("%02x,", addr[i]); - } - - } else { - for (int i = 0; i < len; i++) { - esp_rom_printf("%02x,", addr[i]); - } - esp_rom_printf("\n"); - } -} -#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED - #ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART static void hci_uart_start_tx_wrapper(int uart_no) { @@ -1161,11 +1144,25 @@ 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) +{ + for (int i = 0; i < len; i++) { + esp_rom_printf("%02x,", addr[i]); + } + if (end) { + esp_rom_printf("\n"); + } +} + void esp_ble_controller_log_dump_all(bool output) { + portMUX_TYPE spinlock; + + portENTER_CRITICAL_SAFE(&spinlock); BT_ASSERT_PRINT("\r\n[DUMP_START:"); ble_log_async_output_dump_all(output); BT_ASSERT_PRINT("]\r\n"); + portEXIT_CRITICAL_SAFE(&spinlock); } #endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED diff --git a/components/bt/controller/lib_esp32c6/esp32c6-bt-lib b/components/bt/controller/lib_esp32c6/esp32c6-bt-lib index f0896d1080..97499655f3 160000 --- a/components/bt/controller/lib_esp32c6/esp32c6-bt-lib +++ b/components/bt/controller/lib_esp32c6/esp32c6-bt-lib @@ -1 +1 @@ -Subproject commit f0896d108055057f321afe5954ee6167d6e14936 +Subproject commit 97499655f3148ee273baadb6b48bbb168207d90b diff --git a/components/bt/controller/lib_esp32h2/esp32h2-bt-lib b/components/bt/controller/lib_esp32h2/esp32h2-bt-lib index db2a7395b6..ff664688f4 160000 --- a/components/bt/controller/lib_esp32h2/esp32h2-bt-lib +++ b/components/bt/controller/lib_esp32h2/esp32h2-bt-lib @@ -1 +1 @@ -Subproject commit db2a7395b629dfcaf015069c36f4a5ce441f2aba +Subproject commit ff664688f4fedb16c7eafc5bc88a4dacbc3e8ba5 diff --git a/components/bt/include/esp32c6/include/esp_bt.h b/components/bt/include/esp32c6/include/esp_bt.h index 8015e67baf..1e96bfd0d7 100644 --- a/components/bt/include/esp32c6/include/esp_bt.h +++ b/components/bt/include/esp32c6/include/esp_bt.h @@ -412,7 +412,7 @@ extern int esp_ble_hw_get_static_addr(esp_ble_addr_t *addr); #if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED /** - * @brief dump all controller log information cached in buffer + * @brief dump all log information cached in buffers. * @param output : true for log dump, false will take no effect */ void esp_ble_controller_log_dump_all(bool output); diff --git a/components/bt/include/esp32h2/include/esp_bt.h b/components/bt/include/esp32h2/include/esp_bt.h index 19c6638ed8..f5684e5c6a 100644 --- a/components/bt/include/esp32h2/include/esp_bt.h +++ b/components/bt/include/esp32h2/include/esp_bt.h @@ -416,7 +416,7 @@ extern int esp_ble_hw_get_static_addr(esp_ble_addr_t *addr); #if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED /** - * @brief dump all controller log information cached in buffer + * @brief dump all log information cached in buffers. * @param output : true for log dump, false will take no effect */ void esp_ble_controller_log_dump_all(bool output);