Using nrf52_bsim with a Zephyr HCI app to enable Linux Bluez BLE stack to interact with devices connected to BubbleSim

Hello.

Zephyr OS is same as nRF Connect SDK if I understood it correct. I posted the following question on the Zephyr OS mailing list. Am unsure where I might get an answer, so requesting help here.

My intent in asking this question: I would like to use Babblesim to connect a Zephyr BLE peripheral to a Linux app that uses Linux Bluetooth stack Bluez.
With my current understanding I believe this might be possible as follows:

  1. Linux Bluez stack can access BLE controller via a UART HCI. It is a simple command line to do so. BLE client/centrl app can then be built on that Bluez stack.
  2. So, if a Zephyr board is accessible over a UART to the Linux, then Bluez should be able to use the Zephyr app functioning as a BLE controller.
  3. It seems 'samples/bluetooth/hci_uart/' could function as the BLE controller with HCI for 'nrf52_sim' virtual board.

Is the above possible? What do I need to do to enable UART in nrf52_sim?

Assuming this is possible, for the above to work, the 'nrf52_sim' needs to support UART. Per the Zephyr page for it as as well as its DTS it seems the UART is disabled. But the docs say the board is based on ' native_posix' which has UART enabled.

If the above is not possible, then is there any other way for Linux BLE Bluez app to access BLE peripherals on BubbleSim?

Regards.

Parents Reply Children
  • Hi Sigurd.

    Thanks for responding.If nrf52_sim could support UART peripheral, then I could use it to build the Zephyr app 'samples/bluetooth/hci_uart'. So when this emulation starts in a setup with BabbleSim, the Linux host where this emulation is run should be able to access this UART. I could hook this UART under Linux's Bluetooth stack Bluez. The nrf52_simm with the HCI UART can be readily connected to Bluez stackwith a simple Linux command line. With this a Linux BLE apps should be able to participate in BabbleSim where other nrf52_sim with BLE apps (e.g. heart beat, temperature, beacon/advertizers, etc) are running. With this I might be able to test in simulation various complex combination of BLE devices which are harder to do with real RF environments.
    If I see QEMU emulators (e..g. emulating ARM's MPS2_AN521), the UARTs can be exposed to the host running that QEMU instance. QEMU provides various options to expose this UART to the Linux host, e.g, over a PTS device. Does this help?Regards.

  • I posted this on Zephyr Discord (https://discord.com/channels/720317445772017664/1192523653506666567). It seems BabbleSim may not provide (at least readily).

    Please close this thread.

Related