This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/CC2564: btattach command in new bluez release

Part Number: CC2564

Tool/software: Linux

Hello

On my linux embedded platform, I'm trying to migrate bluez libraries from 4.x to 5.x, in order to get BLE support. Until now, after device power on I used hciattach command to attach serial device to BlueZ stack in the following way:

hciattach -s 115200 /dev/ttySP0 texas 3000000

But BlueZ has introduced the btattach command in release 5.37, as the successor to hciattach, and command syntax is quite different:

Usage:
        btattach [options]
options:
        -B, --bredr <device>   Attach Primary controller
        -A, --amp <device>     Attach AMP controller
        -P, --protocol <proto> Specify protocol type
        -S, --speed <baudrate> Specify which baudrate to use
        -N, --noflowctl        Disable flow control
        -h, --help             Show help options

I can set speed and dev controller, but type parameter has disappeared! Then hci_init fails, so I don't know if device is correctly attached... I also tryed to add "--protocol ll", but the situation is the same. Have you already experienced something like this?

Thank you

Mirco

  • Hello,

    What options were set for btattach , Can you issue the command as below:.

    btattach --bredr /dev/ttySP0 -P texas -S 115200

    Cheers,
    --Prabhakar Lad
  • I can't specify texas as protocol type, return message is "Invalid protocol". Supported values are:

    • h4
    • bcsp
    • 3wire
    • h4ds
    • ll
    • ath3k
    • intel
    • bcm
    • qca

    If I don't specify protocol, serial device seems attached, but during hci_init (expecially hci_init2_req) some initialization call fails, since function returns EBUSY as error.

    I thought it could be the different attach command in this version, the only difference migrating from 4.x to 5.x BlueZ... But maybe is something else?

  • Hello,

    what version of kernel are you using ? can you post the output of dmes | grep HCI, typically it should look as below:

    root@evm:~# dmesg | grep HCI
    [ 0.387283] Bluetooth: HCI device and connection manager initialized
    [ 0.387297] Bluetooth: HCI socket layer initialized
    [ 1.638919] Bluetooth: HCI UART driver ver 2.3
    [ 1.643387] Bluetooth: HCI UART protocol H4 registered
    [ 1.648548] Bluetooth: HCI UART protocol BCSP registered
    [ 1.653885] Bluetooth: HCI UART protocol LL registered
    [ 1.659047] Bluetooth: HCI UART protocol ATH3K registered
    [ 1.664640] Bluetooth: HCI UART protocol Three-wire (H5) registered
    [ 1.671056] Bluetooth: HCI UART protocol Intel registered
    [ 1.676598] Bluetooth: HCI UART protocol BCM registered
    [ 1.681848] Bluetooth: HCI UART protocol QCA registered


    If you the texas protocol in your output, this means kernel supports it.
    Also I did compare the bluez4 and bluez5 you need to port the support for texas protocol from bluez4 to bluez5.

    Cheers,
    --Prabhakar Lad
  • Hi,
    I'm using 3.10.102 kernel, and this is the dmesg output:

    Bluetooth: HCI device and connection manager initialized
    Bluetooth: HCI socket layer initialized
    Bluetooth: HCI UART driver ver 2.2
    Bluetooth: HCI H4 protocol initialized
    Bluetooth: HCI BCSP protocol initialized
    Bluetooth: HCILL protocol initialized

    Previous working version (with bluez-4) was 2.6.35, and the dmesg output is the same... Do you think I should extend texas protocol manually to bluez5?
  • Hello,

    What is your actual requirement, I have got ble working with bluez5.45, are you using ti-st driver ([1]) ?

    [1] e2e.ti.com/.../422900

    Cheers,
    --Prabhakar Lad
  • BLE working with bluez-5.45, it is just my requirement!
    I'll read the discussion you have reported, and I'll give it a try.
    Thank you
  • In my previous version I didn't use Shared Transport driver, while, concerning the other hints, I've both TIInit_7.6.15.bts and ti-connectivity in /lib/firmware, and the updated WiFi driver for Linux.
    Do you think is Shared Transport mandatory now, to use bluez-5.45 with 3.10.102 kernel?
  • Hello,

    Yes shared transport driver [1] does all the handling for you, so you dont have to worry about anything.

    [1] processors.wiki.ti.com/.../Shared_Transport_Driver

    Cheers,
    --Prabhakar Lad