FETMX6ULL-C核心板基于NXP i.MX6ULL处理器开发设计,采用低功耗的ARM Cortex-A7架构,运行速度高达800MHz。原生支持8路UART、2路Ethernet、2路CAN总线、2路USB 、LCD等常用接口。并采用超小尺寸设计,核心板尺寸仅40*29mm,适应更多体积受限的应用场景
为了方便用户对核心板的性能及功能进行测试,飞凌提供了配套的功能评估板,将产品开发过程中常用的功能接口引出,比如说2路的Ethernet、2路的USB、2路的CAN以及4路的UART、2路的SPI和2路的IIC,同时这里还预留了显示的LCD接口以及4G模组、WIFI模组的插槽等。
本文以用户快速熟悉产品,了解接口功能和测试方法为目的,主要讲述了飞凌iMX6ULL开发板WIFI接口功能的测试方法,以及使用过程中出现的一些问题如何排查。在测试过程中,对一些命令进行了注释,方便用户理解,以实用够用为主。 一、iMX6ULL开发板 WIFI 功能测试 WiFi支持: 模块 | 支持 | RTL8188EUS | WiFi | RTL8723BU | WiFi | RTL8723DU | WiFi |
1、 USB WIFI RTL8188eus使用 说明: USB WIFI无线局域网卡是选配模块 ,如若有需求,请联系飞凌嵌入式官网在线客服。 以下对wifi模块在STA模式下,连接到无线网络的测试: 步骤1:iMX6ULL开发板上电,启动Linux系统。 步骤2:连接USB WIFI到飞凌iMX6ULL开发板的USB Host接口 步骤 3 :按照如下格式输入相应的参数: -i表示wifi型号; -s表示wifi热点名称; -p表示密码,若无密码输入-p NONE; 路由器采用wpa加密方式。具体操作指令可查看wifi.sh脚本。 连接打印内容如下: root@fl-imx6ull:~# fltest_cmd_wifi.sh -i 8188 -s forlinx -p xxxx打印信息如下: wifi 8188ssid forlinxpasw xxxxusbcore: deregistering interface driver rtl8723buRTL871X: module exit startusbcore: deregistering interface driver rtl8188euRTL871X: rtw_ndev_uninit(wlan1)usb 1-1.3: reset high-speed USB device number 7 using ci_hdrcRTL871X: module exit successRTL871X: module init startRTL871X: rtl8188eu v4.3.0.9_15178.20150907RTL871X: build time: Mar 25 2020 02:23:46bFWReady == _FALSE call reset 8051...RTL871X: rtw_ndev_init(wlan0)usbcore: registered new interface driver rtl8188euRTL871X: module init ret=0==> rtl8188e_iol_efuse_patchIPv6: ADDRCONF(NETDEV_UP): wlan0: link is not readyps: invalid option -- 'f'BusyBox v1.24.1 (2019-04-27 02:24:01 CST) multi-call binary. Usage: psSuccessfully initialized wpa_supplicantrfkill: Cannot open RFKILL controRTL871X: set bssid:00:00:00:00:00:00l deviceRTL871X: set ssid [g▒isQ▒J▒)ͺ▒▒▒▒F|▒T▒▒vZ.c3▒ɚ���<▒▒▒▒] fw_state=0x00000008ioctl[SIOCSIWAP]: Operation not permittedioctl[SIOCGIWSCAN]: Resource temporarily unavailableioctl[SIOCGIWSCAN]: Resource temporarily unavailableRTL871X: indicate disassocwlan0: Trying to associate with 04:d7:a5:84:fa:40 (SSID='forlinx' freq=2437 MHz)RTL871X: set ssid [forlinx] fw_state=0x00000008RTL871X: set bssid:04:d7:a5:84:fa:40RTL871X: start authRTL871X: auth success, start assocRTL871X: assoc successIPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes readyRTL871X: recv eapol packetwlan0: Associated with 04:d7:a5:84:fa:40RTL871X: send eapol packetRsvdPageNum: 8udhcpc (v1.24.1) startedRTL871X: recv eapol packetRTL871X: send eapol packetRTL871X: recv eapol packetRTL871X: send eapol packetRTL871X: set pairwise key camid:4, addr:04:d7:a5:84:fa:40, kid:0, type:AESwlan0: WPA: Key negotiation completed with 04:d7:a5:84:fa:40 [PTKRTL871X: set group key camid:5, addr:04:d7:a5:84:fa:40, kid:2, type:AES=CCMP GTK=CCMP]wlan0: CTRL-EVENT-CONNECTED - Connection to 04:d7:a5:84:fa:40 completed [id=0 id_str=]Sending discover...Sending select for 192.168.4.129...Lease of 192.168.4.129 obtained, lease time 36000/etc/udhcpc.d/50default: Adding DNS 222.222.202.202/etc/udhcpc.d/50default: Adding DNS 222.222.222.222Finshed!脚本运行完,能自动分配ip并添加DNS,则wifi连接成功。 步骤5:ping ip或者域名,命令如下。 root@fl-imx6ull:~# ping -c 4 www.baidu.comPING www.baidu.com (220.181.38.149): 56 data bytes64 bytes from 220.181.38.149: seq=0 ttl=51 time=26.648 ms64 bytes from 220.181.38.149: seq=1 ttl=51 time=13.529 ms64 bytes from 220.181.38.149: seq=2 ttl=51 time=15.656 ms64 bytes from 220.181.38.149: seq=3 ttl=51 time=26.249 ms --- www.baidu.com ping statistics ---4 packets transmitted, 4 packets received, 0% packet lossround-trip min/avg/max = 13.529/20.520/26.648 ms步骤6:卸载已经加入内核的模块。 root@fl-imx6ull:~# rmmod 8188eu打印信息如下: RTL871X: module exit startusbcore: deregistering interface driver rtl8188euRTL871X: indicate disassocRTL871X: rtw_cmd_thread: DriverStopped(1) SurpriseRemoved(0) break at line 478wlan0: CTRL-EVENT-DISCONNECTED bssid=04:d7:a5:84:fa:40 reason=3 locally_generated=1RTL871X: rtw_ndev_uninit(wlan0)RTL871X: rtw_dev_unload: driver not in IPSusb 1-1.3: reset high-speed USB device number 7 using ci_hdrcRTL871X: module exit success2、 板载WIFI的使用 说明: l wifi频率为2.4G l 兼容8723bu和8723du两种wifi驱动 l 默认路由器采用wpa加密方式。 如果开发板有板载的WIFI无线局域网卡,则焊接在评估板如图所示位置(下图为8723du):
步骤1:检查iMX6ULL开发板是否已经焊接该模块,正确焊接如上图。连接上天线。 步骤2:iMX6ULL开发板上电,启动Linux系统,先使用lsmod查看模块加载状态: root@fl-imx6ull:~# lsmodModule Size Used bymx6s_capture 14876 08723 du 1313893 0 //默认wifi自动加载,8723du已加载成功ov9650_camera 12446 0注意:若 飞凌iMX6ULL 开发板上焊接的是8723 b u,使用lsmod会显示8723 b u 以下以8723du为例进行测试描述: 步骤3:测试 Ø STA模式 该模式即作为一个站点,连接到无线网络中,操作方法如下: -i表示wifi型号;-s表示wifi热点名称;-p表示密码,若无密码输入-p NONE;路由器采用wpa加密方式,具体操作指令可查看wifi.sh脚本 root@fl-imx6ull:~# fltest_cmd_wifi.sh -i 8723du -s forlinx -p xxx //执行测试脚本打印信息如下: wifi 8723dussid forlinxpasw xxxusbcore: deregistering interface driver rtl8723duusbcore: registered new interface driver rtl8723duIPv6: ADDRCONF(NETDEV_UP): wlan0: link is not readySuccessfully initialized wpa_supplicantrfkill: Cannot open RFKILL control deviceudhcpc (v1.24.1) startedSending discover...wlan0: CTRL-EVENT-REGDOM-CHANGE init=BEACON_HINT type=UNKNOWNwlan0: Trying to associate with 04:d7:a5:f9:26:1d (SSID='forlinx' freq=2427 MHz)wlan0: Associated with 04:d7:a5:f9:26:1dIPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes readywlan0: WPA: Key negotiation completed with 04:d7:a5:f9:26:1d [PTK=CCMP GTK=TKIP]wlan0: CTRL-EVENT-CONNECTED - Connection to 04:d7:a5:f9:26:1d completed [id=0 id_str=]nf_conntrack: automatic helper assignment is deprecated and it will be removed soon. Use the iptables CT target to attach helpers instead.Sending discover...Sending select for 192.168.5.186...Lease of 192.168.5.186 obtained, lease time 1800/etc/udhcpc.d/50default: Adding DNS 222.222.202.202/etc/udhcpc.d/50default: Adding DNS 222.222.222.222WLAN Finshed!脚本运行完,能自动分配ip并生成DNS,则wifi连接成功。 ping ip或者域名,命令如下: root@fl-imx6ull:~#ping -c 5www.baidu.com打印信息如下: PING 192.168.4.1 (192.168.4.1): 56 data bytes64 bytes from 192.168.4.1: seq=0 ttl=128 time=39.783 ms64 bytes from 192.168.4.1: seq=1 ttl=128 time=81.529 ms64 bytes from 192.168.4.1: seq=2 ttl=128 time=15.236 ms64 bytes from 192.168.4.1: seq=3 ttl=128 time=12.076 ms64 bytes from 192.168.4.1: seq=4 ttl=128 time=16.300 ms --- 192.168.4.1 ping statistics ---5 packets transmitted, 5 packets received, 0% packet lossround-trip min/avg/max = 12.076/32.984/81.529 mswifi信号 查看WiFi信号方法如下: root@fl-imx6ull:~# cat /proc/net/wireless | grep wlan0 | awk '{print $3}' //获取信号强度78.root@fl-imx6ull:~# cat /proc/net/wireless | grep wlan0 | awk '{print $4}' //获取信号质量,单位dBm-68.root@fl-imx6ull:~# cat /proc/net/wireless | grep wlan0 | awk '{print $5}' //网口背景噪声,单位dBm-256.AP模式 说明: l 本模块支持AP模式,理论最大连接用户为8个。 l 本例为以太网eth0连接路由器说明,配置完以太网后,需要测试eth0是否可以连接外网,如果可以连接外网(方法参考 “有线网卡”章节),请继续按照操作步骤执行,如果不可以请检查以太网或者路由器连接是否正常。 工作在AP模式下,手机等设备可以直接连接模块。 设置以太网IP,配置网络防火墙: root@fl-imx6ull:~# udhcpc -i eth0 //自动分配IP,若以测试eth0网络正常,可不操作此步root@fl-imx6ull:~# echo 1 > /proc/sys/net/ipv4/ip_forward //打开 IP 转发root@fl-imx6ull:~# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE//设置转发规则设置WiFi的模式与IP 确保模块8723bu已经加载。 root@fl-imx6ull:~# ifconfig wlan0 up //打开WiFiroot@fl-imx6ull:~# ifconfig wlan0 192.168.0.10 netmask 255.255.255.0 //设置IP与子网掩码root@fl-imx6ull:~# ifconfig wlan0 promisc //设置 wlan0 为混杂模式开启AP root@fl-imx6ull:~# udhcpd /etc/udhcpd/udhcpd.conf & //WiFi 地址、网关等配置信息root@fl-imx6ull:~# hostapd -d /etc/hostapd/hostapd.conf & //加密方式、用户名、密码等设置hostapd.conf文件中:ssid为用户名,/为密码手机等移动终端可以通过WiFi连接到开发板的AP热点,iMX6ULL开发板默认使用以下用户名和密码: 热点名:forlinxtest密码:1234567890 步骤4:卸载已经加入内核的模块: root@fl-imx6ull:~# rmmod 8723duusbcore: deregistering interface driver rtl8723duwlan0: CTRL-EVENT-DISCONNECTED bssid=04:d7:a5:f9:26:1d reason=0FETMX6ULL-C核心板是飞凌基于NXP i.MX6U系列处理器推出的第三款核心板,成熟的技术方案,带来稳定可靠的全新体验。核心板尺寸仅40*29mm,并采用2mm合高的板对板连接器,将小体积、便于拆卸的优势集一身。您可搜索飞凌嵌入式,获取更多详细资料。
|