Bluetooth NXP UART Driver Linux BSP 6.1.22 btnxpuart

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

Bluetooth NXP UART Driver Linux BSP 6.1.22 btnxpuart

Bluetooth NXP UART Driver Linux BSP 6.1.22 btnxpuart

 

Introduction

 

Prior to 6.1.22_2.0.0 BSP release, Bluetooth interface are based on the tty line discipline framework, so we need to use hciattach tool to enable it in the user space.

From 6.1.22_2.0.0 BSP, the nxp bluetooth driver no longer needs the help of the userspace hciattach tool, and the tty port bound by bluetooth also won't be exported to the user space, so you cannot find the corresponding tty device anymore. So, you won't see the (/dev/ttymxcX), for the Bluetooth interface. All jobs has been done in the new NXP Bluetooth driver.

New Method

 

The new NXP Bluetooth UART Driver is based on a server driver for the NXP BT serial protocol, which can enable the built-in Bluetooth device inside an NXP BT chip.

This driver has a Power Save feature that will put the chip into a sleep state whenever there is no activity for 2000ms and will be woken up when any activity is to be initiated over UART. 

Device Tree support

The new BT framework requires adding a "bluetooth" sub node with a device compatibility string to the attached UART node in the dts file

&uart1 {
    bluetooth {
          compatibility = "nxp,88w8987-bt";
          fw-init-baudrate = <3000000>; #Optional. Default is considered 115200 if this parameter not defined.
    };
};

 

  • Note: The parameter ‘compatibility = “nxp,88w8987-bt”’ will use for 88W8987, IW416, 88Q9098, IW612 chipsets and need to change for 88W8997 with parameter ‘compatibility = “nxp,88w8997-bt”’.  
  • Note: fw-init-baudrate parameter depends on the module vendor. The Murata and Azuere wifi modules support in BSP release uses the default value -- 115200. We strongly recommend looking at the module vendor-specific baud rate parameter.
  • Note: For the old 88Q9098 Murata 1XL module that uses the 3Mbps by default, please add the fw-init-baudrate = <3000000> property in dts files to make it work.

Enable Guide

 

Use wifi interface to load combo (wifi & bt) firmware and enable BT

Need to load wifi driver first, then load the BT driver, otherwise, BT driver suspend/resume test will fail.

This is a HW limitation, since NXP wifi and BT module use the same power control pin(W_DISABLE1#), if we don't load the wifi driver, SDIO bus will power down the wifi chip during suspend resume, which may cause the BT chip also been powered down and cannot work after resume back. So we need to load the wifi driver to make sure SDIO bus won't power down the BT chip to make sure BT functions can work during suspend resume.

modprobe moal mod_para=nxp/wifi_mod_para.conf
modprobe btnxpuart

or

insmod mlan.ko
insmod moal.ko mod_para=nxp/wifi_mod_para.conf
insmod btnxpuart
btnxpuart.png
 

Unload UART Driver modprobe moal

Make sure run hciconfig hci0 up or hciconfig hci0 reset or bluetootctl power on before unload btnxpuart driver.

If we don't open hci0 interface, the driver cannot send change to 115200 baud rate command to BT chip, which causes the host and BT chip baud rate mismatch, the host still uses 115200bps talk to the BT chip which now use 3Mbps, it cannot work anymore.

So we need to make sure open the hci0 interface before unload btnxpuart driver.

 

mod_para=nxp/wifi_mod_para.conf
modprobe btnxpuart
sleep 3
hciconfig hci0 up  #Note: Need to up hci interface before unload the BT module
hcitool -i hci0 cmd 3F 23 02 00 00
modprobe -r btnxpuart
modprobe -r moal
sleep 3​

For better reference:

  • Please find the I.MX 8MQ Linux getting started user guide, UM11483, Chapter "7.1 Bring-up using NXP Bluetooth UART driver" 
  • Bluetooth Deep Sleep Feature App Note AN13920, Chapter 6 Load NXP UART driver module

NOTE: Please do not run the power save feature for Murata IW612 2EL Module

Regards,

Mario

Comments

How to do on 8MPlus-EVK BB with Linux 5.15

In this version, there is support for the hciattach.

So, you could use this driver insted of the btnxpuart.

Mario

100% helpful (1/1)
Version history
Last update:
‎08-23-2023 11:00 AM
Updated by: