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

Using nRF5340-PDK with HCI USB sample: hci device not found on Ubuntu

Hi,

I am aware, that I the PDK is deprecated and I plan to use a nRF5340-DK in the near future.

However, I would like to make use of the PDK I have sitting around and thus tried to convert it to a BT 5-enabled USB Dongle using the HCI USB sample.

I built the sample `hci_usb` from Zephyr (version 2.5.0) using  `west build -b nrf5340pdk_nrf5340_cpuappns --pristine`  which automatically included the `hci_rpmsg` as child image due to CONFIG_BT_RPMSG_NRF53 being set to 'y'. I flashed the combined image using `west flash --erase` and UART console output showed:

[17:14:08:809] *** Booting Zephyr OS version 2.4.99 ***␍␊

[17:14:08:812] Bluetooth over USB sample␍␊

Eager to try it out, I ran `hciconfig` on my Ubuntu 19.10 machine with BlueZ 5.50 and did not see an additional Bluetooth adapter. `lsusb` still shows the nRF53 as JLink device.

I'd like to narrow down the problem:

Any response is appreciated!

Martin

  • Update: I found and followed this blog post (https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/nrf5x-support-within-the-zephyr-project-rtos), which describes exactly what I am up to.

    However, I do not understand the difference between `hci_uart`, `hci_usb` and `hci_usb_h4` samples. It seems the nRF53 supports USB, so should I prefer the latter samples over `hci_uart`?

    Steps I did after having flashed the `hci_uart` sample (to follow your blog post):

    sudo service bluetooth start

    # my nRF53PDK shows up as. I tried all of those with btattach command
    /dev/ttyACM1 - SEGGER_J-Link_000960113693
    /dev/ttyACM3 - SEGGER_J-Link_000960113693
    /dev/ttyACM4 - SEGGER_J-Link_000960113693

    sudo btattach -B /dev/ttyACM1 -S 1000000 -P h4
    Attaching Primary controller to /dev/ttyACM1
    Switched line discipline from 0 to 15
    Device index 1 attached


    btmon shows:

    = New Index: 00:00:00:00:00:00 (Primary,UART,hci1)                                                                 [hci1] 104.429211
    = Open Index: 00:00:00:00:00:00                                                                                    [hci1] 104.429227
    < HCI Command: Reset (0x03|0x0003) plen 0                                                                       #2 [hci1] 104.429237
    = Close Index: 00:00:00:00:00:00        

    I expect that the problem starts here, as I assume, that hci1 should not be closed immediately. Still, I continued:

    sudo btmgmt --index 1 # index 0 is used by the internal BT controller of my laptop
    [hci1]# auto-power
    Waiting for index 1 to appear

    I then use hciconfig and see, that there are indeed hci0 and hci1 (which is shown as DOWN). However, when I do `sudo hciconfig hci1 up`, it gives me a timeout and `btmon` shows:

    @ RAW Open: hciconfig version 2.22                                                                               {0x0004} 355.759208
    @ RAW Close: hciconfig                                                                                           {0x0004} 355.759503
    @ RAW Open: hciconfig (privileged) version 2.22                                                                  {0x0004} 361.789043
    = Open Index: 00:00:00:00:00:00                                                                                    [hci1] 361.789056
    < HCI Command: Reset (0x03|0x0003) plen 0                                                                       #3 [hci1] 361.789100
    = Close Index: 00:00:00:00:00:00                                                                                   [hci1] 371.871702
    @ RAW Close: hciconfig                                                                                           {0x0004} 371.872091

    I hope this additional is helpful. Thanks a lot!

    Martin

Related