Skip to content

Commit

Permalink
Merge branch 'feat/optimize_bt_porting_hci_0628_5.2' into 'release/v5.2'
Browse files Browse the repository at this point in the history
Feat/optimize bt porting hci 0628 5.2

See merge request espressif/esp-idf!32133
  • Loading branch information
Isl2017 committed Jul 17, 2024
2 parents 4878339 + 64e872f commit d0da89f
Show file tree
Hide file tree
Showing 42 changed files with 3,132 additions and 939 deletions.
59 changes: 42 additions & 17 deletions components/bt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ if(CONFIG_BT_ENABLED)
common/btc/include
common/include
porting/mem/
porting/include
)
list(APPEND include_dirs ${common_include_dirs})

Expand Down Expand Up @@ -566,29 +567,51 @@ if(CONFIG_BT_ENABLED)


if(CONFIG_BT_LE_CONTROLLER_NPL_OS_PORTING_SUPPORT)
list(APPEND srcs
"porting/npl/freertos/src/npl_os_freertos.c"
"porting/mem/os_msys_init.c"
"porting/transport/src/hci_transport.c"
)

if(CONFIG_BT_CONTROLLER_DISABLED)
list(APPEND srcs
"porting/npl/freertos/src/npl_os_freertos.c"
"porting/mem/os_msys_init.c"
"host/nimble/nimble/porting/nimble/src/hal_uart.c"
)

if(CONFIG_BT_CONTROLLER_DISABLED)
elseif(CONFIG_BT_LE_HCI_INTERFACE_USE_RAM)
if(CONFIG_BT_NIMBLE_ENABLED)
list(APPEND srcs
"host/nimble/nimble/porting/nimble/src/hal_uart.c"
)
"porting/transport/driver/vhci/hci_driver_nimble.c"
"host/nimble/nimble/nimble/transport/esp_ipc/src/hci_esp_ipc.c"
)
else()
list(APPEND srcs
"porting/transport/driver/vhci/hci_driver_standard.c"
)
endif()
list(APPEND include_dirs
porting/include
porting/npl/freertos/include
porting/transport/include
)

if(CONFIG_BT_LE_HCI_INTERFACE_USE_UART)
elseif(CONFIG_BT_LE_HCI_INTERFACE_USE_UART)
list(APPEND srcs
"porting/transport/uart/hci_uart.c"
)
"porting/transport/driver/common/hci_driver_util.c"
"porting/transport/driver/common/hci_driver_h4.c"
"porting/transport/driver/common/hci_driver_mem.c"
"porting/transport/driver/uart/hci_driver_uart_config.c"
)
if(CONFIG_BT_LE_UART_HCI_DMA_MODE)
list(APPEND srcs
"porting/transport/driver/uart/hci_driver_uart_dma.c"
)
else()
list(APPEND srcs
"porting/transport/driver/uart/hci_driver_uart.c"
)
endif()
endif()
endif()

list(APPEND include_dirs
porting/include
porting/npl/freertos/include
porting/transport/include
)
endif()

if(NOT (CONFIG_BT_LE_CRYPTO_STACK_MBEDTLS OR CONFIG_BT_NIMBLE_CRYPTO_STACK_MBEDTLS))
list(APPEND include_dirs
Expand All @@ -614,7 +637,6 @@ if(CONFIG_BT_ENABLED)
if(CONFIG_BT_NIMBLE_ENABLED)

list(APPEND include_dirs

host/nimble/nimble/nimble/host/include
host/nimble/nimble/nimble/include
host/nimble/nimble/nimble/host/services/ans/include
Expand Down Expand Up @@ -718,10 +740,12 @@ if(CONFIG_BT_ENABLED)
"host/nimble/nimble/porting/npl/freertos/src/nimble_port_freertos.c"
"host/nimble/port/src/nvs_port.c"
)

list(APPEND include_dirs
host/nimble/nimble/porting/nimble/include
host/nimble/port/include
host/nimble/nimble/nimble/transport/include
host/nimble/nimble/nimble/include
)

if(CONFIG_BT_CONTROLLER_DISABLED)
Expand Down Expand Up @@ -755,6 +779,7 @@ if(CONFIG_BT_ENABLED)
if(CONFIG_BT_NIMBLE_LEGACY_VHCI_ENABLE AND CONFIG_BT_CONTROLLER_ENABLED)
list(APPEND srcs
"host/nimble/esp-hci/src/esp_nimble_hci.c"
"host/nimble/nimble/nimble/transport/esp_ipc_legacy/src/hci_esp_ipc_legacy.c"
)
list(APPEND include_dirs ${nimble_hci_include_dirs})
endif()
Expand Down
30 changes: 22 additions & 8 deletions components/bt/controller/esp32c2/Kconfig.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
menu "HCI Config"

choice BT_LE_HCI_INTERFACE
prompt "Select HCI interface"
prompt "HCI mode"
default BT_LE_HCI_INTERFACE_USE_RAM

config BT_LE_HCI_INTERFACE_USE_RAM
bool "ram"
bool "VHCI"
help
Use RAM as HCI interface
config BT_LE_HCI_INTERFACE_USE_UART
bool "uart"
bool "UART(H4)"
help
Use UART as HCI interface
endchoice
Expand Down Expand Up @@ -73,12 +73,26 @@ menu "HCI Config"
UART_PARITY_ODD
endchoice

config BT_LE_HCI_UART_TASK_STACK_SIZE
int "HCI uart task stack size"
depends on BT_LE_HCI_INTERFACE_USE_UART
default 1000
config BT_LE_HCI_UART_RX_BUFFER_SIZE
int "The size of rx ring buffer memory"
depends on !BT_LE_HCI_INTERFACE_USE_RAM
default 512
help
The size of rx ring buffer memory

config BT_LE_HCI_UART_TX_BUFFER_SIZE
int "The size of tx ring buffer memory"
depends on !BT_LE_HCI_INTERFACE_USE_RAM
default 256
help
The size of tx ring buffer memory

config BT_LE_HCI_TRANS_TASK_STACK_SIZE
int "HCI transport task stack size"
depends on !BT_LE_HCI_INTERFACE_USE_RAM
default 1024
help
Set the size of uart task stack
This configures stack size of hci transport task
endmenu

config BT_LE_CONTROLLER_NPL_OS_PORTING_SUPPORT
Expand Down
Loading

0 comments on commit d0da89f

Please sign in to comment.