This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to export nRF52832 controller via UART to Linux CPU with btattach command?

Hi,

I have a ARM based Linux host CPU connect to MDBT42Q-U(nRF52832).

But I cannot control it by BlueZ:

```

root@OpenWrt:/# btattach -B /dev/ttyMSM1 -P h4 &
root@OpenWrt:/# Attaching BR/EDR controller to /dev/ttyMSM1[ 6977.445252] Bluetooth: hci0: Frame reassembly failed (-84)

Switched line discipline from 0 to 15
Device index 0 attached

root@OpenWrt:/# hciconfig hci0 up
Can't init device hci0: Operation timed out (110)

```

I think I should build the example of UART and flash it by nrfjprog.exe

Here are my questions:

1. Do both nRF5_SDK and nRF connect SDK include the UART sample which can export the controller by UART?

2. If the answer is yes with nRF5_SDK, which example should I flash to the module?

  • Hi,

    Firstly, I'm not sure but I think BlueZ has been deprecated, and the correct ble stack to use on Linux is bluetoothctl. 

    NCS is the correct one to use, the HCI-UART sample should work straight-out-of-the-box with bluetoothctl.

    regards

    Jared 

  • Hi Jared,

    Thank you for your reply.

    But I think bluetoothctl is a part of BlueZ, and I need to use btattach to create a HCI interface before control it.

    I should use NCS to build the zephyrproject/zephyr/samples/bluetooth/hci_uart, is it right?

    Any I am confuse about why nRF5 SDK doesn't include this sample code?

    How the developers choose the right SDK for their device. 

  • Chuka said:

    I should use NCS to build the zephyrproject/zephyr/samples/bluetooth/hci_uart, is it right?

     Yes

    Chuka said:
    Any I am confuse about why nRF5 SDK doesn't include this sample code?

    Because the nRF5 SDK doesn't support the HCI interface. nRF5 SDK however have something we call for serialization which is almost the same. Serialization is used by the PC library pc-ble-driver

    Chuka said:
    How the developers choose the right SDK for their device. 

    First you need to check what support you need and which of the SDK that supports your needs. If both supports your requirements and you don't  need to use an RTOS then nRF5 SDK is probably the way to go.

    regards

    Jared 

Related