How to use hciattach for BT on the i.MX8 Mini EVK

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to use hciattach for BT on the i.MX8 Mini EVK

3,100 Views
pclass_sensonix
Contributor II

I am working with the i.MX8 Mini EVK ( 8MMINILPD4-EVKB ). I can build an image for the device and flash it's eMMC with the uuu tool. I use the latest meta-imx with linux-imx version 5.10.52-lts and Yocto hardknott branch. The MACHINE target in Yocto is 'imx8mmevk' and the image is based on 'core-image-full-cmdline'.

I can load the WiFi modules and see the Linux wireless interfaces. However, I cannot get hciattach to work. I've tried several ways of calling hciattach to create the hci0 bluetooth interface, but the commands seem to hang.

How should I call hciattach on this EVK? Thank you.

 

 

modprobe moal mod_para=nxp/wifi_mod_para.conf
modprobe btmrvl
modprobe btmrvl_sdio
hciattach /dev/ttymxc0 qca
#hciattach /dev/ttymxc0 any 115200 noflow
root@device:~# modprobe moal mod_para=nxp/wifi_mod_para.conf
[   35.917697] wlan: Loading MWLAN driver
[   35.922043] vendor=0x02DF device=0x9149 class=0 function=1
[   35.927649] Attach moal handle ops, card interface type: 0x105
[   35.938933] SD8987: init module param from usr cfg
[   35.943776] card_type: SD8987, config block: 0
[   35.948247] cfg80211_wext=0xf
[   35.951241] wfd_name=p2p
[   35.953782] max_vir_bss=1
[   35.956431] cal_data_cfg=none
[   35.959419] drv_mode = 7
[   35.961961] ps_mode = 2
[   35.964454] auto_ds = 2
[   35.966932] fw_name=nxp/sdiouart8987_combo_v0.bin
[   35.971692] SDIO: max_segs=128 max_seg_size=65535
[   35.976423] rx_work=1 cpu_num=4
[   35.982742] Request firmware: nxp/sdiouart8987_combo_v0.bin
[   37.392846] WLAN FW is active
[   37.395857] on_time is 37393237750
[   37.446673] wlan: version = SD8987----16.92.10.p210.1-MM5X16266.p4-GPL-(FP92) 
[   37.454826] wlan: Driver loaded successfully
root@device:~# modprobe btmrvl
root@device:~# modprobe btmrvl_sdio
root@device:~# 
root@device:~# 
root@device:~# hciattach /dev/ttymxc0 qca

 

 

 

0 Kudos
4 Replies

3,097 Views
amberworth
Contributor III

I ran into something similar with a nano and the same radio.

In my local.conf I added the following

  • DISTRO_FEATURES_append "bluetooth "
  • BLUETOOTH_ENABLED = "1"
 
0 Kudos

3,087 Views
pclass_sensonix
Contributor II

Hi - thanks for the reply. I have added those config options, but unfortunately it still fails. There was 1 time in about 20 boots/attempts to use hciattach that actually worked. 

I wonder how it could work once, but not any other time with the same commands.

I have double checked that nothing else is using the port:

