Skip to content

Commit 918b2cf

Browse files
committed
Merge branch 'feat/support_ble_log_uart_dma_out' into 'master'
Feat/support ble log uart dma out Closes BLERP-1935 See merge request espressif/esp-idf!40597
2 parents 635169f + 3671d7b commit 918b2cf

File tree

10 files changed

+1038
-36
lines changed

10 files changed

+1038
-36
lines changed

components/bt/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ if(CONFIG_BT_ENABLED)
137137
"common/osi/semaphore.c"
138138
"porting/mem/bt_osi_mem.c"
139139
"common/ble_log/ble_log_spi_out.c"
140+
"common/ble_log/ble_log_uhci_out.c"
140141
)
141142

142143
# Host Bluedroid
@@ -946,6 +947,11 @@ if(CONFIG_BT_ENABLED)
946947
if(CONFIG_BT_LE_CONTROLLER_LOG_WRAP_PANIC_HANDLER_ENABLE)
947948
target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--wrap=esp_panic_handler")
948949
endif()
950+
if(CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED)
951+
target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--wrap=uart_tx_chars")
952+
target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--wrap=uart_write_bytes")
953+
target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--wrap=uart_write_bytes_with_break")
954+
endif()
949955
if(CONFIG_IDF_TARGET_ESP32C6)
950956
add_prebuilt_library(libble_app
951957
"${CMAKE_CURRENT_LIST_DIR}/controller/lib_esp32c6/esp32c6-bt-lib/esp32c6/libble_app.a"

components/bt/common/Kconfig.in

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,3 +197,64 @@ config BT_BLE_LOG_SPI_OUT_MESH_TASK_CNT
197197
default 3
198198
help
199199
Mesh task count
200+
201+
config BT_BLE_LOG_UHCI_OUT_ENABLED
202+
bool "Output ble logs via UHCI (UART DMA) driver (Experimental)"
203+
default n
204+
help
205+
Output ble logs via UHCI (UART DMA) driver
206+
On enable, BT_BLE_LOG_UHCI_OUT_UART_PORT would be reinited with
207+
BT_BLE_LOG_UHCI_OUT_UART_BAUD_RATE as new baud rate and
208+
BT_BLE_LOG_UHCI_OUT_UART_IO_NUM_TX as new UART Tx IO
209+
210+
config BT_BLE_LOG_UHCI_OUT_UART_PORT
211+
int "UART port connected to UHCI controller"
212+
depends on BT_BLE_LOG_UHCI_OUT_ENABLED
213+
default 0
214+
help
215+
UART port connected to UHCI controller
216+
If UART port 0 is selected, UART VFS Driver, UART ROM Driver
217+
and UART Driver output would be redirected to BLE Log UHCI Out
218+
to solve UART Tx FIFO multi-task access issue
219+
220+
config BT_BLE_LOG_UHCI_OUT_LL_TASK_BUF_SIZE
221+
int "UHCI transaction buffer size for lower layer task logs"
222+
depends on BT_BLE_LOG_UHCI_OUT_ENABLED
223+
default 1024
224+
help
225+
UHCI transaction buffer size for lower layer task logs
226+
227+
config BT_BLE_LOG_UHCI_OUT_LL_ISR_BUF_SIZE
228+
int "UHCI transaction buffer size for lower layer ISR logs"
229+
depends on BT_BLE_LOG_UHCI_OUT_ENABLED
230+
default 1024
231+
help
232+
UHCI transaction buffer size for lower layer ISR logs
233+
234+
config BT_BLE_LOG_UHCI_OUT_LL_HCI_BUF_SIZE
235+
int "UHCI transaction buffer size for lower layer HCI logs"
236+
depends on BT_BLE_LOG_UHCI_OUT_ENABLED
237+
default 1024
238+
help
239+
UHCI transaction buffer size for lower layer HCI logs
240+
241+
config BT_BLE_LOG_UHCI_OUT_UART_NEED_INIT
242+
bool "Enable to init UART port"
243+
depends on BT_BLE_LOG_UHCI_OUT_ENABLED
244+
default y
245+
help
246+
Enable to init UART port
247+
248+
config BT_BLE_LOG_UHCI_OUT_UART_BAUD_RATE
249+
int "Baud rate for BT_BLE_LOG_UHCI_OUT_UART_PORT"
250+
depends on BT_BLE_LOG_UHCI_OUT_UART_NEED_INIT
251+
default 3000000
252+
help
253+
Baud rate for BT_BLE_LOG_UHCI_OUT_UART_PORT
254+
255+
config BT_BLE_LOG_UHCI_OUT_UART_IO_NUM_TX
256+
int "IO number for UART TX port"
257+
depends on BT_BLE_LOG_UHCI_OUT_UART_NEED_INIT
258+
default 0
259+
help
260+
IO number for UART TX port

0 commit comments

Comments
 (0)