DESK-MX9-L/Peripherals/WiFi

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

2025/01/30

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


Peripheral WiFi[edit | edit source]

Device tree configuration[edit | edit source]

Here below is an example of device tree configuration used standard 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]

Linux messages at boot time[edit | edit source]

  • load wlan driver
...
...
root@desk-mx93-rev1:~# killall wpa_supplicant
root@desk-mx93-rev1:~# dmesg -C
root@desk-mx93-rev1:~# modprobe moal mod_para=nxp/wifi_mod_para.conf
root@desk-mx93-rev1:~# dmesg
[  261.464604] mlan: loading out-of-tree module taints kernel.
[  261.550244] wlan: Loading MWLAN driver
[  261.550720] wlan: Register to Bus Driver...
[  261.556490] vendor=0x02DF device=0x9141 class=0 function=1
[  261.556572] Attach moal handle ops, card interface type: 0x104
[  261.556584] rps set to 0 from module param
[  261.559163] SD8997: init module param from usr cfg
[  261.559186] card_type: SD8997, config block: 0
[  261.559195] cfg80211_wext=0xf
[  261.559198] max_vir_bss=1
[  261.559203] cal_data_cfg=none
[  261.559206] ps_mode = 1
[  261.559209] auto_ds = 1
[  261.559215] host_mlme=enable
[  261.559219] fw_name=nxp/sdiouart8997_combo_v4.bin
[  261.559242] SDIO: max_segs=128 max_seg_size=65535
[  261.559247] rx_work=1 cpu_num=2
[  261.559253] Enable moal_recv_amsdu_packet
[  261.559273] Attach mlan adapter operations.card_type is 0x104.
[  261.559613] wlan: Enable TX SG mode
[  261.559621] wlan: Enable RX SG mode
[  261.563869] Request firmware: nxp/sdiouart8997_combo_v4.bin
[  262.360926] Wlan: FW download over, firmwarelen=633976 downloaded 624880
[  263.079785] WLAN FW is active
[  263.079800] on_time is 262916085659
[  263.135161] VDLL image: len=9096
[  263.135970] FW country code WW does not match with US
[  263.136238] fw_cap_info=0x587c6fa3, dev_cap_mask=0xffffffff
[  263.136258] max_p2p_conn = 8, max_sta_conn = 8
[  263.166959] Register NXP 802.11 Adapter mlan0
[  263.167059] wlan: uap%d set max_mtu 2000
[  263.173775] Register NXP 802.11 Adapter uap0
[  263.183110] Register NXP 802.11 Adapter wfd0
[  263.183154] wlan: version = SD8997----16.92.21.p137.4-MM6X16505.p4-GPL-(FP92)
[  263.184203] wlan: Register to Bus Driver Done
[  263.184216] wlan: Driver loaded successfully
[  263.186426] remoteproc remoteproc0: releasing imx-rproc
root@desk-mx93-rev1:~#
...

Setup for static connection[edit | edit source]

  • check the interface is properly initialized:
root@desk-mx93-rev1:~# ifconfig mlan0
mlan0: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether 28:d0:43:3e:a9:37  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

root@desk-mx93-rev1:~#
  • setup the wpa_supplicant.conf configuration file
root@desk-mx93-rev1:~# cat /tmp/wpa_supplicant.conf
network={
    ssid="ZyXEL"
    key_mgmt=NONE
}
  • apply the wpa_supplicant.conf configuration file starting the wpa_supplicant:
root@desk-mx93-rev1:~# dmesg -C
root@desk-mx93-rev1:~# wpa_supplicant -i mlan0 -c /etc/wpa_supplicant.conf -B
Successfully initialized wpa_supplicant
rfkill: Cannot open RFKILL control device
root@desk-mx93-rev1:~# dmesg
[  357.533818] wlan: mlan0 START SCAN
[  361.860400] wlan: SCAN COMPLETED: scanned AP count=10
[  361.864567] wlan: HostMlme mlan0 send auth to bssid fc:XX:XX:XX:03:90
[  361.875708] mlan0:
[  361.875720] wlan: HostMlme Auth received from fc:XX:XX:XX:03:90
[  361.892797] wlan: HostMlme mlan0 Connected to bssid fc:XX:XX:XX:03:90 successfully
...

