bluetooth: Rename rpmsg HCI driver and sample to ipc
The existing driver and sample: - drivers/bluetooth/hci/rpmsg - samples/bluetooth/hci_rpmsg are no longer correctly named, since they now use the IPC subsystem to send and receive data. The IPC subsystem can use RPMsg as a transport, but that is one of several selectable backends. I initially wanted to deprecated both the BT_RPMSG Kconfig option as well as the zephyr,bt-hci-rpmsg-ipc chosen node in Devicetree. However, this proved to be undoable in the case of the Kconfig option. This is because it's a choice option, and those have special behavior. In particular, the only practical way to deprecate would've been to keep the old Kconfig option outside the choice (much like it's done in this commit) but then also add a 'depends on !BT_RPMSG' on each of the remaining choice symbols *except* on the new BT_HCI_IPC one. This, however, only works correctly for .conf files. If a board instead sets the default BT_HCI_BUS_TYPE in the Kconfig.defconfig file then the Kconfig tree parsing would fail, because it'd try to set it to a value (BT_RPMSG) that is no longer part of the choice. Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This commit is contained in:
parent
928e22c302
commit
9cf07bbdb5
69 changed files with 209 additions and 175 deletions
|
|
@ -44,7 +44,7 @@ config DOMAIN_CPUNET_BOARD
|
|||
help
|
||||
The board which will be used for CPUNET domain when creating a multi
|
||||
image application where one or more images should be located on
|
||||
another board. For example hci_rpmsg on the bl5340_dvk_cpunet for
|
||||
another board. For example hci_ipc on the bl5340_dvk_cpunet for
|
||||
Bluetooth applications.
|
||||
|
||||
endif # BOARD_BL5340_DVK_CPUAPP || BOARD_BL5340_DVK_CPUAPP_NS
|
||||
|
|
|
|||
|
|
@ -75,11 +75,11 @@ config MBOX_NRFX_IPC
|
|||
if BOARD_BL5340_DVK_CPUAPP || BOARD_BL5340_DVK_CPUAPP_NS
|
||||
|
||||
choice BT_HCI_BUS_TYPE
|
||||
default BT_RPMSG if BT
|
||||
default BT_HCI_IPC if BT
|
||||
endchoice
|
||||
|
||||
config HEAP_MEM_POOL_SIZE
|
||||
default 4096 if BT_RPMSG
|
||||
default 4096 if BT_HCI_IPC
|
||||
|
||||
config BT_HCI_VS
|
||||
default y if BT
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
zephyr,bt-mon-uart = &uart0;
|
||||
zephyr,bt-c2h-uart = &uart0;
|
||||
zephyr,display = &ili9340;
|
||||
zephyr,bt-hci-rpmsg-ipc = &ipc0;
|
||||
zephyr,bt-hci-ipc = &ipc0;
|
||||
};
|
||||
|
||||
/* Main LEDs and buttons are on an I2C TCA9538 GPIO port expander */
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
zephyr,sram = &sram1;
|
||||
zephyr,flash = &flash1;
|
||||
zephyr,code-partition = &slot0_partition;
|
||||
zephyr,bt-hci-rpmsg-ipc = &ipc0;
|
||||
zephyr,bt-hci-ipc = &ipc0;
|
||||
};
|
||||
|
||||
aliases {
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ config DOMAIN_CPUNET_BOARD
|
|||
help
|
||||
The board which will be used for CPUNET domain when creating a multi
|
||||
image application where one or more images should be located on
|
||||
another board. For example hci_rpmsg on the nRF5340_cpunet for
|
||||
another board. For example hci_ipc on the nRF5340_cpunet for
|
||||
Bluetooth applications.
|
||||
|
||||
endif # BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP || BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP_NS
|
||||
|
|
|
|||
|
|
@ -70,11 +70,11 @@ config MBOX_NRFX_IPC
|
|||
if BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP || BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP_NS
|
||||
|
||||
choice BT_HCI_BUS_TYPE
|
||||
default BT_RPMSG if BT
|
||||
default BT_HCI_IPC if BT
|
||||
endchoice
|
||||
|
||||
config HEAP_MEM_POOL_SIZE
|
||||
default 4096 if BT_RPMSG
|
||||
default 4096 if BT_HCI_IPC
|
||||
|
||||
endif # BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP || BOARD_NRF5340_AUDIO_DK_NRF5340_CPUAPP_NS
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
zephyr,uart-mcumgr = &uart0;
|
||||
zephyr,bt-mon-uart = &uart0;
|
||||
zephyr,bt-c2h-uart = &uart0;
|
||||
zephyr,bt-hci-rpmsg-ipc = &ipc0;
|
||||
zephyr,bt-hci-ipc = &ipc0;
|
||||
watchdog0 = &wdt0;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
zephyr,uart-mcumgr = &uart0;
|
||||
zephyr,bt-mon-uart = &uart0;
|
||||
zephyr,bt-c2h-uart = &uart0;
|
||||
zephyr,bt-hci-rpmsg-ipc = &ipc0;
|
||||
zephyr,bt-hci-ipc = &ipc0;
|
||||
zephyr,sram = &sram1;
|
||||
zephyr,flash = &flash1;
|
||||
zephyr,code-partition = &slot0_partition;
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ config DOMAIN_CPUNET_BOARD
|
|||
help
|
||||
The board which will be used for CPUNET domain when creating a multi
|
||||
image application where one or more images should be located on
|
||||
another board. For example hci_rpmsg on the nRF5340_cpunet for
|
||||
another board. For example hci_ipc on the nRF5340_cpunet for
|
||||
Bluetooth applications.
|
||||
|
||||
endif # BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF5340DK_NRF5340_CPUAPP_NS
|
||||
|
|
|
|||
|
|
@ -67,11 +67,11 @@ config MBOX_NRFX_IPC
|
|||
if BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF5340DK_NRF5340_CPUAPP_NS
|
||||
|
||||
choice BT_HCI_BUS_TYPE
|
||||
default BT_RPMSG if BT
|
||||
default BT_HCI_IPC if BT
|
||||
endchoice
|
||||
|
||||
config HEAP_MEM_POOL_SIZE
|
||||
default 4096 if BT_RPMSG
|
||||
default 4096 if BT_HCI_IPC
|
||||
|
||||
endif # BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF5340DK_NRF5340_CPUAPP_NS
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
zephyr,uart-mcumgr = &uart0;
|
||||
zephyr,bt-mon-uart = &uart0;
|
||||
zephyr,bt-c2h-uart = &uart0;
|
||||
zephyr,bt-hci-rpmsg-ipc = &ipc0;
|
||||
zephyr,bt-hci-ipc = &ipc0;
|
||||
nordic,802154-spinel-ipc = &ipc0;
|
||||
zephyr,ieee802154 = &ieee802154;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
zephyr,uart-mcumgr = &uart0;
|
||||
zephyr,bt-mon-uart = &uart0;
|
||||
zephyr,bt-c2h-uart = &uart0;
|
||||
zephyr,bt-hci-rpmsg-ipc = &ipc0;
|
||||
zephyr,bt-hci-ipc = &ipc0;
|
||||
nordic,802154-spinel-ipc = &ipc0;
|
||||
zephyr,sram = &sram1;
|
||||
zephyr,flash = &flash1;
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ config DOMAIN_CPUNET_BOARD
|
|||
help
|
||||
The board which will be used for CPUNET domain when creating a multi
|
||||
image application where one or more images should be located on
|
||||
another board. For example hci_rpmsg on the nRF5340_cpunet for
|
||||
another board. For example hci_ipc on the nRF5340_cpunet for
|
||||
Bluetooth applications.
|
||||
|
||||
endif # BOARD_PAN1783_EVB_CPUAPP
|
||||
|
|
|
|||
|
|
@ -15,11 +15,11 @@ config MBOX_NRFX_IPC
|
|||
if BOARD_PAN1783_EVB_CPUAPP
|
||||
|
||||
choice BT_HCI_BUS_TYPE
|
||||
default BT_RPMSG if BT
|
||||
default BT_HCI_IPC if BT
|
||||
endchoice
|
||||
|
||||
config HEAP_MEM_POOL_SIZE
|
||||
default 4096 if BT_RPMSG
|
||||
default 4096 if BT_HCI_IPC
|
||||
|
||||
endif # BOARD_PAN1783_EVB_CPUAPP
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
zephyr,uart-mcumgr = &uart0;
|
||||
zephyr,bt-mon-uart = &uart0;
|
||||
zephyr,bt-c2h-uart = &uart0;
|
||||
zephyr,bt-hci-rpmsg-ipc = &ipc0;
|
||||
zephyr,bt-hci-ipc = &ipc0;
|
||||
nordic,802154-spinel-ipc = &ipc0;
|
||||
zephyr,ieee802154 = &ieee802154;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
zephyr,uart-mcumgr = &uart0;
|
||||
zephyr,bt-mon-uart = &uart0;
|
||||
zephyr,bt-c2h-uart = &uart0;
|
||||
zephyr,bt-hci-rpmsg-ipc = &ipc0;
|
||||
zephyr,bt-hci-ipc = &ipc0;
|
||||
nordic,802154-spinel-ipc = &ipc0;
|
||||
zephyr,sram = &sram1;
|
||||
zephyr,flash = &flash1;
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ config DOMAIN_CPUNET_BOARD
|
|||
help
|
||||
The board which will be used for CPUNET domain when creating a multi
|
||||
image application where one or more images should be located on
|
||||
another board. For example hci_rpmsg on the nRF5340_cpunet for
|
||||
another board. For example hci_ipc on the nRF5340_cpunet for
|
||||
Bluetooth applications.
|
||||
|
||||
endif # BOARD_RAYTAC_MDBT53_DB_40_NRF5340_CPUAPP || BOARD_RAYTAC_MDBT53_DB_40_NRF5340_CPUAPP_NS
|
||||
|
|
|
|||
|
|
@ -70,11 +70,11 @@ config MBOX_NRFX_IPC
|
|||
if BOARD_RAYTAC_MDBT53_DB_40_NRF5340_CPUAPP || BOARD_RAYTAC_MDBT53_DB_40_NRF5340_CPUAPP_NS
|
||||
|
||||
choice BT_HCI_BUS_TYPE
|
||||
default BT_RPMSG if BT
|
||||
default BT_HCI_IPC if BT
|
||||
endchoice
|
||||
|
||||
config HEAP_MEM_POOL_SIZE
|
||||
default 4096 if BT_RPMSG
|
||||
default 4096 if BT_HCI_IPC
|
||||
|
||||
endif # BOARD_RAYTAC_MDBT53_DB_40_NRF5340_CPUAPP || BOARD_RAYTAC_MDBT53_DB_40_NRF5340_CPUAPP_NS
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
zephyr,uart-mcumgr = &uart0;
|
||||
zephyr,bt-mon-uart = &uart0;
|
||||
zephyr,bt-c2h-uart = &uart0;
|
||||
zephyr,bt-hci-rpmsg-ipc = &ipc0;
|
||||
zephyr,bt-hci-ipc = &ipc0;
|
||||
nordic,802154-spinel-ipc = &ipc0;
|
||||
zephyr,ieee802154 = &ieee802154;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
zephyr,sram = &sram1;
|
||||
zephyr,flash = &flash1;
|
||||
zephyr,code-partition = &slot0_partition;
|
||||
zephyr,bt-hci-rpmsg-ipc = &ipc0;
|
||||
zephyr,bt-hci-ipc = &ipc0;
|
||||
};
|
||||
|
||||
/* These aliases are provided for compatibility with samples */
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ config DOMAIN_CPUNET_BOARD
|
|||
help
|
||||
The board which will be used for CPUNET domain when creating a multi
|
||||
image application where one or more images should be located on
|
||||
another board. For example hci_rpmsg on the nRF5340_cpunet for
|
||||
another board. For example hci_ipc on the nRF5340_cpunet for
|
||||
Bluetooth applications.
|
||||
|
||||
endif # BOARD_RAYTAC_MDBT53V_DB_40_NRF5340_CPUAPP || BOARD_RAYTAC_MDBT53V_DB_40_NRF5340_CPUAPP_NS
|
||||
|
|
|
|||
|
|
@ -70,11 +70,11 @@ config MBOX_NRFX_IPC
|
|||
if BOARD_RAYTAC_MDBT53V_DB_40_NRF5340_CPUAPP || BOARD_RAYTAC_MDBT53V_DB_40_NRF5340_CPUAPP_NS
|
||||
|
||||
choice BT_HCI_BUS_TYPE
|
||||
default BT_RPMSG if BT
|
||||
default BT_HCI_IPC if BT
|
||||
endchoice
|
||||
|
||||
config HEAP_MEM_POOL_SIZE
|
||||
default 4096 if BT_RPMSG
|
||||
default 4096 if BT_HCI_IPC
|
||||
|
||||
endif # BOARD_RAYTAC_MDBT53V_DB_40_NRF5340_CPUAPP || BOARD_RAYTAC_MDBT53V_DB_40_NRF5340_CPUAPP_NS
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
zephyr,uart-mcumgr = &uart0;
|
||||
zephyr,bt-mon-uart = &uart0;
|
||||
zephyr,bt-c2h-uart = &uart0;
|
||||
zephyr,bt-hci-rpmsg-ipc = &ipc0;
|
||||
zephyr,bt-hci-ipc = &ipc0;
|
||||
nordic,802154-spinel-ipc = &ipc0;
|
||||
zephyr,ieee802154 = &ieee802154;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
zephyr,sram = &sram1;
|
||||
zephyr,flash = &flash1;
|
||||
zephyr,code-partition = &slot0_partition;
|
||||
zephyr,bt-hci-rpmsg-ipc = &ipc0;
|
||||
zephyr,bt-hci-ipc = &ipc0;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ config DOMAIN_CPUNET_BOARD
|
|||
help
|
||||
The board which will be used for CPUNET domain when creating a multi
|
||||
image application where one or more images should be located on
|
||||
another board. For example hci_rpmsg on the nRF5340_cpunet for
|
||||
another board. For example hci_ipc on the nRF5340_cpunet for
|
||||
Bluetooth applications.
|
||||
|
||||
endif # BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS
|
||||
|
|
|
|||
|
|
@ -59,11 +59,11 @@ endif # BOARD_THINGY53_NRF5340_CPUAPP_NS
|
|||
if !TRUSTED_EXECUTION_SECURE
|
||||
|
||||
choice BT_HCI_BUS_TYPE
|
||||
default BT_RPMSG if BT
|
||||
default BT_HCI_IPC if BT
|
||||
endchoice
|
||||
|
||||
config HEAP_MEM_POOL_SIZE
|
||||
default 4096 if BT_RPMSG
|
||||
default 4096 if BT_HCI_IPC
|
||||
|
||||
config BT_HAS_HCI_VS
|
||||
default BT
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
zephyr,uart-mcumgr = &cdc_acm_uart;
|
||||
zephyr,bt-mon-uart = &cdc_acm_uart;
|
||||
zephyr,bt-c2h-uart = &cdc_acm_uart;
|
||||
zephyr,bt-hci-rpmsg-ipc = &ipc0;
|
||||
zephyr,bt-hci-ipc = &ipc0;
|
||||
nordic,802154-spinel-ipc = &ipc0;
|
||||
zephyr,ieee802154 = &ieee802154;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
zephyr,uart-mcumgr = &uart0;
|
||||
zephyr,bt-mon-uart = &uart0;
|
||||
zephyr,bt-c2h-uart = &uart0;
|
||||
zephyr,bt-hci-rpmsg-ipc = &ipc0;
|
||||
zephyr,bt-hci-ipc = &ipc0;
|
||||
nordic,802154-spinel-ipc = &ipc0;
|
||||
zephyr,sram = &sram1;
|
||||
zephyr,flash = &flash1;
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ config BT_CTLR
|
|||
depends on BT
|
||||
|
||||
config HEAP_MEM_POOL_SIZE
|
||||
default 4096 if BT_RPMSG
|
||||
default 4096 if BT_HCI_IPC
|
||||
default 4096 if NRF_802154_SER_HOST && BOARD_NRF5340BSIM_NRF5340_CPUAPP
|
||||
default 4096 if NRF_802154_SER_RADIO && BOARD_NRF5340BSIM_NRF5340_CPUNET
|
||||
|
||||
|
|
@ -62,7 +62,7 @@ config IPC_SERVICE_BACKEND_RPMSG_SHMEM_RESET
|
|||
default y if IPC_SERVICE_BACKEND_RPMSG
|
||||
|
||||
choice BT_HCI_BUS_TYPE
|
||||
default BT_RPMSG
|
||||
default BT_HCI_IPC
|
||||
endchoice
|
||||
|
||||
endif # BOARD_NRF5340BSIM_NRF5340_CPUAPP
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@
|
|||
|
||||
chosen {
|
||||
zephyr,flash = &flash0;
|
||||
zephyr,bt-hci-rpmsg-ipc = &ipc0;
|
||||
zephyr,bt-hci-ipc = &ipc0;
|
||||
nordic,802154-spinel-ipc = &ipc0;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
};
|
||||
|
||||
chosen {
|
||||
zephyr,bt-hci-rpmsg-ipc = &ipc0;
|
||||
zephyr,bt-hci-ipc = &ipc0;
|
||||
nordic,802154-spinel-ipc = &ipc0;
|
||||
zephyr,ieee802154 = &ieee802154;
|
||||
/delete-property/ zephyr,flash-controller;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,13 @@ Bootloader
|
|||
Bluetooth
|
||||
=========
|
||||
|
||||
* The HCI implementation for both the Host and the Controller sides has been
|
||||
renamed for the IPC transport. The ``CONFIG_BT_RPMSG`` Kconfig option is now
|
||||
:kconfig:option:`CONFIG_BT_HCI_IPC`, and the ``zephyr,bt-hci-rpmsg-ipc``
|
||||
Devicetree chosen is now ``zephyr,bt-hci-ipc``. The existing sample has also
|
||||
been renamed, from ``samples/bluetooth/hci_rpmsg`` to
|
||||
``samples/bluetooth/hci_ipc``.
|
||||
|
||||
Networking
|
||||
==========
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,24 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
# Remove after 3.7.0 is released
|
||||
if(CONFIG_BT_RPMSG)
|
||||
message(FATAL_ERROR "CONFIG_BT_RPMSG has been renamed to CONFIG_BT_HCI_IPC")
|
||||
endif()
|
||||
|
||||
# Remove after 3.7.0 is released
|
||||
if(CONFIG_BT_HCI_IPC)
|
||||
dt_chosen(chosen_hci_rpmsg PROPERTY "zephyr,bt-hci-rpmsg-ipc")
|
||||
if(DEFINED chosen_hci_rpmsg)
|
||||
message(FATAL_ERROR "zephyr,bt-hci-rpmsg-ipc has been renamed to zephyr,bt-hci-ipc")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
zephyr_library_sources_ifdef(CONFIG_BT_B91 hci_b91.c)
|
||||
zephyr_library_sources_ifdef(CONFIG_BT_CYW43XXX cyw43xxx.c)
|
||||
zephyr_library_sources_ifdef(CONFIG_BT_ESP32 hci_esp32.c)
|
||||
zephyr_library_sources_ifdef(CONFIG_BT_H4 h4.c)
|
||||
zephyr_library_sources_ifdef(CONFIG_BT_H5 h5.c)
|
||||
zephyr_library_sources_ifdef(CONFIG_BT_RPMSG rpmsg.c)
|
||||
zephyr_library_sources_ifdef(CONFIG_BT_HCI_IPC ipc.c)
|
||||
zephyr_library_sources_ifdef(CONFIG_BT_SPI spi.c)
|
||||
zephyr_library_sources_ifdef(CONFIG_BT_STM32_IPM ipm_stm32wb.c)
|
||||
zephyr_library_sources_ifdef(CONFIG_BT_USERCHAN userchan.c)
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ config BT_UART
|
|||
select SERIAL
|
||||
select UART_INTERRUPT_DRIVEN
|
||||
|
||||
|
||||
choice BT_HCI_BUS_TYPE
|
||||
prompt "Bluetooth HCI driver"
|
||||
|
||||
|
|
@ -28,14 +29,21 @@ config BT_H5
|
|||
Bluetooth three-wire (H:5) UART driver. Implementation of HCI
|
||||
Three-Wire UART Transport Layer.
|
||||
|
||||
# Removed: Here only to give the user a warning about its removal
|
||||
# Remove after 3.7.0 is released
|
||||
config BT_RPMSG
|
||||
bool "HCI using RPMsg"
|
||||
bool "[REMOVED] HCI using RPMsg"
|
||||
help
|
||||
Use BT_HCI_IPC instead
|
||||
|
||||
config BT_HCI_IPC
|
||||
bool "HCI using the IPC subsystem"
|
||||
select BT_HAS_HCI_VS
|
||||
select IPC_SERVICE
|
||||
select MBOX
|
||||
help
|
||||
Bluetooth HCI driver for communication with another CPU
|
||||
using RPMsg framework.
|
||||
using the IPC subsystem.
|
||||
|
||||
config BT_SPI
|
||||
bool "SPI HCI"
|
||||
|
|
@ -145,7 +153,7 @@ source "drivers/bluetooth/hci/Kconfig.infineon"
|
|||
config BT_DRIVER_QUIRK_NO_AUTO_DLE
|
||||
bool "Host auto-initiated Data Length Update quirk"
|
||||
depends on BT_AUTO_DATA_LEN_UPDATE
|
||||
default y if BT_RPMSG || BT_ESP32
|
||||
default y if BT_HCI_IPC || BT_ESP32
|
||||
help
|
||||
Enable the quirk wherein BT Host stack will auto-initiate Data Length
|
||||
Update procedure for new connections for controllers that do not
|
||||
|
|
|
|||
|
|
@ -18,11 +18,11 @@
|
|||
#include <zephyr/logging/log.h>
|
||||
LOG_MODULE_REGISTER(bt_hci_driver);
|
||||
|
||||
#define RPMSG_CMD 0x01
|
||||
#define RPMSG_ACL 0x02
|
||||
#define RPMSG_SCO 0x03
|
||||
#define RPMSG_EVT 0x04
|
||||
#define RPMSG_ISO 0x05
|
||||
#define IPC_CMD 0x01
|
||||
#define IPC_ACL 0x02
|
||||
#define IPC_SCO 0x03
|
||||
#define IPC_EVT 0x04
|
||||
#define IPC_ISO 0x05
|
||||
|
||||
#define IPC_BOUND_TIMEOUT_IN_MS K_MSEC(1000)
|
||||
|
||||
|
|
@ -65,7 +65,7 @@ static bool is_hci_event_discardable(const uint8_t *evt_data)
|
|||
}
|
||||
}
|
||||
|
||||
static struct net_buf *bt_rpmsg_evt_recv(const uint8_t *data, size_t remaining)
|
||||
static struct net_buf *bt_ipc_evt_recv(const uint8_t *data, size_t remaining)
|
||||
{
|
||||
bool discardable;
|
||||
struct bt_hci_evt_hdr hdr;
|
||||
|
|
@ -114,7 +114,7 @@ static struct net_buf *bt_rpmsg_evt_recv(const uint8_t *data, size_t remaining)
|
|||
return buf;
|
||||
}
|
||||
|
||||
static struct net_buf *bt_rpmsg_acl_recv(const uint8_t *data, size_t remaining)
|
||||
static struct net_buf *bt_ipc_acl_recv(const uint8_t *data, size_t remaining)
|
||||
{
|
||||
struct bt_hci_acl_hdr hdr;
|
||||
struct net_buf *buf;
|
||||
|
|
@ -156,7 +156,7 @@ static struct net_buf *bt_rpmsg_acl_recv(const uint8_t *data, size_t remaining)
|
|||
return buf;
|
||||
}
|
||||
|
||||
static struct net_buf *bt_rpmsg_iso_recv(const uint8_t *data, size_t remaining)
|
||||
static struct net_buf *bt_ipc_iso_recv(const uint8_t *data, size_t remaining)
|
||||
{
|
||||
struct bt_hci_iso_hdr hdr;
|
||||
struct net_buf *buf;
|
||||
|
|
@ -198,28 +198,28 @@ static struct net_buf *bt_rpmsg_iso_recv(const uint8_t *data, size_t remaining)
|
|||
return buf;
|
||||
}
|
||||
|
||||
static void bt_rpmsg_rx(const uint8_t *data, size_t len)
|
||||
static void bt_ipc_rx(const uint8_t *data, size_t len)
|
||||
{
|
||||
uint8_t pkt_indicator;
|
||||
struct net_buf *buf = NULL;
|
||||
size_t remaining = len;
|
||||
|
||||
LOG_HEXDUMP_DBG(data, len, "RPMsg data:");
|
||||
LOG_HEXDUMP_DBG(data, len, "ipc data:");
|
||||
|
||||
pkt_indicator = *data++;
|
||||
remaining -= sizeof(pkt_indicator);
|
||||
|
||||
switch (pkt_indicator) {
|
||||
case RPMSG_EVT:
|
||||
buf = bt_rpmsg_evt_recv(data, remaining);
|
||||
case IPC_EVT:
|
||||
buf = bt_ipc_evt_recv(data, remaining);
|
||||
break;
|
||||
|
||||
case RPMSG_ACL:
|
||||
buf = bt_rpmsg_acl_recv(data, remaining);
|
||||
case IPC_ACL:
|
||||
buf = bt_ipc_acl_recv(data, remaining);
|
||||
break;
|
||||
|
||||
case RPMSG_ISO:
|
||||
buf = bt_rpmsg_iso_recv(data, remaining);
|
||||
case IPC_ISO:
|
||||
buf = bt_ipc_iso_recv(data, remaining);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
@ -247,7 +247,7 @@ static void bt_rpmsg_rx(const uint8_t *data, size_t len)
|
|||
}
|
||||
}
|
||||
|
||||
static int bt_rpmsg_send(struct net_buf *buf)
|
||||
static int bt_ipc_send(struct net_buf *buf)
|
||||
{
|
||||
int err;
|
||||
uint8_t pkt_indicator;
|
||||
|
|
@ -256,13 +256,13 @@ static int bt_rpmsg_send(struct net_buf *buf)
|
|||
|
||||
switch (bt_buf_get_type(buf)) {
|
||||
case BT_BUF_ACL_OUT:
|
||||
pkt_indicator = RPMSG_ACL;
|
||||
pkt_indicator = IPC_ACL;
|
||||
break;
|
||||
case BT_BUF_CMD:
|
||||
pkt_indicator = RPMSG_CMD;
|
||||
pkt_indicator = IPC_CMD;
|
||||
break;
|
||||
case BT_BUF_ISO_OUT:
|
||||
pkt_indicator = RPMSG_ISO;
|
||||
pkt_indicator = IPC_ISO;
|
||||
break;
|
||||
default:
|
||||
LOG_ERR("Unknown type %u", bt_buf_get_type(buf));
|
||||
|
|
@ -288,7 +288,7 @@ static void hci_ept_bound(void *priv)
|
|||
|
||||
static void hci_ept_recv(const void *data, size_t len, void *priv)
|
||||
{
|
||||
bt_rpmsg_rx(data, len);
|
||||
bt_ipc_rx(data, len);
|
||||
}
|
||||
|
||||
static struct ipc_ept_cfg hci_ept_cfg = {
|
||||
|
|
@ -311,11 +311,12 @@ int __weak bt_hci_transport_teardown(const struct device *dev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int bt_rpmsg_open(void)
|
||||
static int bt_ipc_open(void)
|
||||
{
|
||||
int err;
|
||||
|
||||
const struct device *hci_ipc_instance =
|
||||
DEVICE_DT_GET(DT_CHOSEN(zephyr_bt_hci_rpmsg_ipc));
|
||||
DEVICE_DT_GET(DT_CHOSEN(zephyr_bt_hci_ipc));
|
||||
|
||||
err = bt_hci_transport_setup(NULL);
|
||||
if (err) {
|
||||
|
|
@ -346,7 +347,7 @@ static int bt_rpmsg_open(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int bt_rpmsg_close(void)
|
||||
static int bt_ipc_close(void)
|
||||
{
|
||||
int err;
|
||||
|
||||
|
|
@ -365,7 +366,7 @@ static int bt_rpmsg_close(void)
|
|||
}
|
||||
|
||||
const struct device *hci_ipc_instance =
|
||||
DEVICE_DT_GET(DT_CHOSEN(zephyr_bt_hci_rpmsg_ipc));
|
||||
DEVICE_DT_GET(DT_CHOSEN(zephyr_bt_hci_ipc));
|
||||
|
||||
err = ipc_service_close_instance(hci_ipc_instance);
|
||||
if (err) {
|
||||
|
|
@ -383,17 +384,17 @@ static int bt_rpmsg_close(void)
|
|||
}
|
||||
|
||||
static const struct bt_hci_driver drv = {
|
||||
.name = "RPMsg",
|
||||
.open = bt_rpmsg_open,
|
||||
.close = bt_rpmsg_close,
|
||||
.send = bt_rpmsg_send,
|
||||
.name = "IPC",
|
||||
.open = bt_ipc_open,
|
||||
.close = bt_ipc_close,
|
||||
.send = bt_ipc_send,
|
||||
.bus = BT_HCI_DRIVER_BUS_IPM,
|
||||
#if defined(CONFIG_BT_DRIVER_QUIRK_NO_AUTO_DLE)
|
||||
.quirks = BT_QUIRK_NO_AUTO_DLE,
|
||||
#endif
|
||||
};
|
||||
|
||||
static int bt_rpmsg_init(void)
|
||||
static int bt_ipc_init(void)
|
||||
{
|
||||
|
||||
int err;
|
||||
|
|
@ -406,4 +407,4 @@ static int bt_rpmsg_init(void)
|
|||
return err;
|
||||
}
|
||||
|
||||
SYS_INIT(bt_rpmsg_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
|
||||
SYS_INIT(bt_ipc_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
|
||||
|
|
@ -245,7 +245,7 @@ int bt_hci_transport_setup(const struct device *dev);
|
|||
/**
|
||||
* @brief Teardown the HCI transport.
|
||||
*
|
||||
* @note A weak version of this function is included in the RPMSG driver, so
|
||||
* @note A weak version of this function is included in the IPC driver, so
|
||||
* defining it is optional. NRF5340 includes support to put network core
|
||||
* in reset state.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ documentation and are prefixed with :literal:`hci_` in their folder names.
|
|||
``-DBOARD=nrf5340dk_nrf5340_cpuapp`` or
|
||||
``-DBOARD=nrf5340dk_nrf5340_cpuapp_ns``) you must also build
|
||||
and program the corresponding sample for the nRF5340 network core
|
||||
:ref:`bluetooth-hci-rpmsg-sample` which implements the Bluetooth
|
||||
:ref:`bluetooth-hci-ipc-sample` which implements the Bluetooth
|
||||
Low Energy controller.
|
||||
|
||||
.. note::
|
||||
|
|
|
|||
|
|
@ -37,21 +37,21 @@ changing ``nrf52833dk_nrf52833`` as needed for your board:
|
|||
:compact:
|
||||
|
||||
To run the application on nRF5340DK, a Bluetooth controller application must
|
||||
also run on the network core. The :ref:`bluetooth-hci-rpmsg-sample` sample
|
||||
also run on the network core. The :ref:`bluetooth-hci-ipc-sample` sample
|
||||
application may be used. To build this sample with direction finding support
|
||||
enabled:
|
||||
|
||||
* Copy
|
||||
:zephyr_file:`samples/bluetooth/direction_finding_central/boards/nrf52833dk_nrf52833.overlay`
|
||||
to a new file,
|
||||
:file:`samples/bluetooth/hci_rpmsg/boards/nrf5340dk_nrf5340_cpunet.overlay`.
|
||||
:file:`samples/bluetooth/hci_ipc/boards/nrf5340dk_nrf5340_cpunet.overlay`.
|
||||
* Make sure the same GPIO pins are assigned to Direction Finding Extension in file
|
||||
:zephyr_file:`samples/bluetooth/direction_finding_central/boards/nrf5340dk_nrf5340_cpuapp.overlay`.
|
||||
as those in the created file :file:`samples/bluetooth/hci_rpmsg/boards/nrf5340dk_nrf5340_cpunet.overlay`.
|
||||
as those in the created file :file:`samples/bluetooth/hci_ipc/boards/nrf5340dk_nrf5340_cpunet.overlay`.
|
||||
* Copy
|
||||
:zephyr_file:`samples/bluetooth/direction_finding_central/boards/nrf52833dk_nrf52833.conf`
|
||||
to a new file,
|
||||
:file:`samples/bluetooth/hci_rpmsg/boards/nrf5340dk_nrf5340_cpunet.conf`.
|
||||
:file:`samples/bluetooth/hci_ipc/boards/nrf5340dk_nrf5340_cpunet.conf`.
|
||||
|
||||
Antenna matrix configuration
|
||||
****************************
|
||||
|
|
@ -69,8 +69,8 @@ this overlay. See :ref:`set-devicetree-overlays` for information on setting up
|
|||
and using overlays.
|
||||
|
||||
Note that antenna matrix configuration for the nRF5340 SoC is part of the
|
||||
network core application. When :ref:`bluetooth-hci-rpmsg-sample` is used as the
|
||||
network core application. When :ref:`bluetooth-hci-ipc-sample` is used as the
|
||||
network core application, the antenna matrix configuration should be stored in
|
||||
the file
|
||||
:file:`samples/bluetooth/hci_rpmsg/boards/nrf5340dk_nrf5340_cpunet.overlay`
|
||||
:file:`samples/bluetooth/hci_ipc/boards/nrf5340dk_nrf5340_cpunet.overlay`
|
||||
instead.
|
||||
|
|
|
|||
|
|
@ -37,21 +37,21 @@ changing ``nrf52833dk_nrf52833`` as needed for your board:
|
|||
:compact:
|
||||
|
||||
To run the application on nRF5340DK, a Bluetooth controller application must
|
||||
also run on the network core. The :ref:`bluetooth-hci-rpmsg-sample` sample
|
||||
also run on the network core. The :ref:`bluetooth-hci-ipc-sample` sample
|
||||
application may be used. To build this sample with direction finding support
|
||||
enabled:
|
||||
|
||||
* Copy
|
||||
:zephyr_file:`samples/bluetooth/direction_finding_connectionless_rx/boards/nrf52833dk_nrf52833.overlay`
|
||||
to a new file,
|
||||
:file:`samples/bluetooth/hci_rpmsg/boards/nrf5340dk_nrf5340_cpunet.overlay`.
|
||||
:file:`samples/bluetooth/hci_ipc/boards/nrf5340dk_nrf5340_cpunet.overlay`.
|
||||
* Make sure the same GPIO pins are assigned to Direction Finding Extension in file
|
||||
:zephyr_file:`samples/bluetooth/direction_finding_connectionless_rx/boards/nrf5340dk_nrf5340_cpuapp.overlay`.
|
||||
as those in the created file :file:`samples/bluetooth/hci_rpmsg/boards/nrf5340dk_nrf5340_cpunet.overlay`.
|
||||
as those in the created file :file:`samples/bluetooth/hci_ipc/boards/nrf5340dk_nrf5340_cpunet.overlay`.
|
||||
* Copy
|
||||
:zephyr_file:`samples/bluetooth/direction_finding_connectionless_rx/boards/nrf52833dk_nrf52833.conf`
|
||||
to a new file,
|
||||
:file:`samples/bluetooth/hci_rpmsg/boards/nrf5340dk_nrf5340_cpunet.conf`. Add
|
||||
:file:`samples/bluetooth/hci_ipc/boards/nrf5340dk_nrf5340_cpunet.conf`. Add
|
||||
the line ``CONFIG_BT_EXT_ADV=y`` to enable extended size of
|
||||
:kconfig:option:`CONFIG_BT_BUF_CMD_TX_SIZE` to support the LE Set Extended Advertising
|
||||
Data command.
|
||||
|
|
@ -72,8 +72,8 @@ this overlay. See :ref:`set-devicetree-overlays` for information on setting up
|
|||
and using overlays.
|
||||
|
||||
Note that antenna matrix configuration for the nRF5340 SoC is part of the
|
||||
network core application. When :ref:`bluetooth-hci-rpmsg-sample` is used as the
|
||||
network core application. When :ref:`bluetooth-hci-ipc-sample` is used as the
|
||||
network core application, the antenna matrix configuration should be stored in
|
||||
the file
|
||||
:file:`samples/bluetooth/hci_rpmsg/boards/nrf5340dk_nrf5340_cpunet.overlay`
|
||||
:file:`samples/bluetooth/hci_ipc/boards/nrf5340dk_nrf5340_cpunet.overlay`
|
||||
instead.
|
||||
|
|
|
|||
|
|
@ -37,21 +37,21 @@ To use Angle of Arrival mode only, build this application as follows, changing
|
|||
:compact:
|
||||
|
||||
To run the application on nRF5340DK, a Bluetooth controller application must
|
||||
also run on the network core. The :zephyr_file:`samples/bluetooth/hci_rpmsg`
|
||||
also run on the network core. The :zephyr_file:`samples/bluetooth/hci_ipc`
|
||||
sample application may be used. To build this sample with direction finding
|
||||
support enabled:
|
||||
|
||||
* Copy
|
||||
:zephyr_file:`samples/bluetooth/direction_finding_connectionless_tx/boards/nrf52833dk_nrf52833.overlay`
|
||||
to a new file,
|
||||
:file:`samples/bluetooth/hci_rpmsg/boards/nrf5340dk_nrf5340_cpunet.overlay`.
|
||||
:file:`samples/bluetooth/hci_ipc/boards/nrf5340dk_nrf5340_cpunet.overlay`.
|
||||
* Make sure the same GPIO pins are assigned to Direction Finding Extension in file
|
||||
:zephyr_file:`samples/bluetooth/direction_finding_connectionless_tx/boards/nrf5340dk_nrf5340_cpuapp.overlay`.
|
||||
as those in the created file :file:`samples/bluetooth/hci_rpmsg/boards/nrf5340dk_nrf5340_cpunet.overlay`.
|
||||
as those in the created file :file:`samples/bluetooth/hci_ipc/boards/nrf5340dk_nrf5340_cpunet.overlay`.
|
||||
* Copy
|
||||
:zephyr_file:`samples/bluetooth/direction_finding_connectionless_tx/boards/nrf52833dk_nrf52833.conf`
|
||||
to a new file,
|
||||
:file:`samples/bluetooth/hci_rpmsg/boards/nrf5340dk_nrf5340_cpunet.conf`. Add
|
||||
:file:`samples/bluetooth/hci_ipc/boards/nrf5340dk_nrf5340_cpunet.conf`. Add
|
||||
the line ``CONFIG_BT_EXT_ADV=y`` to enable extended size of
|
||||
:kconfig:option:`CONFIG_BT_BUF_CMD_TX_SIZE` to support the LE Set Extended
|
||||
Advertising Data command.
|
||||
|
|
@ -73,10 +73,10 @@ this overlay. See :ref:`set-devicetree-overlays` for information on setting up
|
|||
and using overlays.
|
||||
|
||||
Note that antenna matrix configuration for the nRF5340 SoC is part of the
|
||||
network core application. When :ref:`bluetooth-hci-rpmsg-sample` is used as
|
||||
network core application. When :ref:`bluetooth-hci-ipc-sample` is used as
|
||||
network core application, the antenna matrix configuration should be stored in
|
||||
the file
|
||||
:file:`samples/bluetooth/hci_rpmsg/boards/nrf5340dk_nrf5340_cpunet.overlay`
|
||||
:file:`samples/bluetooth/hci_ipc/boards/nrf5340dk_nrf5340_cpunet.overlay`
|
||||
instead.
|
||||
|
||||
In addition to the devicetree configuration, to successfully use the Direction
|
||||
|
|
|
|||
|
|
@ -36,21 +36,21 @@ changing ``nrf52833dk_nrf52833`` as needed for your board:
|
|||
:compact:
|
||||
|
||||
To run the application on nRF5340DK, a Bluetooth controller application must
|
||||
also run on the network core. The :ref:`bluetooth-hci-rpmsg-sample` sample
|
||||
also run on the network core. The :ref:`bluetooth-hci-ipc-sample` sample
|
||||
application may be used. To build this sample with direction finding support
|
||||
enabled:
|
||||
|
||||
* Copy
|
||||
:zephyr_file:`samples/bluetooth/direction_finding_peripheral/boards/nrf52833dk_nrf52833.overlay`
|
||||
to a new file,
|
||||
:file:`samples/bluetooth/hci_rpmsg/boards/nrf5340dk_nrf5340_cpunet.overlay`.
|
||||
:file:`samples/bluetooth/hci_ipc/boards/nrf5340dk_nrf5340_cpunet.overlay`.
|
||||
* Make sure the same GPIO pins are assigned to Direction Finding Extension in file
|
||||
:zephyr_file:`samples/bluetooth/direction_finding_peripheral/boards/nrf5340dk_nrf5340_cpuapp.overlay`.
|
||||
as those in the created file :file:`samples/bluetooth/hci_rpmsg/boards/nrf5340dk_nrf5340_cpunet.overlay`.
|
||||
as those in the created file :file:`samples/bluetooth/hci_ipc/boards/nrf5340dk_nrf5340_cpunet.overlay`.
|
||||
* Copy
|
||||
:zephyr_file:`samples/bluetooth/direction_finding_peripheral/boards/nrf52833dk_nrf52833.conf`
|
||||
to a new file,
|
||||
:file:`samples/bluetooth/hci_rpmsg/boards/nrf5340dk_nrf5340_cpunet.conf`.
|
||||
:file:`samples/bluetooth/hci_ipc/boards/nrf5340dk_nrf5340_cpunet.conf`.
|
||||
|
||||
Antenna matrix configuration
|
||||
****************************
|
||||
|
|
@ -68,8 +68,8 @@ this overlay. See :ref:`set-devicetree-overlays` for information on setting up
|
|||
and using overlays.
|
||||
|
||||
Note that antenna matrix configuration for the nRF5340 SoC is part of the
|
||||
network core application. When :ref:`bluetooth-hci-rpmsg-sample` is used as the
|
||||
network core application. When :ref:`bluetooth-hci-ipc-sample` is used as the
|
||||
network core application, the antenna matrix configuration should be stored in
|
||||
the file
|
||||
:file:`samples/bluetooth/hci_rpmsg/boards/nrf5340dk_nrf5340_cpunet.overlay`
|
||||
:file:`samples/bluetooth/hci_ipc/boards/nrf5340dk_nrf5340_cpunet.overlay`
|
||||
instead.
|
||||
|
|
|
|||
14
samples/bluetooth/hci_ipc/CMakeLists.txt
Normal file
14
samples/bluetooth/hci_ipc/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
cmake_minimum_required(VERSION 3.20.0)
|
||||
|
||||
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
|
||||
project(hci_ipc)
|
||||
|
||||
target_sources(app PRIVATE src/main.c)
|
||||
|
||||
# Remove after 3.7.0 is released
|
||||
dt_chosen(chosen_hci_rpmsg PROPERTY "zephyr,bt-hci-rpmsg-ipc")
|
||||
if(DEFINED chosen_hci_rpmsg)
|
||||
message(FATAL_ERROR "zephyr,bt-hci-rpmsg-ipc has been renamed to zephyr,bt-hci-ipc")
|
||||
endif()
|
||||
|
|
@ -1,37 +1,36 @@
|
|||
.. _bluetooth-hci-rpmsg-sample:
|
||||
.. _bluetooth-hci-ipc-sample:
|
||||
|
||||
Bluetooth: HCI RPMsg
|
||||
####################
|
||||
Bluetooth: HCI IPC
|
||||
##################
|
||||
|
||||
Overview
|
||||
********
|
||||
|
||||
This sample exposes :ref:`bluetooth_controller` support
|
||||
to another device or CPU using RPMsg transport which is
|
||||
a part of `OpenAMP <https://github.com/OpenAMP/open-amp/>`__.
|
||||
to another device or CPU using IPC subsystem.
|
||||
|
||||
Requirements
|
||||
************
|
||||
|
||||
* A board with :ref:`ipm_api` driver and Bluetooth LE support
|
||||
* A board with IPC subsystem and Bluetooth LE support
|
||||
|
||||
Building and Running
|
||||
********************
|
||||
|
||||
This sample can be found under :zephyr_file:`samples/bluetooth/hci_rpmsg`
|
||||
This sample can be found under :zephyr_file:`samples/bluetooth/hci_ipc`
|
||||
in the Zephyr tree.
|
||||
|
||||
To use this application, you need a board with a Bluetooth controller
|
||||
and IPM drivers.
|
||||
and IPC support.
|
||||
You can then build this application and flash it onto your board in
|
||||
the usual way. See :ref:`boards` for board-specific building and
|
||||
programming information.
|
||||
|
||||
To test this sample, you need a separate device/CPU that acts as Bluetooth
|
||||
HCI RPMsg peer.
|
||||
This sample is compatible with the HCI RPMsg driver provided by
|
||||
HCI IPC peer.
|
||||
This sample is compatible with the HCI IPC driver provided by
|
||||
Zephyr's Bluetooth :ref:`bt_hci_drivers` core. See the
|
||||
:kconfig:option:`CONFIG_BT_RPMSG` configuration option for more information.
|
||||
:kconfig:option:`CONFIG_BT_HCI_IPC` configuration option for more information.
|
||||
|
||||
You might need to adjust the Kconfig configuration of this sample to make it
|
||||
compatible with the peer application. For example, :kconfig:option:`CONFIG_BT_MAX_CONN`
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
sample:
|
||||
description: Allows Zephyr to provide Bluetooth connectivity via RPMsg.
|
||||
name: Bluetooth HCI RPMsg
|
||||
description: Allows Zephyr to provide Bluetooth connectivity via IPC
|
||||
name: Bluetooth HCI IPC
|
||||
tests:
|
||||
sample.bluetooth.hci_rpmsg:
|
||||
sample.bluetooth.hci_ipc:
|
||||
harness: bluetooth
|
||||
tags: bluetooth
|
||||
platform_allow:
|
||||
|
|
@ -12,7 +12,7 @@ tests:
|
|||
integration_platforms:
|
||||
- nrf5340dk_nrf5340_cpunet
|
||||
- nrf5340_audio_dk_nrf5340_cpunet
|
||||
sample.bluetooth.hci_rpmsg.iso_broadcast.bt_ll_sw_split:
|
||||
sample.bluetooth.hci_ipc.iso_broadcast.bt_ll_sw_split:
|
||||
harness: bluetooth
|
||||
tags: bluetooth
|
||||
extra_args: CONF_FILE="nrf5340_cpunet_iso_broadcast-bt_ll_sw_split.conf"
|
||||
|
|
@ -23,7 +23,7 @@ tests:
|
|||
integration_platforms:
|
||||
- nrf5340dk_nrf5340_cpunet
|
||||
- nrf5340_audio_dk_nrf5340_cpunet
|
||||
sample.bluetooth.hci_rpmsg.iso_receive.bt_ll_sw_split:
|
||||
sample.bluetooth.hci_ipc.iso_receive.bt_ll_sw_split:
|
||||
harness: bluetooth
|
||||
tags: bluetooth
|
||||
extra_args: CONF_FILE="nrf5340_cpunet_iso_receive-bt_ll_sw_split.conf"
|
||||
|
|
@ -33,7 +33,7 @@ tests:
|
|||
- nrf5340bsim_nrf5340_cpunet
|
||||
integration_platforms:
|
||||
- nrf5340dk_nrf5340_cpunet
|
||||
sample.bluetooth.hci_rpmsg.bis.bt_ll_sw_split:
|
||||
sample.bluetooth.hci_ipc.bis.bt_ll_sw_split:
|
||||
harness: bluetooth
|
||||
tags: bluetooth
|
||||
extra_args: CONF_FILE="nrf5340_cpunet_bis-bt_ll_sw_split.conf"
|
||||
|
|
@ -43,7 +43,7 @@ tests:
|
|||
- nrf5340bsim_nrf5340_cpunet
|
||||
integration_platforms:
|
||||
- nrf5340dk_nrf5340_cpunet
|
||||
sample.bluetooth.hci_rpmsg.iso_central.bt_ll_sw_split:
|
||||
sample.bluetooth.hci_ipc.iso_central.bt_ll_sw_split:
|
||||
harness: bluetooth
|
||||
tags: bluetooth
|
||||
extra_args: CONF_FILE="nrf5340_cpunet_iso_central-bt_ll_sw_split.conf"
|
||||
|
|
@ -53,7 +53,7 @@ tests:
|
|||
- nrf5340bsim_nrf5340_cpunet
|
||||
integration_platforms:
|
||||
- nrf5340dk_nrf5340_cpunet
|
||||
sample.bluetooth.hci_rpmsg.iso_peripheral.bt_ll_sw_split:
|
||||
sample.bluetooth.hci_ipc.iso_peripheral.bt_ll_sw_split:
|
||||
harness: bluetooth
|
||||
tags: bluetooth
|
||||
extra_args: CONF_FILE="nrf5340_cpunet_iso_peripheral-bt_ll_sw_split.conf"
|
||||
|
|
@ -63,7 +63,7 @@ tests:
|
|||
- nrf5340bsim_nrf5340_cpunet
|
||||
integration_platforms:
|
||||
- nrf5340dk_nrf5340_cpunet
|
||||
sample.bluetooth.hci_rpmsg.cis.bt_ll_sw_split:
|
||||
sample.bluetooth.hci_ipc.cis.bt_ll_sw_split:
|
||||
harness: bluetooth
|
||||
tags: bluetooth
|
||||
extra_args: CONF_FILE="nrf5340_cpunet_cis-bt_ll_sw_split.conf"
|
||||
|
|
@ -73,7 +73,7 @@ tests:
|
|||
- nrf5340bsim_nrf5340_cpunet
|
||||
integration_platforms:
|
||||
- nrf5340dk_nrf5340_cpunet
|
||||
sample.bluetooth.hci_rpmsg.iso.bt_ll_sw_split:
|
||||
sample.bluetooth.hci_ipc.iso.bt_ll_sw_split:
|
||||
harness: bluetooth
|
||||
tags: bluetooth
|
||||
extra_args: CONF_FILE="nrf5340_cpunet_iso-bt_ll_sw_split.conf"
|
||||
|
|
@ -82,7 +82,7 @@ tests:
|
|||
- nrf5340bsim_nrf5340_cpunet
|
||||
integration_platforms:
|
||||
- nrf5340dk_nrf5340_cpunet
|
||||
sample.bluetooth.hci_rpmsg.df.bt_ll_sw_split:
|
||||
sample.bluetooth.hci_ipc.df.bt_ll_sw_split:
|
||||
harness: bluetooth
|
||||
tags: bluetooth
|
||||
extra_args:
|
||||
|
|
@ -91,7 +91,7 @@ tests:
|
|||
platform_allow: nrf5340dk_nrf5340_cpunet
|
||||
integration_platforms:
|
||||
- nrf5340dk_nrf5340_cpunet
|
||||
sample.bluetooth.hci_rpmsg.df.no_phy_coded.bt_ll_sw_split:
|
||||
sample.bluetooth.hci_ipc.df.no_phy_coded.bt_ll_sw_split:
|
||||
harness: bluetooth
|
||||
tags: bluetooth
|
||||
extra_args:
|
||||
|
|
@ -101,7 +101,7 @@ tests:
|
|||
platform_allow: nrf5340dk_nrf5340_cpunet
|
||||
integration_platforms:
|
||||
- nrf5340dk_nrf5340_cpunet
|
||||
sample.bluetooth.hci_rpmsg.mesh.bt_ll_sw_split:
|
||||
sample.bluetooth.hci_ipc.mesh.bt_ll_sw_split:
|
||||
harness: bluetooth
|
||||
tags: bluetooth
|
||||
extra_args: CONF_FILE="nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf"
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
#include <zephyr/logging/log_ctrl.h>
|
||||
#include <zephyr/logging/log.h>
|
||||
|
||||
LOG_MODULE_REGISTER(hci_rpmsg, CONFIG_BT_LOG_LEVEL);
|
||||
LOG_MODULE_REGISTER(hci_ipc, CONFIG_BT_LOG_LEVEL);
|
||||
|
||||
static struct ipc_ept hci_ept;
|
||||
|
||||
|
|
@ -42,16 +42,16 @@ static K_SEM_DEFINE(ipc_bound_sem, 0, 1);
|
|||
static bool ipc_ept_ready;
|
||||
#endif /* CONFIG_BT_CTLR_ASSERT_HANDLER || CONFIG_BT_HCI_VS_FATAL_ERROR */
|
||||
|
||||
#define HCI_RPMSG_CMD 0x01
|
||||
#define HCI_RPMSG_ACL 0x02
|
||||
#define HCI_RPMSG_SCO 0x03
|
||||
#define HCI_RPMSG_EVT 0x04
|
||||
#define HCI_RPMSG_ISO 0x05
|
||||
#define HCI_IPC_CMD 0x01
|
||||
#define HCI_IPC_ACL 0x02
|
||||
#define HCI_IPC_SCO 0x03
|
||||
#define HCI_IPC_EVT 0x04
|
||||
#define HCI_IPC_ISO 0x05
|
||||
|
||||
#define HCI_FATAL_ERR_MSG true
|
||||
#define HCI_REGULAR_MSG false
|
||||
|
||||
static struct net_buf *hci_rpmsg_cmd_recv(uint8_t *data, size_t remaining)
|
||||
static struct net_buf *hci_ipc_cmd_recv(uint8_t *data, size_t remaining)
|
||||
{
|
||||
struct bt_hci_cmd_hdr *hdr = (void *)data;
|
||||
struct net_buf *buf;
|
||||
|
|
@ -88,7 +88,7 @@ static struct net_buf *hci_rpmsg_cmd_recv(uint8_t *data, size_t remaining)
|
|||
return buf;
|
||||
}
|
||||
|
||||
static struct net_buf *hci_rpmsg_acl_recv(uint8_t *data, size_t remaining)
|
||||
static struct net_buf *hci_ipc_acl_recv(uint8_t *data, size_t remaining)
|
||||
{
|
||||
struct bt_hci_acl_hdr *hdr = (void *)data;
|
||||
struct net_buf *buf;
|
||||
|
|
@ -125,7 +125,7 @@ static struct net_buf *hci_rpmsg_acl_recv(uint8_t *data, size_t remaining)
|
|||
return buf;
|
||||
}
|
||||
|
||||
static struct net_buf *hci_rpmsg_iso_recv(uint8_t *data, size_t remaining)
|
||||
static struct net_buf *hci_ipc_iso_recv(uint8_t *data, size_t remaining)
|
||||
{
|
||||
struct bt_hci_iso_hdr *hdr = (void *)data;
|
||||
struct net_buf *buf;
|
||||
|
|
@ -162,28 +162,28 @@ static struct net_buf *hci_rpmsg_iso_recv(uint8_t *data, size_t remaining)
|
|||
return buf;
|
||||
}
|
||||
|
||||
static void hci_rpmsg_rx(uint8_t *data, size_t len)
|
||||
static void hci_ipc_rx(uint8_t *data, size_t len)
|
||||
{
|
||||
uint8_t pkt_indicator;
|
||||
struct net_buf *buf = NULL;
|
||||
size_t remaining = len;
|
||||
|
||||
LOG_HEXDUMP_DBG(data, len, "RPMSG data:");
|
||||
LOG_HEXDUMP_DBG(data, len, "IPC data:");
|
||||
|
||||
pkt_indicator = *data++;
|
||||
remaining -= sizeof(pkt_indicator);
|
||||
|
||||
switch (pkt_indicator) {
|
||||
case HCI_RPMSG_CMD:
|
||||
buf = hci_rpmsg_cmd_recv(data, remaining);
|
||||
case HCI_IPC_CMD:
|
||||
buf = hci_ipc_cmd_recv(data, remaining);
|
||||
break;
|
||||
|
||||
case HCI_RPMSG_ACL:
|
||||
buf = hci_rpmsg_acl_recv(data, remaining);
|
||||
case HCI_IPC_ACL:
|
||||
buf = hci_ipc_acl_recv(data, remaining);
|
||||
break;
|
||||
|
||||
case HCI_RPMSG_ISO:
|
||||
buf = hci_rpmsg_iso_recv(data, remaining);
|
||||
case HCI_IPC_ISO:
|
||||
buf = hci_ipc_iso_recv(data, remaining);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
@ -220,7 +220,7 @@ static void tx_thread(void *p1, void *p2, void *p3)
|
|||
}
|
||||
}
|
||||
|
||||
static void hci_rpmsg_send(struct net_buf *buf, bool is_fatal_err)
|
||||
static void hci_ipc_send(struct net_buf *buf, bool is_fatal_err)
|
||||
{
|
||||
uint8_t pkt_indicator;
|
||||
uint8_t retries = 0;
|
||||
|
|
@ -232,13 +232,13 @@ static void hci_rpmsg_send(struct net_buf *buf, bool is_fatal_err)
|
|||
|
||||
switch (bt_buf_get_type(buf)) {
|
||||
case BT_BUF_ACL_IN:
|
||||
pkt_indicator = HCI_RPMSG_ACL;
|
||||
pkt_indicator = HCI_IPC_ACL;
|
||||
break;
|
||||
case BT_BUF_EVT:
|
||||
pkt_indicator = HCI_RPMSG_EVT;
|
||||
pkt_indicator = HCI_IPC_EVT;
|
||||
break;
|
||||
case BT_BUF_ISO_IN:
|
||||
pkt_indicator = HCI_RPMSG_ISO;
|
||||
pkt_indicator = HCI_IPC_ISO;
|
||||
break;
|
||||
default:
|
||||
LOG_ERR("Unknown type %u", bt_buf_get_type(buf));
|
||||
|
|
@ -295,8 +295,8 @@ void bt_ctlr_assert_handle(char *file, uint32_t line)
|
|||
|
||||
buf = hci_vs_err_assert(file, line);
|
||||
if (buf == NULL) {
|
||||
/* Send the event over rpmsg */
|
||||
hci_rpmsg_send(buf, HCI_FATAL_ERR_MSG);
|
||||
/* Send the event over ipc */
|
||||
hci_ipc_send(buf, HCI_FATAL_ERR_MSG);
|
||||
} else {
|
||||
LOG_ERR("Can't create Fatal Error HCI event: %s at %d", __FILE__, __LINE__);
|
||||
}
|
||||
|
|
@ -334,7 +334,7 @@ void k_sys_fatal_error_handler(unsigned int reason, const z_arch_esf_t *esf)
|
|||
|
||||
buf = hci_vs_err_stack_frame(reason, esf);
|
||||
if (buf != NULL) {
|
||||
hci_rpmsg_send(buf, HCI_FATAL_ERR_MSG);
|
||||
hci_ipc_send(buf, HCI_FATAL_ERR_MSG);
|
||||
} else {
|
||||
LOG_ERR("Can't create Fatal Error HCI event.\n");
|
||||
}
|
||||
|
|
@ -363,7 +363,7 @@ static void hci_ept_bound(void *priv)
|
|||
static void hci_ept_recv(const void *data, size_t len, void *priv)
|
||||
{
|
||||
LOG_INF("Received message of %u bytes.", len);
|
||||
hci_rpmsg_rx((uint8_t *) data, len);
|
||||
hci_ipc_rx((uint8_t *) data, len);
|
||||
}
|
||||
|
||||
static struct ipc_ept_cfg hci_ept_cfg = {
|
||||
|
|
@ -378,7 +378,7 @@ int main(void)
|
|||
{
|
||||
int err;
|
||||
const struct device *hci_ipc_instance =
|
||||
DEVICE_DT_GET(DT_CHOSEN(zephyr_bt_hci_rpmsg_ipc));
|
||||
DEVICE_DT_GET(DT_CHOSEN(zephyr_bt_hci_ipc));
|
||||
|
||||
/* incoming events and data from the controller */
|
||||
static K_FIFO_DEFINE(rx_queue);
|
||||
|
|
@ -394,7 +394,7 @@ int main(void)
|
|||
k_thread_create(&tx_thread_data, tx_thread_stack,
|
||||
K_THREAD_STACK_SIZEOF(tx_thread_stack), tx_thread,
|
||||
NULL, NULL, NULL, K_PRIO_COOP(7), 0, K_NO_WAIT);
|
||||
k_thread_name_set(&tx_thread_data, "HCI rpmsg TX");
|
||||
k_thread_name_set(&tx_thread_data, "HCI ipc TX");
|
||||
|
||||
/* Initialize IPC service instance and register endpoint. */
|
||||
err = ipc_service_open_instance(hci_ipc_instance);
|
||||
|
|
@ -413,7 +413,7 @@ int main(void)
|
|||
struct net_buf *buf;
|
||||
|
||||
buf = net_buf_get(&rx_queue, K_FOREVER);
|
||||
hci_rpmsg_send(buf, HCI_REGULAR_MSG);
|
||||
hci_ipc_send(buf, HCI_REGULAR_MSG);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
cmake_minimum_required(VERSION 3.20.0)
|
||||
|
||||
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
|
||||
project(hci_rpmsg)
|
||||
|
||||
target_sources(app PRIVATE src/main.c)
|
||||
|
|
@ -45,9 +45,9 @@ Refer to your :ref:`board's documentation <boards>` for alternative
|
|||
flash instructions if your board doesn't support the ``flash`` target.
|
||||
|
||||
To run the application on an :ref:`nrf5340dk_nrf5340`, a Bluetooth controller application
|
||||
must also run on the network core. The :ref:`bluetooth-hci-rpmsg-sample` sample
|
||||
must also run on the network core. The :ref:`bluetooth-hci-ipc-sample` sample
|
||||
application may be used. Build this sample with configuration
|
||||
:zephyr_file:`samples/bluetooth/hci_rpmg/nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf`
|
||||
:zephyr_file:`samples/bluetooth/hci_ipc/nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf`
|
||||
to enable mesh support.
|
||||
|
||||
Interacting with the sample
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ Refer to your :ref:`board's documentation <boards>` for alternative
|
|||
flash instructions if your board doesn't support the ``flash`` target.
|
||||
|
||||
To run the application on an :ref:`nrf5340dk_nrf5340`, a Bluetooth controller application
|
||||
must also run on the network core. The :ref:`bluetooth-hci-rpmsg-sample` sample
|
||||
must also run on the network core. The :ref:`bluetooth-hci-ipc-sample` sample
|
||||
application may be used. Build this sample with configuration
|
||||
:zephyr_file:`samples/bluetooth/hci_rpmg/nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf`
|
||||
:zephyr_file:`samples/bluetooth/hci_ipc/nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf`
|
||||
to enable mesh support.
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ Refer to your :ref:`board's documentation <boards>` for alternative
|
|||
flash instructions if your board doesn't support the ``flash`` target.
|
||||
|
||||
To run the application on an :ref:`nrf5340dk_nrf5340`, a Bluetooth controller application
|
||||
must also run on the network core. The :ref:`bluetooth-hci-rpmsg-sample` sample
|
||||
must also run on the network core. The :ref:`bluetooth-hci-ipc-sample` sample
|
||||
application may be used. Build this sample with configuration
|
||||
:zephyr_file:`samples/bluetooth/hci_rpmg/nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf`
|
||||
:zephyr_file:`samples/bluetooth/hci_ipc/nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf`
|
||||
to enable mesh support.
|
||||
|
|
|
|||
|
|
@ -25,6 +25,6 @@ bt_tmap_central,default,nrf5340dk_nrf5340_cpuapp,samples/bluetooth/tmap_central,
|
|||
bt_tmap_peripheral,default,nrf5340dk_nrf5340_cpuapp,samples/bluetooth/tmap_peripheral,
|
||||
bt_tmap_bms,default,nrf5340dk_nrf5340_cpuapp,samples/bluetooth/tmap_bms,
|
||||
bt_tmap_bmr,default,nrf5340dk_nrf5340_cpuapp,samples/bluetooth/tmap_bmr,
|
||||
bt_hci_rpmsg,default,nrf5340dk_nrf5340_cpunet,samples/bluetooth/hci_rpmsg,
|
||||
bt_hci_rpmsg,iso-broadcast,nrf5340dk_nrf5340_cpunet,samples/bluetooth/hci_rpmsg,-DCONF_FILE=nrf5340_cpunet_iso_broadcast-bt_ll_sw_split.conf
|
||||
bt_hci_rpmsg,iso-receive,nrf5340dk_nrf5340_cpunet,samples/bluetooth/hci_rpmsg,-DCONF_FILE=nrf5340_cpunet_iso_receive-bt_ll_sw_split.conf
|
||||
bt_hci_ipc,default,nrf5340dk_nrf5340_cpunet,samples/bluetooth/hci_ipc,
|
||||
bt_hci_ipc,iso-broadcast,nrf5340dk_nrf5340_cpunet,samples/bluetooth/hci_ipc,-DCONF_FILE=nrf5340_cpunet_iso_broadcast-bt_ll_sw_split.conf
|
||||
bt_hci_ipc,iso-receive,nrf5340dk_nrf5340_cpunet,samples/bluetooth/hci_ipc,-DCONF_FILE=nrf5340_cpunet_iso_receive-bt_ll_sw_split.conf
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ config BT_HCI_RESERVE
|
|||
int
|
||||
default 0 if BT_H4
|
||||
default 1 if BT_H5
|
||||
default 1 if BT_RPMSG
|
||||
default 1 if BT_HCI_IPC
|
||||
default 1 if BT_SPI
|
||||
default 1 if BT_STM32_IPM
|
||||
default 1 if BT_USERCHAN
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# Those have to be the same as in the controller (hci_rpmsg)
|
||||
# Those have to be the same as in the controller (hci_ipc)
|
||||
CONFIG_BT_MAX_CONN=2
|
||||
CONFIG_BT_BUF_EVT_RX_COUNT=16
|
||||
CONFIG_BT_BUF_EVT_RX_SIZE=255
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
# Apply this overlay at hci_rpmsg controller build
|
||||
# Apply this overlay at hci_ipc controller build
|
||||
CONFIG_BT_CTLR_CONN_ISO_LOW_LATENCY_POLICY=y
|
||||
CONFIG_BT_CTLR_DATA_LENGTH_MAX=100
|
||||
CONFIG_BT_BUF_ACL_RX_SIZE=100
|
||||
|
|
@ -10,7 +10,7 @@ CONFIG_BT_AUDIO_CODEC_CFG_MAX_METADATA_SIZE=16
|
|||
# Ring buffer for streaming ISO data
|
||||
CONFIG_RING_BUFFER=y
|
||||
|
||||
# These have to be the same as in the controller (hci_rpmsg)
|
||||
# These have to be the same as in the controller (hci_ipc)
|
||||
CONFIG_BT_MAX_CONN=2
|
||||
CONFIG_BT_BUF_EVT_RX_COUNT=16
|
||||
CONFIG_BT_BUF_EVT_RX_SIZE=255
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
if(NOT("${SB_CONFIG_NET_CORE_BOARD}" STREQUAL ""))
|
||||
set(NET_APP hci_rpmsg)
|
||||
set(NET_APP hci_ipc)
|
||||
set(NET_APP_SRC_DIR ${ZEPHYR_BASE}/samples/bluetooth/${NET_APP})
|
||||
|
||||
ExternalZephyrProject_Add(
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
if(NOT("${SB_CONFIG_NET_CORE_BOARD}" STREQUAL ""))
|
||||
set(NET_APP hci_rpmsg)
|
||||
set(NET_APP hci_ipc)
|
||||
set(NET_APP_SRC_DIR ${ZEPHYR_BASE}/samples/bluetooth/${NET_APP})
|
||||
|
||||
ExternalZephyrProject_Add(
|
||||
|
|
|
|||
Loading…
Reference in a new issue