ls -l /proc/[0-9]*/fd/* |grep mxc

The 1 time it did work, the output was this:

root@device:~# modprobe moal mod_para=nxp/wifi_mod_para.conf
[  218.022678] wlan: Loading MWLAN driver
[  218.026991] vendor=0x02DF device=0x9149 class=0 function=1
[  218.032595] Attach moal handle ops, card interface type: 0x105
[  218.044890] SD8987: init module param from usr cfg
[  218.049736] card_type: SD8987, config block: 0
[  218.054207] cfg80211_wext=0xf
[  218.057202] wfd_name=p2p
[  218.059743] max_vir_bss=1
[  218.062531] cal_data_cfg=none
[  218.065542] drv_mode = 7
[  218.068095] ps_mode = 2
[  218.070544] auto_ds = 2
[  218.073025] fw_name=nxp/sdiouart8987_combo_v0.bin
[  218.077770] SDIO: max_segs=128 max_seg_size=65535
[  218.082511] rx_work=1 cpu_num=4
[  218.087892] Request firmware: nxp/sdiouart8987_combo_v0.bin
[  219.490066] WLAN FW is active
[  219.493060] on_time is 219489265750
[  219.556742] wlan: version = SD8987----16.92.10.p210.1-MM5X16266.p4-GPL-(FP92) 
[  219.565173] wlan: Driver loaded successfully
root@device:~# hciattach /dev/ttymxc0 any 115200 flow
Setting TTY to N_HCI line discipline
Device setup complete
root@device:~# hciconfig -a
hci0:   Type: Primary  Bus: UART
        BD Address: EC:2E:98:F7:00:A8  ACL MTU: 1016:5  SCO MTU: 60:12
        DOWN 
        RX bytes:707 acl:0 sco:0 events:40 errors:0
        TX bytes:448 acl:0 sco:0 commands:40 errors:0
        Features: 0xff 0xfe 0x8f 0xfe 0xdb 0xff 0x7b 0x87
        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 
        Link policy: RSWITCH HOLD SNIFF 
        Link mode: SLAVE ACCEPT 

Kernel BT Config:

CONFIG_BT=y
CONFIG_BT_BREDR=y
CONFIG_BT_RFCOMM=y
CONFIG_BT_RFCOMM_TTY=y
CONFIG_BT_BNEP=y
CONFIG_BT_BNEP_MC_FILTER=y
CONFIG_BT_BNEP_PROTO_FILTER=y
CONFIG_BT_HIDP=y
CONFIG_BT_HS=y
CONFIG_BT_LE=y
CONFIG_BT_LEDS=y
# CONFIG_BT_MSFTEXT is not set
# CONFIG_BT_DEBUGFS is not set
# CONFIG_BT_SELFTEST is not set
# CONFIG_BT_FEATURE_DEBUG is not set
CONFIG_BT_INTEL=m
CONFIG_BT_BCM=y
CONFIG_BT_RTL=m
CONFIG_BT_QCA=y
CONFIG_BT_HCIBTUSB=m
# CONFIG_BT_HCIBTUSB_AUTOSUSPEND is not set
CONFIG_BT_HCIBTUSB_BCM=y
CONFIG_BT_HCIBTUSB_MTK=y
CONFIG_BT_HCIBTUSB_RTL=y
CONFIG_BT_HCIBTSDIO=y
CONFIG_BT_HCIUART=y
CONFIG_BT_HCIUART_SERDEV=y
CONFIG_BT_HCIUART_H4=y
CONFIG_BT_HCIUART_NOKIA=y
CONFIG_BT_HCIUART_BCSP=y
CONFIG_BT_HCIUART_ATH3K=y
CONFIG_BT_HCIUART_LL=y
CONFIG_BT_HCIUART_3WIRE=y
# CONFIG_BT_HCIUART_INTEL is not set
CONFIG_BT_HCIUART_BCM=y
# CONFIG_BT_HCIUART_RTL is not set
CONFIG_BT_HCIUART_QCA=y
# CONFIG_BT_HCIUART_AG6XX is not set
CONFIG_BT_HCIUART_MRVL=y
# CONFIG_BT_HCIBCM203X is not set
# CONFIG_BT_HCIBPA10X is not set
# CONFIG_BT_HCIBFUSB is not set
CONFIG_BT_HCIVHCI=y
CONFIG_BT_MRVL=y
CONFIG_BT_MRVL_SDIO=y
# CONFIG_BT_ATH3K is not set
CONFIG_BT_MTKSDIO=y
# CONFIG_BT_MTKUART is not set
# CONFIG_GPIO_BT8XX is not set
# CONFIG_VIDEO_USBTV is not set
# CONFIG_VIDEO_SONY_BTF_MPX is not set
# CONFIG_VIDEO_BT819 is not set
# CONFIG_VIDEO_BT856 is not set
# CONFIG_VIDEO_BT866 is not set
# CONFIG_SND_BT87X is not set
# CONFIG_SND_SOC_MTK_BTCVSD is not set
CONFIG_SND_SOC_BT_SCO=y
CONFIG_BTRFS_FS=m
CONFIG_BTRFS_FS_POSIX_ACL=y
# CONFIG_BTRFS_FS_CHECK_INTEGRITY is not set
# CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not set
# CONFIG_BTRFS_DEBUG is not set
# CONFIG_BTRFS_ASSERT is not set
# CONFIG_BTRFS_FS_REF_VERIFY is not set
CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y
# CONFIG_DEBUG_INFO_BTF is not set
# CONFIG_RBTREE_TEST is not set

 

0 Kudos

3,086 Views
pclass_sensonix
Contributor II

Also, when it fails, the console hangs and I never see the following print ( like I did when it worked

Setting TTY to N_HCI line discipline
0 Kudos

3,078 Views
pclass_sensonix
Contributor II

Here are all of the bluetooth related debug prints on boot up:

root@device:~# dmesg | grep -i blue
[    0.107004] Bluetooth: Core ver 2.22
[    0.107035] Bluetooth: HCI device and connection manager initialized
[    0.107046] Bluetooth: HCI socket layer initialized
[    0.107056] Bluetooth: L2CAP socket layer initialized
[    0.107071] Bluetooth: SCO socket layer initialized
[    3.774097] Bluetooth: HCI UART driver ver 2.3
[    3.778558] Bluetooth: HCI UART protocol H4 registered
[    3.783706] Bluetooth: HCI UART protocol BCSP registered
[    3.789047] Bluetooth: HCI UART protocol LL registered
[    3.794193] Bluetooth: HCI UART protocol ATH3K registered
[    3.799611] Bluetooth: HCI UART protocol Three-wire (H5) registered
[    3.805981] Bluetooth: HCI UART protocol Broadcom registered
[    3.811686] Bluetooth: HCI UART protocol QCA registered
[    3.816939] Bluetooth: HCI UART protocol Marvell registered
[    4.153638] Bluetooth: RFCOMM TTY layer initialized
[    4.158532] Bluetooth: RFCOMM socket layer initialized
[    4.163716] Bluetooth: RFCOMM ver 1.11
[    4.167479] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    4.172795] Bluetooth: BNEP filters: protocol multicast
[    4.178029] Bluetooth: BNEP socket layer initialized
[    4.183000] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[    4.188928] Bluetooth: HIDP socket layer initialized  

 

 

0 Kudos