Add the mlan0 IP address:

root@desk-mx93-rev1:~# ip addr add 192.168.11.89/255.255.255.0 dev mlan0
  • the network access is enabled
root@desk-mx93-rev1:~# ping 192.168.11.243 -c 4 -I mlan0
PING 192.168.11.243 (192.168.11.243) from 192.168.11.89 mlan0: 56(84) bytes of data.
64 bytes from 192.168.11.243: icmp_seq=1 ttl=64 time=21.9 ms
64 bytes from 192.168.11.243: icmp_seq=2 ttl=64 time=1.31 ms
64 bytes from 192.168.11.243: icmp_seq=3 ttl=64 time=2.09 ms
64 bytes from 192.168.11.243: icmp_seq=4 ttl=64 time=4.39 ms

--- 192.168.11.243 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 1.313/7.426/21.916/8.441 ms
root@desk-mx93-rev1:~#

Setup for DHCP connection[edit | edit source]

  • check the interface is properly recognized
root@desk-mx93-rev1:~# ifconfig mlan0
mlan0: flags=-28669<UP,BROADCAST,MULTICAST,DYNAMIC>  mtu 1500
        ether 28:d0:43:3e:a9:37  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

root@desk-mx93-rev1:~#
  • setup your wpa_supplicant.conf configuration file
root@desk-mx93-rev1:~# cat /tmp/wpa_supplicant.conf
network={
    ssid="daveguest"
    psk="****"
    key_mgmt=WPA-PSK
}
  • reboot and start the wpa_supplicant using the mlan0 interface and the wpa_supplicant.conf configuration file:
root@desk-mx93-rev1:~# dmesg -C
root@desk-mx93-rev1:~# wpa_supplicant -i mlan0 -c /etc/wpa_supplicant.conf -B
Successfully initialized wpa_supplicant
rfkill: Cannot open RFKILL control device
root@desk-mx93-rev1:~# dmesg
[  150.546501] wlan: mlan0 START SCAN
  • obtain an IP address via DHCP
root@desk-mx93-rev1:~# udhcpc -i mlan0
udhcpc: started, v1.36.1
Dropped protocol specifier '.udhcpc' from 'mlan0.udhcpc'. Using 'mlan0' (ifindex=4).
udhcpc: broadcasting discover
udhcpc: broadcasting select for 10.203.1.140, server 10.203.1.252
udhcpc: lease of 10.203.1.140 obtained from 10.203.1.252, lease time 600
/etc/udhcpc.d/50default: Adding DNS 10.203.1.254
Dropped protocol specifier '.udhcpc' from 'mlan0.udhcpc'. Using 'mlan0' (ifindex=4).
root@desk-mx93-rev1:~#
  • the interface will be configured and the network is accessed
root@desk-mx93-rev1:~# ping www.dave.eu -c 4 -I mlan0
PING www.dave.eu (51.91.120.202) from 10.203.1.140 mlan0: 56(84) bytes of data.
64 bytes from 202.ip-51-91-120.eu (51.91.120.202): icmp_seq=1 ttl=48 time=142 ms
64 bytes from 202.ip-51-91-120.eu (51.91.120.202): icmp_seq=2 ttl=48 time=36.0 ms
64 bytes from 202.ip-51-91-120.eu (51.91.120.202): icmp_seq=3 ttl=48 time=38.5 ms
64 bytes from 202.ip-51-91-120.eu (51.91.120.202): icmp_seq=4 ttl=48 time=107 ms

--- www.dave.eu ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 36.035/81.016/142.250/45.484 ms
root@desk-mx93-rev1:~#

Additional information[edit | edit source]