DESK-MX9-L/Peripherals/Bluetooth

From DAVE Developer's Wiki
Jump to: navigation, search
History
Issue Date Notes

2025/03/17

DESK-MX9-L-5.2.0 release
2026/02/16 DESK-MX9-L-6.x.x release


Peripheral Bluetooth[edit | edit source]

Device tree configuration[edit | edit source]

Here below is an example of the device tree configuration used on DAVE's kit:

From imx93-aura-sbcx.dtsi:

/ {
...
		usdhc3_pwrseq: usdhc3_pwrseq {
			compatible = "mmc-pwrseq-simple";
			pinctrl-names = "default";
			pinctrl-0 = <&pinctrl_usdhc3_pwrseq>;
			reset-gpios = <&gpio2 18 GPIO_ACTIVE_LOW>;
		};
...
		reg_wifi_en: regulator-wifi-en {
			compatible = "regulator-fixed";
			enable-active-high;
			gpio = <&gpio2 6 GPIO_ACTIVE_HIGH>;
			pinctrl-names = "default";
			pinctrl-0 = <&pinctrl_wifi_pwr_en>;
			regulator-max-microvolt = <3300000>;
			regulator-min-microvolt = <3300000>;
			regulator-name = "PDn_AW-CM276NF";
			/*
			 * IW612 wifi chip needs more delay than other wifi chips to complete
			 * the host interface initialization after power up, otherwise the
			 * internal state of IW612 may be unstable, resulting in the failure of
			 * the SDIO3.0 switch voltage.
			 */
			startup-delay-us = <20000>;
		};
...
};

...
...

/*
 * AzureWave SDIO on usdhc3
 */
&usdhc3{
	pinctrl-names = "default", "state_100mhz", "state_200mhz";
	pinctrl-0 = <&pinctrl_usdhc3>;
	pinctrl-1 = <&pinctrl_usdhc3_100mhz>;
	pinctrl-2 = <&pinctrl_usdhc3_200mhz>;
	vmmc-supply = <&reg_wifi_en>;
	mmc-pwrseq = <&usdhc3_pwrseq>;
	bus-width = <4>;
	non-removable;
	no-1-8-v;
	max-frequency = <24000000>;
	status = "okay";
};

...
...

&iomuxc {
...
...
	pinctrl_usdhc3: usdhc3grp {
		fsl,pins = <
			MX93_PAD_SD3_CLK__USDHC3_CLK		0x159e
			MX93_PAD_SD3_CMD__USDHC3_CMD		0x4000138e
			MX93_PAD_SD3_DATA0__USDHC3_DATA0	0x4000138e
			MX93_PAD_SD3_DATA1__USDHC3_DATA1	0x4000138e
			MX93_PAD_SD3_DATA2__USDHC3_DATA2	0x4000138e
			MX93_PAD_SD3_DATA3__USDHC3_DATA3	0x4000138e
		>;
	};

	pinctrl_usdhc3_100mhz: usdhc3-100mhzgrp {
		fsl,pins = <
			MX93_PAD_SD3_CLK__USDHC3_CLK		0x158e
			MX93_PAD_SD3_CMD__USDHC3_CMD		0x4000138e
			MX93_PAD_SD3_DATA0__USDHC3_DATA0	0x4000138e
			MX93_PAD_SD3_DATA1__USDHC3_DATA1	0x4000138e
			MX93_PAD_SD3_DATA2__USDHC3_DATA2	0x4000138e
			MX93_PAD_SD3_DATA3__USDHC3_DATA3	0x4000138e
		>;
	};

	pinctrl_usdhc3_200mhz: usdhc3-200mhzgrp {
		fsl,pins = <
			MX93_PAD_SD3_CLK__USDHC3_CLK		0x15fe
			MX93_PAD_SD3_CMD__USDHC3_CMD		0x400013fe
			MX93_PAD_SD3_DATA0__USDHC3_DATA0	0x400013fe
			MX93_PAD_SD3_DATA1__USDHC3_DATA1	0x400013fe
			MX93_PAD_SD3_DATA2__USDHC3_DATA2	0x400013fe
			MX93_PAD_SD3_DATA3__USDHC3_DATA3	0x400013fe
		>;
	};

	pinctrl_wifi_pwr_en: wifipwrengrp { 		//  SDIO_RESET
		fsl,pins = <
			MX93_PAD_GPIO_IO06__GPIO2_IO06		0x31e
		>;
	};

	pinctrl_usdhc3_pwrseq: usdhc3pwrseqgrp {   	//  W_DISABLE
		fsl,pins = <
			MX93_PAD_GPIO_IO18__GPIO2_IO18		0x31e
		>;
	};
};

Accessing the peripheral[edit | edit source]

  • load the wlan driver
