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

nRF52840-DK as HCI-UART based on zephyr issue

There are two boards, Raspberry PI4 and nRF52840-DK. The task is for the nRF52840-DK on zephyr hci-uart firmware:

https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/samples/bluetooth/hci_uart/README.html

to operate in HCI-UART (HCI only driver) mode, and Raspberry PI4 to operate in host mode. On the host side, the version 5.50 BlueZ is installed. The boards are connected via UART interface, at 921600Kb/s speed. After connecting and initializing nRF52840 using the hciattach command, the device initializes and connects and even scans (hcitool lescan) and sees other LE devices, but when trying to connect to them or get information about them (leinfo), an error occurs for the first time:

Could not create connection: Connection timed out

An error occurs during further attempts:

Could not create connection: Input/output error

There is a similar problem with setting the device name. An error occurred while trying to read or set the name (hciconfig hci* name):

Can't read local name on hci1: Input/output error (5)

At the same time, the oscillograph shows that the exchange between the devices is in both directions… There were also attempts to change speed and flow control - but, they did not give results.

As a result, we have: you can scan and watch visible devices, but you can't get anything, connect or change anything. Only scan and device list - that's all.

Boards Connection:

RPI4 (PIN27) <-> NRFDK (P0.08); RPI4(PIN28) <-> NRFDK (P0.06); RPI4 (GND) <-> NRFDK (GND)

 

Raspberry PI4 board configuration and params:

OS: Raspbian (32bit), V: 1.4

BlueZ: 5.50

UART: UART2

TXD -> GPIO0 -> PIN27

RXD -> GPIO1 -> PIN28

UART Speed: 1000000 / 921600 / 115200 Kb/s (variants of test)

Flow Control: None

RX/TX TTL Voltage: 3.3V

 

nRF52840-DK board configuration and params:

FW: HCI-UART (Zephyr Bluetooth: HCI UART sample)

nRF Connect SDK: 1.5.0

Project name: hci-uart

Build: zephyr.elf

UART: UART0

UART Speed: 1000000 / 921600 / 115200 Kb/s (variants of test)

Flow Control: None

 

Bluez device attach command string (for variant of 921600Kb/s):

