Skip to content

Commit

Permalink
driver: bt: add BT_BUILD_ONLY_MODE to allow CI tests
Browse files Browse the repository at this point in the history
Adds an option to enable CI tests without binary blobs.
Same as existing "WIFI_BUILD_ONLY_MODE" option.

Signed-off-by: Sylvio Alves <[email protected]>
  • Loading branch information
sylvioalves committed Nov 3, 2024
1 parent e90c58a commit 311bfd1
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 12 deletions.
36 changes: 25 additions & 11 deletions drivers/bluetooth/hci/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,31 +1,45 @@
# SPDX-License-Identifier: Apache-2.0

zephyr_library_sources_ifdef(CONFIG_BT_ESP32 hci_esp32.c)
if (CONFIG_BT_BUILD_ONLY_MODE)
message(WARNING "
---------------------------------------------------------------------------
Building only the Bluetooth driver without binary blobs and patches.
This is only for building (CI) purposes and will not work on a real device.
---------------------------------------------------------------------------
")
else()

if(CONFIG_DT_HAS_ESPRESSIF_ESP32_BT_HCI_ENABLED)
zephyr_blobs_verify(MODULE hal_espressif REQUIRED)
endif()

if(CONFIG_DT_HAS_ST_HCI_STM32WBA_ENABLED)
zephyr_blobs_verify(MODULE hal_stm32 REQUIRED)
endif()

if(CONFIG_DT_HAS_SILABS_BT_HCI_EFR32_ENABLED)
zephyr_blobs_verify(MODULE hal_silabs REQUIRED)
endif()

if(CONFIG_DT_HAS_INFINEON_CAT1_BLESS_HCI_ENABLED)
zephyr_blobs_verify(MODULE hal_infineon REQUIRED)
endif()

endif() # CONFIG_BT_BUILD_ONLY_MODE

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_HCI_IPC ipc.c)
zephyr_library_sources_ifdef(CONFIG_BT_SPI_ZEPHYR spi.c)
zephyr_library_sources_ifdef(CONFIG_BT_SPI_BLUENRG hci_spi_st.c)
zephyr_library_sources_ifdef(CONFIG_BT_CYW43XX h4_ifx_cyw43xxx.c)
zephyr_library_sources_ifdef(CONFIG_BT_CYW208XX hci_ifx_cyw208xx.c)

zephyr_library_sources_ifdef(CONFIG_BT_STM32_IPM ipm_stm32wb.c)
zephyr_library_sources_ifdef(CONFIG_BT_STM32WBA hci_stm32wba.c)
if(CONFIG_DT_HAS_ST_HCI_STM32WBA_ENABLED)
zephyr_blobs_verify(MODULE hal_stm32 REQUIRED)
endif()
zephyr_library_sources_ifdef(CONFIG_BT_USERCHAN userchan.c)
zephyr_library_sources_ifdef(CONFIG_BT_SILABS_EFR32 hci_silabs_efr32.c)
if(CONFIG_DT_HAS_SILABS_BT_HCI_EFR32_ENABLED)
zephyr_blobs_verify(MODULE hal_silabs REQUIRED)
endif()
zephyr_library_sources_ifdef(CONFIG_BT_PSOC6_BLESS hci_ifx_psoc6_bless.c)
if(CONFIG_DT_HAS_INFINEON_CAT1_BLESS_HCI_ENABLED)
zephyr_blobs_verify(MODULE hal_infineon REQUIRED)
endif()
zephyr_library_sources_ifdef(CONFIG_SOC_NRF5340_CPUAPP nrf53_support.c)
zephyr_library_sources_ifdef(CONFIG_BT_AMBIQ_HCI hci_ambiq.c apollox_blue.c)
zephyr_library_sources_ifdef(CONFIG_BT_DA1469X hci_da1469x.c)
Expand Down
9 changes: 8 additions & 1 deletion drivers/bluetooth/hci/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ config BT_SPI_ZEPHYR
Bluetooth HCI over SPI driver for communication with Bluetooth
controllers running Zephyr.

config BT_BUILD_ONLY_MODE
bool "Build only mode (do not link bluetooth firmware blob)"
help
Skip linking the firmware blob into the Bluetooth build. This will
not result in a functional application, but allows the Bluetooth
driver to be built without binary blobs.

config BT_SPI_BLUENRG
bool
default y
Expand Down Expand Up @@ -133,7 +140,7 @@ config BT_ESP32
bool
default y
depends on DT_HAS_ESPRESSIF_ESP32_BT_HCI_ENABLED
depends on ZEPHYR_HAL_ESPRESSIF_MODULE_BLOBS
depends on ZEPHYR_HAL_ESPRESSIF_MODULE_BLOBS || BT_BUILD_ONLY_MODE
help
Espressif HCI bluetooth interface

Expand Down

0 comments on commit 311bfd1

Please sign in to comment.