How to use Bluetooth on Colibri IMX6ULL CPU module?

Hello, Toradex community.

I have a problem of Bluetooth with Linux.

I’m now trying to use Bluetooth on Colibri IMX6ULL CPU module. I compiled the Linux kernel source code after change configuration by make nconfig:

Networking support  ---> 
    <*> Bluetooth subsystem support  --->

           Bluetooth device drivers  --->    
                 <*> HCI UART driver 

I deployed zImage and device trees ( imx6ull-colibri-wifi-eval-v3.dtb and imx6ull-colibri-eval-v3.dtb) on the module.

When I use bluetoothctl command on (customized) Linux kernel, no default controllers of Bluetooth was shown:

root@colibri-imx6ull:~# bluetoothctl
Agent registered
[bluetooth]#

I checked the dmesg, the Bluetooth interface seemed to be loaded.

root@colibri-imx6ull:~# dmesg | grep Bluetooth
[    0.181077] Bluetooth: Core ver 2.22
[    0.181288] Bluetooth: HCI device and connection manager initialized
[    0.181359] Bluetooth: HCI socket layer initialized
[    0.181422] Bluetooth: L2CAP socket layer initialized
[    0.181568] Bluetooth: SCO socket layer initialized
[    1.571248] Bluetooth: HCI UART driver ver 2.3
[    1.576025] Bluetooth: HCI UART protocol LL registered

I noticed that hciconfig does not show any message.

The question is that how I can enable hci0 node. I think that if I could enable the node hci0, the default controller of Bluetooth will be shown by bluetoothctl command.


When I use prebuilt kernel ( colibri-imx6ull_lxde-image-tezi_2.8b3.111-20180627.tar ), I was able to see output as follows:

root@colibri-imx6ull:~# hciconfig
hci0:   Type: Primary  Bus: SDIO
    BD Address: 00:19:88:5E:11:D1  ACL MTU: 1021:7  SCO MTU: 120:6
    DOWN
    RX bytes:846 acl:0 sco:0 events:34 errors:0
    TX bytes:566 acl:0 sco:0 commands:34 errors:0

root@colibri-imx6ull:~# bluetoothctl
[NEW] Controller 00:XX:XX:XX:XX:XX colibri-imx6ull [default]
Agent registered
[bluetooth]#

hi @T_Miya

Welcome to the Toradex Community!!!

Which kernel did you compile? Could you provide the exact version of your compiled software ( uname -r )? What is the output of ‘print variant’ in uboot?

Thanks and best regards, Jaski

Thank you for your reply.

The output of uname -r is:

root@colibri-imx6ull:~# uname -r
4.9.87

The output of print variant in uboot is:

Colibri iMX6ULL # print variant
variant=-wifi   

Are they expected outputs?

Just for better understanding: Why do you need to recompile the kernel? Our default kernel which comes with the demo images come with rather complete Wi-Fi and Bluetooth support…

I will modify the device trees for using FlexCAN drivers. This is why I have to compile the Linux kernel. At first, I would like to check the Bluetooth function with deployed custom Linux kernel ( zImage and .dtb files ) but I failed it.

Hi team/@jaski.tx, it is possible that I cannot work on this for the next couple of days. If you could check on this until then, I would really appreciate it.

Last tests I did was applying the configuration from the OE layer. By default, the BT_HCIUART_LL option does not appear under the Bluetooth drivers because of BT_HCIUART_SERDEV ( Depends on: BT [=m] && BT_HCIUART_SERDEV [=n] ) CPTCFG_BACKPORTED_BT_HCIUART_SERDEV is not set (line 1451).

Changing that by hand to CPTCFG_BACKPORTED_BT_HCIUART_SERDEV=y didn’t make it appear. Tried re-cloning both backports-toradex and linux-toradex (first applying the ull defconfig to the kernel. Tried with both customer’s and defconfig) but still nothing.

Finally, I also tried adding the config field by hand but both CPTCFG_BACKPORTED_BT_HCIUART_SERDEV and CPTCFG_BACKPORTED_BT_HCIUART_LL are changed back to “not set” when I compile. I don’t think that any config hacking (i.e change dependencies) should be needed so I bet I must be doing something wrong.