<pre class="workstation-terminal">
...
...
root@desk-mx93-rev1:~# killall wpa_supplicant
root@desk-mx93-rev1:~# modprobe moal mod_para=nxp/wifi_mod_para.conf
[   22.140280] mlan: loading out-of-tree module taints kernel.
[   22.230748] wlan: Loading MWLAN driver
[   22.234941] wlan: Register to Bus Driver...
[   22.244909] vendor=0x02DF device=0x9141 class=0 function=1
[   22.250478] Attach moal handle ops, card interface type: 0x104
[   22.256647] rps set to 0 from module param
[   22.264172] SD8997: init module param from usr cfg
[   22.269016] card_type: SD8997, config block: 0
[   22.273487] cfg80211_wext=0xf
[   22.276639] max_vir_bss=1
[   22.279260] cal_data_cfg=none
[   22.282265] ps_mode = 1
[   22.284740] auto_ds = 1
[   22.287181] host_mlme=enable
[   22.290283] fw_name=nxp/sdiouart8997_combo_v4.bin
[   22.295032] SDIO: max_segs=128 max_seg_size=65535
[   22.299746] rx_work=1 cpu_num=2
[   22.302907] Enable moal_recv_amsdu_packet
[   22.307139] Attach mlan adapter operations.card_type is 0x104.
[   22.318973] wlan: Enable TX SG mode
[   22.322488] wlan: Enable RX SG mode
[   22.328476] Request firmware: nxp/sdiouart8997_combo_v4.bin
[   23.137039] Wlan: FW download over, firmwarelen=633976 downloaded 624880
[   23.860471] WLAN FW is active
[   23.863445] on_time is 23703123885
[   23.910453] VDLL image: len=9096
[   23.913933] FW country code WW does not match with US
[   23.919481] fw_cap_info=0x587c6fa3, dev_cap_mask=0xffffffff
[   23.925095] max_p2p_conn = 8, max_sta_conn = 8
[   23.958558] Register NXP 802.11 Adapter mlan0
[   23.963183] wlan: uap%d set max_mtu 2000
[   23.972406] Register NXP 802.11 Adapter uap0
[   23.983256] Register NXP 802.11 Adapter wfd0
[   23.992476] wlan: version = SD8997----16.92.21.p137.4-MM6X16505.p4-GPL-(FP92)
[   24.005370] wlan: Register to Bus Driver Done
[   24.010198] wlan: Driver loaded successfully
[   24.010303] remoteproc remoteproc0: releasing imx-rproc
root@desk-mx93-rev1:~#
...
  • attach the Bluetooth Host Controller Interface (HCI)
root@desk-mx93-rev1:~# hciattach /dev/ttyLP2 any 115200 flow
Device setup complete
root@desk-mx93-rev1:~# [   41.226223] kauditd_printk_skb: 17 callbacks suppressed
[   41.226233] audit: type=1334 audit(1771408465.834:19): prog-id=19 op=LOAD
[   41.238784] audit: type=1334 audit(1771408465.842:20): prog-id=20 op=LOAD
[   41.245960] audit: type=1334 audit(1771408465.846:21): prog-id=21 op=LOAD
[   41.597831] Bluetooth: MGMT ver 1.22
[   41.615501] NET: Registered PF_ALG protocol family

root@desk-mx93-rev1:~#
  • enable the device with hci0
root@desk-mx93-rev1:~# hciconfig hci0 up
  • scan for Bluetooth devices
root@desk-mx93-rev1:~# bluetoothctl
hci0 new_settings: powered bondable ssp br/edr le secure-conn
Agent registered
[CHG] Controller 28:D0:43:3E:A9:36 Pairable: yes
[bluetooth]# scan on
SetDiscoveryFilter success
hci0 type 7 discovering on
Discovery started
[CHG] Controller 28:D0:43:3E:A9:36 Discovering: yes
...
[bluetooth]# scan off
hci0 type 7 discovering off
Discovery stopped
[CHG] Device 53:D1:C3:B3:8F:B5 TxPower is nil
[CHG] Device 53:D1:C3:B3:8F:B5 RSSI is nil
[CHG] Device 4B:CB:DE:C2:87:9E TxPower is nil
[CHG] Device 4B:CB:DE:C2:87:9E RSSI is nil
[CHG] Device 6A:F6:91:AC:02:5A TxPower is nil
[CHG] Device 6A:F6:91:AC:02:5A RSSI is nil
[CHG] Device 8C:39:5C:14:03:23 RSSI is nil
[CHG] Device 25:80:6E:8A:4C:1B RSSI is nil
[CHG] Device A0:D7:F3:29:DD:FD RSSI is nil
[CHG] Device 4E:58:62:4A:EA:3F TxPower is nil
[CHG] Device 4E:58:62:4A:EA:3F RSSI is nil
[CHG] Controller 28:D0:43:3E:A9:36 Discovering: no
[bluetooth]#