sudo hciattach -t 5 -s 921600 /dev/ttyAMA1 any 921600 noflow nosleep

  • Hi,

     

    You shall use flow control with H4, as described in the description of the sample:

    https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/samples/bluetooth/hci_uart/README.html#overview

     

    The baudrate of 921k6 is quite inaccurate, and you should rather use 1M baud. Here's the actual baudrate, as per the comment from nrf52_bitfields.h:

    #define UART_BAUDRATE_BAUDRATE_Baud921600 (0x0EBED000UL) /*!< 921600 baud (actual rate: 941176) */

     

    sudo hciattach -t 5 -s 921600 /dev/ttyAMA1 any 921600 noflow nosleep

     hciattach is a deprecated tool, you should use btattach instead (with hwfc).

     

    Kind regards,

    Håkon

  • I tested 1M / 926100 / 115200 combine hwfc and no hwfc, -- the result is the same...
    And yea, btattach - it just hangs until you interrupt it with a combination of Ctr+C.

    BT MON Log on cmd:

    << sudo btattach -B /dev/ttyAMA1 -S 921600 -P h4

    >> Attaching Primary controller to /dev/ttyAMA1
    >> Switched line discipline from 0 to 15
    >> Device index 1 attached

    >> infinite wait .....

    BTMON data:

    Bluetooth monitor ver 5.56
    = Note: Linux version 5.4.83-v7l+ (armv7l)                                                              0.818455
    = Note: Bluetooth subsystem version 2.22                                                                0.818465
    = New Index: DC:A6:32:E7:A0:D6 (Primary,UART,hci0)                                               [hci0] 0.818471
    = Open Index: DC:A6:32:E7:A0:D6                                                                  [hci0] 0.818475
    = Index Info: DC:A6:32:E7:A0:D6 (Cypress Semiconductor)                                          [hci0] 0.818479
    @ MGMT Open: bluetoothd (privileged) version 1.14                                              {0x0001} 0.818485
    = New Index: 00:00:00:00:00:00 (Primary,UART,hci1)                                               [hci1] 3.443330
    = Open Index: 00:00:00:00:00:00                                                                  [hci1] 3.443379
    < HCI Command: Reset (0x03|0x0003) plen 0                                                     #1 [hci1] 3.443439
    > HCI Event: Command Complete (0x0e) plen 4                                                   #2 [hci1] 3.444256
          Reset (0x03|0x0003) ncmd 1
            Status: Success (0x00)
    < HCI Command: Read Local Supported Features (0x04|0x0003) plen 0                             #3 [hci1] 3.444341
    > HCI Event: Command Complete (0x0e) plen 12                                                  #4 [hci1] 3.446700
          Read Local Supported Features (0x04|0x0003) ncmd 1
            Status: Success (0x00)
            Features: 0x00 0x00 0x00 0x00 0x60 0x00 0x00 0x00
              BR/EDR Not Supported
              LE Supported (Controller)
    < HCI Command: Read Local Version Information (0x04|0x0001) plen 0                            #5 [hci1] 3.446793
    > HCI Event: Command Complete (0x0e) plen 12                                                  #6 [hci1] 3.447961
          Read Local Version Information (0x04|0x0001) ncmd 1
            Status: Success (0x00)
            HCI version: Reserved (0x0b) - Revision 4496 (0x1190)
            LMP version: Reserved (0x0b) - Subversion 4496 (0x1190)
            Manufacturer: Nordic Semiconductor ASA (89)
    < HCI Command: Read BD ADDR (0x04|0x0009) plen 0                                              #7 [hci1] 3.448056
    > HCI Event: Command Complete (0x0e) plen 10                                                  #8 [hci1] 3.448871
          Read BD ADDR (0x04|0x0009) ncmd 1
            Status: Success (0x00)
            Address: EE:78:7C:67:E6:17 (OUI EE-78-7C)
    < HCI Command: LE Read Buffer Size (0x08|0x0002) plen 0                                       #9 [hci1] 3.449039
    > HCI Event: Command Complete (0x0e) plen 7                                                  #10 [hci1] 3.449824
          LE Read Buffer Size (0x08|0x0002) ncmd 1
            Status: Success (0x00)
            Data packet length: 27
            Num data packets: 3
    < HCI Command: LE Read Local Supported Features (0x08|0x0003) plen 0                         #11 [hci1] 3.449911
    > HCI Event: Command Complete (0x0e) plen 12                                                 #12 [hci1] 3.450780
          LE Read Local Supported Features (0x08|0x0003) ncmd 1
            Status: Success (0x00)
            Features: 0xf5 0x49 0x00 0x00 0x00 0xee 0x90 0x11
              LE Encryption
              Extended Reject Indication
              LE Ping
              LE Data Packet Length Extension
              LL Privacy
              Extended Scanner Filter Policies
              LE 2M PHY
              LE Coded PHY
              Channel Selection Algorithm #2
              Unknown features (0x1190ee0000000000)
    < HCI Command: LE Read Supported States (0x08|0x001c) plen 0                                 #13 [hci1] 3.450857
    > HCI Event: Command Complete (0x0e) plen 12                                                 #14 [hci1] 3.451771
          LE Read Supported States (0x08|0x001c) ncmd 1
            Status: Success (0x00)
            States: 0x1190eeff000049ff
              Non-connectable Advertising State
              Scannable Advertising State
              Connectable Advertising State
              High Duty Cycle Directed Advertising State
              Passive Scanning State
              Active Scanning State
              Initiating State
                and Connection State (Master Role)
              Connection State (Slave Role)
              Non-connectable Advertising State
                and Passive Scanning State
              High Duty Cycle Directed Advertising State
                and Passive Scanning State
              Connectable Advertising State
                and Active Scanning State
              Connectable Advertising State
                and Initiating State
                and Master Role & Slave Role
              High Duty Cycle Directed Advertising State
                and Initiating State
                and Master Role & Slave Role
              Low Duty Cycle Directed Advertising State
                and Initiating State
                and Master Role & Slave Role
              Connectable Advertising State
                and Connection State (Master Role)
                and Master Role & Slave Role
              High Duty Cycle Directed Advertising State
                and Connection State (Master Role)
                and Master Role & Slave Role
              Low Duty Cycle Directed Advertising State
                and Connection State (Master Role)
                and Master Role & Slave Role
              Connectable Advertising State
                and Connection State (Slave Role)
                and Master Role & Slave Role
              High Duty Cycle Directed Advertising State
                and Connection State (Slave Role)
                and Slave Role & Slave Role
              Initiating State
                and Connection State (Slave Role)
                and Master Role & Slave Role
              Unknown states (0x1190ec0000000000)
    < HCI Command: Read Local Supported Commands (0x04|0x0002) plen 0                            #15 [hci1] 3.451856
    > HCI Event: Command Complete (0x0e) plen 68                                                 #16 [hci1] 3.461912
          Read Local Supported Commands (0x04|0x0002) ncmd 1
            Status: Success (0x00)
            Commands: 62 entries
              Disconnect (Octet 0 - Bit 5)
              Read Remote Version Information (Octet 2 - Bit 7)
              Set Event Mask (Octet 5 - Bit 6)
              Reset (Octet 5 - Bit 7)
              Read Transmit Power Level (Octet 10 - Bit 2)
              Set Controller To Host Flow Control (Octet 10 - Bit 5)
              Host Buffer Size (Octet 10 - Bit 6)
              Host Number of Completed Packets (Octet 10 - Bit 7)
              Read Local Version Information (Octet 14 - Bit 3)
              Read Local Supported Features (Octet 14 - Bit 5)
              Read BD ADDR (Octet 15 - Bit 1)
              Read RSSI (Octet 15 - Bit 5)
              Set Event Mask Page 2 (Octet 22 - Bit 2)
              LE Set Event Mask (Octet 25 - Bit 0)
              LE Read Buffer Size (Octet 25 - Bit 1)
              LE Read Local Supported Features (Octet 25 - Bit 2)
              LE Set Random Address (Octet 25 - Bit 4)
              LE Set Advertising Parameters (Octet 25 - Bit 5)
              LE Read Advertising Channel TX Power (Octet 25 - Bit 6)
              LE Set Advertising Data (Octet 25 - Bit 7)
              LE Set Scan Response Data (Octet 26 - Bit 0)
              LE Set Advertise Enable (Octet 26 - Bit 1)
              LE Set Scan Parameters (Octet 26 - Bit 2)
              LE Set Scan Enable (Octet 26 - Bit 3)
              LE Create Connection (Octet 26 - Bit 4)
              LE Create Connection Cancel (Octet 26 - Bit 5)
              LE Read White List Size (Octet 26 - Bit 6)
              LE Clear White List (Octet 26 - Bit 7)
              LE Add Device To White List (Octet 27 - Bit 0)
              LE Remove Device From White List (Octet 27 - Bit 1)
              LE Connection Update (Octet 27 - Bit 2)
              LE Set Host Channel Classification (Octet 27 - Bit 3)
              LE Read Channel Map (Octet 27 - Bit 4)
              LE Read Remote Used Features (Octet 27 - Bit 5)
              LE Encrypt (Octet 27 - Bit 6)
              LE Rand (Octet 27 - Bit 7)
              LE Start Encryption (Octet 28 - Bit 0)
              LE Long Term Key Request Reply (Octet 28 - Bit 1)
              LE Long Term Key Request Neg Reply (Octet 28 - Bit 2)
              LE Read Supported States (Octet 28 - Bit 3)
              LE Receiver Test (Octet 28 - Bit 4)
              LE Transmitter Test (Octet 28 - Bit 5)
              LE Test End (Octet 28 - Bit 6)
              Read Authenticated Payload Timeout (Octet 32 - Bit 4)
              Write Authenticated Payload Timeout (Octet 32 - Bit 5)
              LE Set Data Length (Octet 33 - Bit 6)
              LE Read Suggested Default Data Length (Octet 33 - Bit 7)
              LE Write Suggested Default Data Length (Octet 34 - Bit 0)
              LE Add Device To Resolving List (Octet 34 - Bit 3)
              LE Remove Device From Resolving List (Octet 34 - Bit 4)
              LE Clear Resolving List (Octet 34 - Bit 5)
              LE Read Resolving List Size (Octet 34 - Bit 6)
              LE Set Address Resolution Enable (Octet 35 - Bit 1)
              LE Set Resolvable Private Address Timeout (Octet 35 - Bit 2)
              LE Read Maximum Data Length (Octet 35 - Bit 3)
              LE Read PHY (Octet 35 - Bit 4)
              LE Set Default PHY (Octet 35 - Bit 5)
              LE Set PHY (Octet 35 - Bit 6)
              LE Enhanced Receiver Test (Octet 35 - Bit 7)
              LE Enhanced Transmitter Test (Octet 36 - Bit 0)
              LE Read Transmit Power (Octet 38 - Bit 7)
              LE Set Privacy Mode (Octet 39 - Bit 2)
    < HCI Command: Set Event Mask (0x03|0x0001) plen 8                                           #17 [hci1] 3.462082
            Mask: 0x200080000204e890
              Disconnection Complete
              Encryption Change
              Read Remote Version Information Complete
              Command Complete
              Command Status
              Hardware Error
              Number of Completed Packets
              Data Buffer Overflow
              Encryption Key Refresh Complete
              LE Meta
    > HCI Event: Command Complete (0x0e) plen 4                                                  #18 [hci1] 3.462841
          Set Event Mask (0x03|0x0001) ncmd 1
            Status: Success (0x00)
    < HCI Command: LE Set Event Mask (0x08|0x0001) plen 8                                        #19 [hci1] 3.462928
            Mask: 0x0000000000080c5f
              LE Connection Complete
              LE Advertising Report
              LE Connection Update Complete
              LE Read Remote Used Features Complete
              LE Long Term Key Request
              LE Data Length Change
              LE Direct Advertising Report
              LE PHY Update Complete
              LE Channel Selection Algorithm
    > HCI Event: Command Complete (0x0e) plen 4                                                  #20 [hci1] 3.463661
          LE Set Event Mask (0x08|0x0001) ncmd 1
            Status: Success (0x00)
    < HCI Command: LE Read Advertising Channel TX Power (0x08|0x0007) plen 0                     #21 [hci1] 3.463716
    > HCI Event: Command Complete (0x0e) plen 5                                                  #22 [hci1] 3.464397
          LE Read Advertising Channel TX Power (0x08|0x0007) ncmd 1
            Status: Success (0x00)
            TX power: 0 dbm (0x00)
    < HCI Command: LE Read White List Size (0x08|0x000f) plen 0                                  #23 [hci1] 3.464446
    > HCI Event: Command Complete (0x0e) plen 5                                                  #24 [hci1] 3.466813
          LE Read White List Size (0x08|0x000f) ncmd 1
            Status: Success (0x00)
            Size: 8
    < HCI Command: LE Clear White List (0x08|0x0010) plen 0                                      #25 [hci1] 3.466870
    > HCI Event: Command Complete (0x0e) plen 4                                                  #26 [hci1] 3.471667
          LE Clear White List (0x08|0x0010) ncmd 1
            Status: Success (0x00)
    < HCI Command: LE Read Resolving List Size (0x08|0x002a) plen 0                              #27 [hci1] 3.471730
    > HCI Event: Command Complete (0x0e) plen 5                                                  #28 [hci1] 3.473260
          LE Read Resolving List Size (0x08|0x002a) ncmd 1
            Status: Success (0x00)
            Size: 8
    < HCI Command: LE Clear Resolving List (0x08|0x0029) plen 0                                  #29 [hci1] 3.473320
    > HCI Event: Command Complete (0x0e) plen 4                                                  #30 [hci1] 3.473982
          LE Clear Resolving List (0x08|0x0029) ncmd 1
            Status: Success (0x00)
    < HCI Command: LE Read Maximum Data Length (0x08|0x002f) plen 0                              #31 [hci1] 3.474034
    > HCI Event: Command Complete (0x0e) plen 12                                                 #32 [hci1] 3.474866
          LE Read Maximum Data Length (0x08|0x002f) ncmd 1
            Status: Success (0x00)
            Max TX octets: 251
            Max TX time: 2704
            Max RX octets: 251
            Max RX time: 2704
    < HCI Command: LE Read Suggested Default Data Length (0x08|0x0023) plen 0                    #33 [hci1] 3.474919
    > HCI Event: Command Complete (0x0e) plen 8                                                  #34 [hci1] 3.475684
          LE Read Suggested Default Data Length (0x08|0x0023) ncmd 1
            Status: Success (0x00)
            TX octets: 27
            TX time: 328
    < HCI Command: Set Event Mask Page 2 (0x03|0x0063) plen 8                                    #35 [hci1] 3.475784
            Mask: 0x0000000000800000
              Authenticated Payload Timeout Expired
    > HCI Event: Command Complete (0x0e) plen 4                                                  #36 [hci1] 3.476464
          Set Event Mask Page 2 (0x03|0x0063) ncmd 1
            Status: Success (0x00)
    < HCI Command: LE Write Suggested Default Data Length (0x08|0x0024) plen 4                   #37 [hci1] 3.476517
            TX octets: 251
            TX time: 2704
    > HCI Event: Command Complete (0x0e) plen 4                                                  #38 [hci1] 3.477203
          LE Write Suggested Default Data Length (0x08|0x0024) ncmd 1
            Status: Success (0x00)
    < HCI Command: LE Set Default PHY (0x08|0x0031) plen 3                                       #39 [hci1] 3.477257
            All PHYs preference: 0x00
            TX PHYs preference: 0x01
              LE 1M
            RX PHYs preference: 0x01
              LE 1M
    > HCI Event: Command Complete (0x0e) plen 4                                                  #40 [hci1] 3.477878
          LE Set Default PHY (0x08|0x0031) ncmd 1
            Status: Success (0x00)
    = Index Info: EE:78:7C:67:E6:17 (Nordic Semiconductor ASA)                                       [hci1] 3.478197
    @ MGMT Event: Index Added (0x0004) plen 0                                               {0x0001} [hci1] 3.478214
    @ MGMT Command: Remove Advertisement Monitor (0x0053) plen 2                            {0x0001} [hci1] 3.478398
            Handle: 0
    @ MGMT Event: Command Status (0x0002) plen 3                                            {0x0001} [hci1] 3.478411
          Remove Advertisement Monitor (0x0053)
            Status: Unknown Command (0x01)
    = bluetoothd: src/adapter.c:reset_adv_monitors_complete() Failed to reset Adv Monitors: Unknown Com..   3.478561
    @ MGMT Command: Read Controller Information (0x0004) plen 0                             {0x0001} [hci1] 3.478617
    @ MGMT Event: Command Complete (0x0001) plen 283                                        {0x0001} [hci1] 3.478631
          Read Controller Information (0x0004) plen 280
            Status: Success (0x00)
            Address: EE:78:7C:67:E6:17 (OUI EE-78-7C)
            Version: Reserved (0x0b)
            Manufacturer: Nordic Semiconductor ASA (89)
            Supported settings: 0x0001be1b
              Powered
              Connectable
              Discoverable
              Bondable
              Low Energy
              Advertising
              Secure Connections
              Debug Keys
              Privacy
              Static Address
              PHY Configuration
            Current settings: 0x00000200
              Low Energy
            Class: 0x000000
              Major class: Miscellaneous
              Minor class: 0x00
            Name:
            Short name:
    @ MGMT Command: Remove UUID (0x0011) plen 16                                            {0x0001} [hci1] 3.479702
            UUID: 00000000-0000-0000-0000-000000000000
    @ MGMT Event: Command Complete (0x0001) plen 6                                          {0x0001} [hci1] 3.479727
          Remove UUID (0x0011) plen 3
            Status: Success (0x00)
            Class: 0x000000
              Major class: Miscellaneous
              Minor class: 0x00
    @ MGMT Command: Remove Device (0x0034) plen 7                                           {0x0001} [hci1] 3.479817
            BR/EDR Address: 00:00:00:00:00:00 (OUI 00-00-00)
    @ MGMT Event: Command Complete (0x0001) plen 10                                         {0x0001} [hci1] 3.479834
          Remove Device (0x0034) plen 7
            Status: Success (0x00)
            BR/EDR Address: 00:00:00:00:00:00 (OUI 00-00-00)
    @ MGMT Command: Set Secure Connections (0x002d) plen 1                                  {0x0001} [hci1] 3.479913
            Secure Connections: Enabled (0x01)
    @ MGMT Event: Command Complete (0x0001) plen 7                                          {0x0001} [hci1] 3.479922
          Set Secure Connections (0x002d) plen 4
            Status: Success (0x00)
            Current settings: 0x00000a00
              Low Energy
              Secure Connections
    @ MGMT Command: Set Privacy (0x002f) plen 17                                            {0x0001} [hci1] 3.480004
            Privacy: Disabled (0x00)
            Key: 00000000000000000000000000000000
    @ MGMT Event: Command Complete (0x0001) plen 7                                          {0x0001} [hci1] 3.480014
          Set Privacy (0x002f) plen 4
            Status: Success (0x00)
            Current settings: 0x00000a00
              Low Energy
              Secure Connections
    @ MGMT Command: Add UUID (0x0010) plen 17                                               {0x0001} [hci1] 3.480092
            UUID: 00001800-0000-1000-8000-00805f9b34fb
            Service class: 0x00
    @ MGMT Event: Command Complete (0x0001) plen 6                                          {0x0001} [hci1] 3.480100
          Add UUID (0x0010) plen 3
            Status: Success (0x00)
            Class: 0x000000
              Major class: Miscellaneous
              Minor class: 0x00
    @ MGMT Command: Add UUID (0x0010) plen 17                                               {0x0001} [hci1] 3.480186
            UUID: 00001801-0000-1000-8000-00805f9b34fb
            Service class: 0x00
    @ MGMT Event: Command Complete (0x0001) plen 6                                          {0x0001} [hci1] 3.480198
          Add UUID (0x0010) plen 3
            Status: Success (0x00)
            Class: 0x000000
              Major class: Miscellaneous
              Minor class: 0x00
    @ MGMT Command: Add UUID (0x0010) plen 17                                               {0x0001} [hci1] 3.480282
            UUID: 0000180a-0000-1000-8000-00805f9b34fb
            Service class: 0x00
    @ MGMT Event: Command Complete (0x0001) plen 6                                          {0x0001} [hci1] 3.480292
          Add UUID (0x0010) plen 3
            Status: Success (0x00)
            Class: 0x000000
              Major class: Miscellaneous
              Minor class: 0x00
    @ MGMT Command: Read Advertising Features (0x003d) plen 0                               {0x0001} [hci1] 3.480373
    @ MGMT Event: Command Complete (0x0001) plen 11                                         {0x0001} [hci1] 3.480382
          Read Advertising Features (0x003d) plen 8
            Status: Success (0x00)
            Flags: 0x0000007f
              Switch into Connectable mode
              Advertise as Discoverable
              Advertise as Limited Discoverable
              Add Flags field to Advertising Data
              Add TX Power field to Advertising Data
              Add Appearance field to Scan Response
              Add Local Name in Scan Response
            Advertising data length: 31
            Scan response length: 31
            Max instances: 5
            Instances: 0
    @ MGMT Command: Set Powered (0x0005) plen 1                                             {0x0001} [hci1] 3.480459
            Powered: Enabled (0x01)
    < HCI Command: LE Set Advertising Data (0x08|0x0008) plen 32                                 #41 [hci1] 3.480569
            Length: 6
            Flags: 0x04
              BR/EDR Not Supported
            TX power: 0 dBm
    > HCI Event: Command Complete (0x0e) plen 4                                                  #42 [hci1] 3.481550
          LE Set Advertising Data (0x08|0x0008) ncmd 1
            Status: Success (0x00)
    @ MGMT Event: Command Complete (0x0001) plen 7                                          {0x0001} [hci1] 3.481648
          Set Powered (0x0005) plen 4
            Status: Success (0x00)
            Current settings: 0x00000a01
              Powered
              Low Energy
              Secure Connections
    @ MGMT Command: Set Local Name (0x000f) plen 260                                        {0x0001} [hci1] 3.482581
            Name: raspberrypi #2
            Short name:
    = bluetoothd: Failed to set local name: Failed (0x03)                                            [hci1] 3.483316
    @ MGMT Command: Add UUID (0x0010) plen 17                                               {0x0001} [hci1] 3.482710
            UUID: 0000110e-0000-1000-8000-00805f9b34fb
            Service class: 0x00
    @ MGMT Event: Command Complete (0x0001) plen 6                                          {0x0001} [hci1] 3.482720
          Add UUID (0x0010) plen 3
            Status: Success (0x00)
            Class: 0x000000
              Major class: Miscellaneous
              Minor class: 0x00
    @ MGMT Command: Add UUID (0x0010) plen 17                                               {0x0001} [hci1] 3.482819
            UUID: 0000110c-0000-1000-8000-00805f9b34fb
            Service class: 0x00
    @ MGMT Event: Command Complete (0x0001) plen 6                                          {0x0001} [hci1] 3.482828
          Add UUID (0x0010) plen 3
            Status: Success (0x00)
            Class: 0x000000
              Major class: Miscellaneous
              Minor class: 0x00
    @ MGMT Command: Unblock Device (0x0027) plen 7                                          {0x0001} [hci1] 3.482909
            BR/EDR Address: 00:00:00:00:00:00 (OUI 00-00-00)
    @ MGMT Event: Command Complete (0x0001) plen 10                                         {0x0001} [hci1] 3.482922
          Unblock Device (0x0027) plen 7
            Status: Success (0x00)
            BR/EDR Address: 00:00:00:00:00:00 (OUI 00-00-00)
    @ MGMT Command: Load Long Term Keys (0x0013) plen 2                                     {0x0001} [hci1] 3.482999
            Keys: 0
    @ MGMT Event: Command Complete (0x0001) plen 3                                          {0x0001} [hci1] 3.483008
          Load Long Term Keys (0x0013) plen 0
            Status: Success (0x00)
    @ MGMT Command: Load Identity Resolving Keys (0x0030) plen 2                            {0x0001} [hci1] 3.483084
            Keys: 0
    @ MGMT Event: Command Complete (0x0001) plen 3                                          {0x0001} [hci1] 3.483096
          Load Identity Resolving Keys (0x0030) plen 0
            Status: Success (0x00)
    @ MGMT Command: Load Connection Parameters (0x0035) plen 2                              {0x0001} [hci1] 3.483171
            Parameters: 0
    @ MGMT Event: Command Complete (0x0001) plen 3                                          {0x0001} [hci1] 3.483183
          Load Connection Parameters (0x0035) plen 0
            Status: Success (0x00)
    @ MGMT Command: Add UUID (0x0010) plen 17                                               {0x0001} [hci1] 3.483258
            UUID: 00001200-0000-1000-8000-00805f9b34fb
            Service class: 0x00
    @ MGMT Event: Command Complete (0x0001) plen 6                                          {0x0001} [hci1] 3.483267
          Add UUID (0x0010) plen 3
            Status: Success (0x00)
            Class: 0x000000
              Major class: Miscellaneous
              Minor class: 0x00
    @ MGMT Command: Set Device ID (0x0028) plen 8                                           {0x0001} [hci1] 3.483353
            Device ID: USB Implementer's Forum assigned (0x0002)
              Vendor: Linux Foundation (0x1d6b)
              Product: 0x0246
              Version: 5.3.8 (0x0538)
    @ MGMT Event: Command Complete (0x0001) plen 3                                          {0x0001} [hci1] 3.483362
          Set Device ID (0x0028) plen 0
            Status: Success (0x00)
    @ MGMT Command: Set Local Name (0x000f) plen 260                                        {0x0001} [hci1] 3.483439
            Name: raspberrypi #2
            Short name:
    @ MGMT Event: Command Complete (0x0001) plen 263                                        {0x0001} [hci1] 3.483448
          Set Local Name (0x000f) plen 260
            Status: Success (0x00)
            Name: raspberrypi #2
            Short name:
    @ RAW Open: hciconfig (privileged) version 2.22                                                {0x0002} 3.517545
    @ RAW Close: hciconfig                                                                         {0x0002} 3.517603
    @ RAW Open: hciconfig (privileged) version 2.22                                                {0x0002} 3.521807
    @ RAW Close: hciconfig                                                                         {0x0002} 3.522377
    @ RAW Open: hcitool (privileged) version 2.22                                                  {0x0002} 3.528643
    @ RAW Close: hcitool                                                                           {0x0002} 3.528690
    @ RAW Open: hcitool (privileged) version 2.22                                                  {0x0002} 3.528740
    @ RAW Close: hcitool                                                                           {0x0002} 3.528759
    @ RAW Open: hcitool (privileged) version 2.22                                                  {0x0002} 3.528979
    @ RAW Close: hcitool                                                                           {0x0002} 3.529055
    @ MGMT Command: Set Powered (0x0005) plen 1                                             {0x0001} [hci1] 3.552686
            Powered: Disabled (0x00)
    @ MGMT Event: Command Complete (0x0001) plen 7                                          {0x0001} [hci1] 3.552761
          Set Powered (0x0005) plen 4
            Status: Success (0x00)
            Current settings: 0x00000a00
              Low Energy
              Secure Connections
    = Close Index: EE:78:7C:67:E6:17                                                                 [hci1] 3.552820
    @ MGMT Command: Set Powered (0x0005) plen 1                                             {0x0001} [hci1] 3.574009
            Powered: Enabled (0x01)
    = Open Index: EE:78:7C:67:E6:17                                                                  [hci1] 3.574038
    < HCI Command: Reset (0x03|0x0003) plen 0                                                    #43 [hci1] 3.574068
    > HCI Event: Command Complete (0x0e) plen 4                                                  #44 [hci1] 3.574835
          Reset (0x03|0x0003) ncmd 1
            Status: Success (0x00)
    < HCI Command: Read Local Supported Features (0x04|0x0003) plen 0                            #45 [hci1] 3.574863
    > HCI Event: Command Complete (0x0e) plen 12                                                 #46 [hci1] 3.575683
          Read Local Supported Features (0x04|0x0003) ncmd 1
            Status: Success (0x00)
            Features: 0x00 0x00 0x00 0x00 0x60 0x00 0x00 0x00
              BR/EDR Not Supported
              LE Supported (Controller)
    < HCI Command: Read Local Version Information (0x04|0x0001) plen 0                           #47 [hci1] 3.575712
    > HCI Event: Command Complete (0x0e) plen 12                                                 #48 [hci1] 3.576564
          Read Local Version Information (0x04|0x0001) ncmd 1
            Status: Success (0x00)
            HCI version: Reserved (0x0b) - Revision 4496 (0x1190)
            LMP version: Reserved (0x0b) - Subversion 4496 (0x1190)
            Manufacturer: Nordic Semiconductor ASA (89)
    < HCI Command: Read BD ADDR (0x04|0x0009) plen 0                                             #49 [hci1] 3.576594
    > HCI Event: Command Complete (0x0e) plen 10                                                 #50 [hci1] 3.577348
          Read BD ADDR (0x04|0x0009) ncmd 1
            Status: Success (0x00)
            Address: EE:78:7C:67:E6:17 (OUI EE-78-7C)
    < HCI Command: LE Read Buffer Size (0x08|0x0002) plen 0                                      #51 [hci1] 3.577405
    > HCI Event: Command Complete (0x0e) plen 7                                                  #52 [hci1] 3.578119
          LE Read Buffer Size (0x08|0x0002) ncmd 1
            Status: Success (0x00)
            Data packet length: 27
            Num data packets: 3
    < HCI Command: LE Read Local Supported Features (0x08|0x0003) plen 0                         #53 [hci1] 3.578150
    > HCI Event: Command Complete (0x0e) plen 12                                                 #54 [hci1] 3.578957
          LE Read Local Supported Features (0x08|0x0003) ncmd 1
            Status: Success (0x00)
            Features: 0xf5 0x49 0x00 0x00 0x00 0xee 0x90 0x11
              LE Encryption
              Extended Reject Indication
              LE Ping
              LE Data Packet Length Extension
              LL Privacy
              Extended Scanner Filter Policies
              LE 2M PHY
              LE Coded PHY
              Channel Selection Algorithm #2
              Unknown features (0x1190ee0000000000)
    < HCI Command: LE Read Supported States (0x08|0x001c) plen 0                                 #55 [hci1] 3.579042
    > HCI Event: Command Complete (0x0e) plen 12                                                 #56 [hci1] 3.579902
          LE Read Supported States (0x08|0x001c) ncmd 1
            Status: Success (0x00)
            States: 0x1190eeff000049ff
              Non-connectable Advertising State
              Scannable Advertising State
              Connectable Advertising State
              High Duty Cycle Directed Advertising State
              Passive Scanning State
              Active Scanning State
              Initiating State
                and Connection State (Master Role)
              Connection State (Slave Role)
              Non-connectable Advertising State
                and Passive Scanning State
              High Duty Cycle Directed Advertising State
                and Passive Scanning State
              Connectable Advertising State
                and Active Scanning State
              Connectable Advertising State
                and Initiating State
                and Master Role & Slave Role
              High Duty Cycle Directed Advertising State
                and Initiating State
                and Master Role & Slave Role
              Low Duty Cycle Directed Advertising State
                and Initiating State
                and Master Role & Slave Role
              Connectable Advertising State
                and Connection State (Master Role)
                and Master Role & Slave Role
              High Duty Cycle Directed Advertising State
                and Connection State (Master Role)
                and Master Role & Slave Role
              Low Duty Cycle Directed Advertising State
                and Connection State (Master Role)
                and Master Role & Slave Role
              Connectable Advertising State
                and Connection State (Slave Role)
                and Master Role & Slave Role
              High Duty Cycle Directed Advertising State
                and Connection State (Slave Role)
                and Slave Role & Slave Role
              Initiating State
                and Connection State (Slave Role)
                and Master Role & Slave Role
              Unknown states (0x1190ec0000000000)
    < HCI Command: Read Local Supported Commands (0x04|0x0002) plen 0                            #57 [hci1] 3.579927
    > HCI Event: Command Complete (0x0e) plen 68                                                 #58 [hci1] 3.582374
          Read Local Supported Commands (0x04|0x0002) ncmd 1
            Status: Success (0x00)
            Commands: 62 entries
              Disconnect (Octet 0 - Bit 5)
              Read Remote Version Information (Octet 2 - Bit 7)
              Set Event Mask (Octet 5 - Bit 6)
              Reset (Octet 5 - Bit 7)
              Read Transmit Power Level (Octet 10 - Bit 2)
              Set Controller To Host Flow Control (Octet 10 - Bit 5)
              Host Buffer Size (Octet 10 - Bit 6)
              Host Number of Completed Packets (Octet 10 - Bit 7)
              Read Local Version Information (Octet 14 - Bit 3)
              Read Local Supported Features (Octet 14 - Bit 5)
              Read BD ADDR (Octet 15 - Bit 1)
              Read RSSI (Octet 15 - Bit 5)
              Set Event Mask Page 2 (Octet 22 - Bit 2)
              LE Set Event Mask (Octet 25 - Bit 0)
              LE Read Buffer Size (Octet 25 - Bit 1)
              LE Read Local Supported Features (Octet 25 - Bit 2)
              LE Set Random Address (Octet 25 - Bit 4)
              LE Set Advertising Parameters (Octet 25 - Bit 5)
              LE Read Advertising Channel TX Power (Octet 25 - Bit 6)
              LE Set Advertising Data (Octet 25 - Bit 7)
              LE Set Scan Response Data (Octet 26 - Bit 0)
              LE Set Advertise Enable (Octet 26 - Bit 1)
              LE Set Scan Parameters (Octet 26 - Bit 2)
              LE Set Scan Enable (Octet 26 - Bit 3)
              LE Create Connection (Octet 26 - Bit 4)
              LE Create Connection Cancel (Octet 26 - Bit 5)
              LE Read White List Size (Octet 26 - Bit 6)
              LE Clear White List (Octet 26 - Bit 7)
              LE Add Device To White List (Octet 27 - Bit 0)
              LE Remove Device From White List (Octet 27 - Bit 1)
              LE Connection Update (Octet 27 - Bit 2)
              LE Set Host Channel Classification (Octet 27 - Bit 3)
              LE Read Channel Map (Octet 27 - Bit 4)
              LE Read Remote Used Features (Octet 27 - Bit 5)
              LE Encrypt (Octet 27 - Bit 6)
              LE Rand (Octet 27 - Bit 7)
              LE Start Encryption (Octet 28 - Bit 0)
              LE Long Term Key Request Reply (Octet 28 - Bit 1)
              LE Long Term Key Request Neg Reply (Octet 28 - Bit 2)
              LE Read Supported States (Octet 28 - Bit 3)
              LE Receiver Test (Octet 28 - Bit 4)
              LE Transmitter Test (Octet 28 - Bit 5)
              LE Test End (Octet 28 - Bit 6)
              Read Authenticated Payload Timeout (Octet 32 - Bit 4)
              Write Authenticated Payload Timeout (Octet 32 - Bit 5)
              LE Set Data Length (Octet 33 - Bit 6)
              LE Read Suggested Default Data Length (Octet 33 - Bit 7)
              LE Write Suggested Default Data Length (Octet 34 - Bit 0)
              LE Add Device To Resolving List (Octet 34 - Bit 3)
              LE Remove Device From Resolving List (Octet 34 - Bit 4)
              LE Clear Resolving List (Octet 34 - Bit 5)
              LE Read Resolving List Size (Octet 34 - Bit 6)
              LE Set Address Resolution Enable (Octet 35 - Bit 1)
              LE Set Resolvable Private Address Timeout (Octet 35 - Bit 2)
              LE Read Maximum Data Length (Octet 35 - Bit 3)
              LE Read PHY (Octet 35 - Bit 4)
              LE Set Default PHY (Octet 35 - Bit 5)
              LE Set PHY (Octet 35 - Bit 6)
              LE Enhanced Receiver Test (Octet 35 - Bit 7)
              LE Enhanced Transmitter Test (Octet 36 - Bit 0)
              LE Read Transmit Power (Octet 38 - Bit 7)
              LE Set Privacy Mode (Octet 39 - Bit 2)
    < HCI Command: Set Event Mask (0x03|0x0001) plen 8                                           #59 [hci1] 3.582445
            Mask: 0x200080000204e890
              Disconnection Complete
              Encryption Change
              Read Remote Version Information Complete
              Command Complete
              Command Status
              Hardware Error
              Number of Completed Packets
              Data Buffer Overflow
              Encryption Key Refresh Complete
              LE Meta
    > HCI Event: Command Complete (0x0e) plen 4                                                  #60 [hci1] 3.583323
          Set Event Mask (0x03|0x0001) ncmd 1
            Status: Success (0x00)
    < HCI Command: LE Set Event Mask (0x08|0x0001) plen 8                                        #61 [hci1] 3.583410
            Mask: 0x0000000000080c5f
              LE Connection Complete
              LE Advertising Report
              LE Connection Update Complete
              LE Read Remote Used Features Complete
              LE Long Term Key Request
              LE Data Length Change
              LE Direct Advertising Report
              LE PHY Update Complete
              LE Channel Selection Algorithm
    > HCI Event: Command Complete (0x0e) plen 4                                                  #62 [hci1] 3.584074
          LE Set Event Mask (0x08|0x0001) ncmd 1
            Status: Success (0x00)
    < HCI Command: LE Read Advertising Channel TX Power (0x08|0x0007) plen 0                     #63 [hci1] 3.584106
    > HCI Event: Command Complete (0x0e) plen 5                                                  #64 [hci1] 3.584761
          LE Read Advertising Channel TX Power (0x08|0x0007) ncmd 1
            Status: Success (0x00)
            TX power: 0 dbm (0x00)
    < HCI Command: LE Read White List Size (0x08|0x000f) plen 0                                  #65 [hci1] 3.584786
    > HCI Event: Command Complete (0x0e) plen 5                                                  #66 [hci1] 3.585394
          LE Read White List Size (0x08|0x000f) ncmd 1
            Status: Success (0x00)
            Size: 8
    < HCI Command: LE Clear White List (0x08|0x0010) plen 0                                      #67 [hci1] 3.585423
    > HCI Event: Command Complete (0x0e) plen 4                                                  #68 [hci1] 3.586049
          LE Clear White List (0x08|0x0010) ncmd 1
            Status: Success (0x00)
    < HCI Command: LE Read Resolving List Size (0x08|0x002a) plen 0                              #69 [hci1] 3.586078
    > HCI Event: Command Complete (0x0e) plen 5                                                  #70 [hci1] 3.586683
          LE Read Resolving List Size (0x08|0x002a) ncmd 1
            Status: Success (0x00)
            Size: 8
    < HCI Command: LE Clear Resolving List (0x08|0x0029) plen 0                                  #71 [hci1] 3.586712
    > HCI Event: Command Complete (0x0e) plen 4                                                  #72 [hci1] 3.587339
          LE Clear Resolving List (0x08|0x0029) ncmd 1
            Status: Success (0x00)
    < HCI Command: LE Read Maximum Data Length (0x08|0x002f) plen 0                              #73 [hci1] 3.587368
    > HCI Event: Command Complete (0x0e) plen 12                                                 #74 [hci1] 3.588182
          LE Read Maximum Data Length (0x08|0x002f) ncmd 1
            Status: Success (0x00)
            Max TX octets: 251
            Max TX time: 2704
            Max RX octets: 251
            Max RX time: 2704
    < HCI Command: LE Read Suggested Default Data Length (0x08|0x0023) plen 0                    #75 [hci1] 3.588211
    > HCI Event: Command Complete (0x0e) plen 8                                                  #76 [hci1] 3.588949
          LE Read Suggested Default Data Length (0x08|0x0023) ncmd 1
            Status: Success (0x00)
            TX octets: 27
            TX time: 328
    < HCI Command: Set Event Mask Page 2 (0x03|0x0063) plen 8                                    #77 [hci1] 3.589005
            Mask: 0x0000000000800000
              Authenticated Payload Timeout Expired
    > HCI Event: Command Complete (0x0e) plen 4                                                  #78 [hci1] 3.589662
          Set Event Mask Page 2 (0x03|0x0063) ncmd 1
            Status: Success (0x00)
    < HCI Command: LE Write Suggested Default Data Length (0x08|0x0024) plen 4                   #79 [hci1] 3.589693
            TX octets: 251
            TX time: 2704
    > HCI Event: Command Complete (0x0e) plen 4                                                  #80 [hci1] 3.590350
          LE Write Suggested Default Data Length (0x08|0x0024) ncmd 1
            Status: Success (0x00)
    < HCI Command: LE Set Default PHY (0x08|0x0031) plen 3                                       #81 [hci1] 3.590379
            All PHYs preference: 0x00
            TX PHYs preference: 0x01
              LE 1M
            RX PHYs preference: 0x01
              LE 1M
    > HCI Event: Command Complete (0x0e) plen 4                                                  #82 [hci1] 3.590974
          LE Set Default PHY (0x08|0x0031) ncmd 1
            Status: Success (0x00)
    = Index Info: EE:78:7C:67:E6:17 (Nordic Semiconductor ASA)                                       [hci1] 3.591010
    < HCI Command: LE Set Advertising Data (0x08|0x0008) plen 32                                 #83 [hci1] 3.591086
            Length: 6
            Flags: 0x04
              BR/EDR Not Supported
            TX power: 0 dBm
    > HCI Event: Command Complete (0x0e) plen 4                                                  #84 [hci1] 3.592062
          LE Set Advertising Data (0x08|0x0008) ncmd 1
            Status: Success (0x00)
    < HCI Command: LE Set Scan Response Data (0x08|0x0009) plen 32                               #85 [hci1] 3.592099
            Length: 13
            Name (short): raspberryp
    > HCI Event: Command Complete (0x0e) plen 4                                                  #86 [hci1] 3.593024
          LE Set Scan Response Data (0x08|0x0009) ncmd 1
            Status: Success (0x00)
    @ MGMT Event: Command Complete (0x0001) plen 7                                          {0x0001} [hci1] 3.593069
          Set Powered (0x0005) plen 4
            Status: Success (0x00)
            Current settings: 0x00000a01
              Powered
              Low Energy
              Secure Connections
    @ RAW Open: hcitool (privileged) version 2.22                                                  {0x0002} 3.601150
    @ RAW Close: hcitool                                                                           {0x0002} 3.601175
    @ RAW Open: hcitool (privileged) version 2.22                                                  {0x0002} 3.601210
    @ RAW Close: hcitool                                                                           {0x0002} 3.601222
    @ RAW Open: hcitool (privileged) version 2.22                                           {0x0002} [hci1] 3.601255
    < HCI Command: Vendor (0x3f|0x001c) plen 5                                                   #87 [hci1] 3.601448
            01 02 00 01 01                                   .....
    > HCI Event: Command Status (0x0f) plen 4                                                    #88 [hci1] 3.602133
          Vendor (0x3f|0x001c) ncmd 1
            Status: Unknown HCI Command (0x01)
    @ RAW Close: hcitool

  • Hi,

     

    Could you try following the guide here?

    https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/nrf5x-support-within-the-zephyr-project-rtos

     

    From chapter "Using the BLE Controller with Linux's BlueZ" shows how to interface the hci device using newer bluez tools.

     

    Kind regards,

    Håkon

  • Hi,

     

    Could you try following the guide here?

    https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/nrf5x-support-within-the-zephyr-project-rtos

     

    From chapter "Using the BLE Controller with Linux's BlueZ" shows how to interface the hci device using newer bluez tools.

     

    Kind regards,

    Håkon

    I also tried this option, the whole difference in only one line in the command "sudo hciconfig hci0 version...":

    hci0:   Type: Primary  Bus: UART
            BD Address: 00:00:00:00:00:00  ACL MTU: 27:7  SCO MTU: 0:0
            HCI Version:  (0xb)  Revision: 0x0
            LMP Version:  (0xb)  Subversion: 0xffff
            Manufacturer: not assigned (1521)
        
    Attempting to set local name:
    pi@raspberrypi:~ $ sudo hciconfig hci0 name xxx
    Can't change local name on hci0: Input/output error (5)

    --------------------------------------------------------------------

    Build on nordic NRF SDK:
    hci0:   Type: Primary  Bus: UART
            BD Address: 00:00:00:00:00:00  ACL MTU: 27:7  SCO MTU: 0:0
            HCI Version:  (0xb)  Revision: 0x1190
            LMP Version:  (0xb)  Subversion: 0x1190
            Manufacturer: Nordic Semiconductor ASA (89)
        
    Attempting to set local name:
    pi@raspberrypi:~ $ sudo hciconfig hci0 name xxx
    Can't change local name on hci0: Input/output error (5)

  • Hi,

     

    There's several tools that are deprecated by bluez, as shown in the first link:

    There's a number of utilities in the upstream bluez bluetooth package that have long been deprecated with their functionality replaced by the core bluetoothctl utility. They're no longer receiving updates and at some point may be removed. Move these utilities to a dedicated sub package to indicate their upstream support status.
    
    The list of utilities being moved are: ciptool gatttool hciattach hciconfig hcidump hcitool rfcomm sdptool

    some features of those tools might not work with newer versions of bluez. newer tools are prefixed with "bt".

    Please use newer tools. 

     

    AlexandrX said:
    Attempting to set local name:
    pi@raspberrypi:~ $ sudo hciconfig hci0 name xxx
    Can't change local name on hci0: Input/output error (5)

    if you setup a terminal with btmon, you can see the debug information.

    This particular response isn't responded to on my end.

     

    Try using btmgmt --index <your index>

    Then issue:

    power on

    find -l

    You should get:

    Discovery started
    hci1 type 6 discovering on

     

    and a list of discovered LE devices in your area.

     

    AlexandrX said:
    hci0:   Type: Primary  Bus: UART
            BD Address: 00:00:00:00:00:00  ACL MTU: 27:7  SCO MTU: 0:0
            HCI Version:  (0xb)  Revision: 0x0
            LMP Version:  (0xb)  Subversion: 0xffff
            Manufacturer: not assigned (1521)

      Similar output here, it seems your manufacturer lookup table is old. that one belongs to the linux foundation.

    $ hciconfig hci1 version
    hci1:	Type: Primary  Bus: USB
    	BD Address: 00:00:00:00:00:00  ACL MTU: 27:7  SCO MTU: 0:0
    	HCI Version: 5.2 (0xb)  Revision: 0x0
    	LMP Version: 5.2 (0xb)  Subversion: 0xffff
    	Manufacturer: The Linux Foundation (1521)
    

     

    Kind regards,

    Håkon

Related