飛凌OKMX6ULL-C開(kāi)發(fā)平臺(tái)試用體驗(yàn)
非常榮幸能夠試用體驗(yàn)飛凌OKMX6ULL-C開(kāi)發(fā)平臺(tái)。
飛凌OKMX6ULL-C開(kāi)發(fā)平臺(tái)核心板和底板采用接插件的連接方式。其中核心板(型號(hào)FETMX6ULL-C)采用恩智浦公司的的NXP i.MX6ULL處理器開(kāi)發(fā)設(shè)計(jì),采用低功耗的ARM Cortex-A7架構(gòu),運(yùn)行速度高達(dá)800MHz;原生支持8路UART、2路Ethernet、2路CAN-Bus總線、2路USB2.0、LCD等常用接口。
飛凌OKMX6ULL-C開(kāi)發(fā)平臺(tái)-資源
1. 開(kāi)箱
1.1 配件
飛凌OKMX6ULL-C開(kāi)發(fā)平臺(tái)配件包括:USB轉(zhuǎn)Type-C調(diào)試串口線(115200bps)、電源線、飛凌OKMX6ULL-C開(kāi)發(fā)板。
(WIFI天線自備,或者直接忽略)
飛凌OKMX6ULL-C開(kāi)發(fā)平臺(tái)-開(kāi)箱
1.2 接口說(shuō)明
飛凌OKMX6ULL-C開(kāi)發(fā)平臺(tái)如圖所示:
飛凌OKMX6ULL-C開(kāi)發(fā)平臺(tái)-接口
1.3 開(kāi)發(fā)資料
飛凌OKMX6ULL-C開(kāi)發(fā)平臺(tái)提供了非常詳盡的開(kāi)發(fā)資料(飛凌已經(jīng)提供了網(wǎng)盤企業(yè)服務(wù),下載不限速,YYDS)。
//------軟件資料(Linux4.1.15+Qt5.6) 下載鏈接: https://pan.baidu.com/s/1Vuw-po6Hl6wHUKa538SDuA 提取碼: xn8u //------硬件資料/產(chǎn)品資料 下載鏈接: https://pan.baidu.com/s/1A1TcSa-oeBJPPqzaoqVlyg 提取碼: eepg //------開(kāi)發(fā)環(huán)境(虛擬機(jī)Ubuntu-18.04,登錄賬戶forlinx,密碼forlinx) 下載鏈接: https://pan.baidu.com/s/1V6PRy3S0G7cYR5plDhL9RQ 提取碼: gef8 //------證書和測(cè)試報(bào)告 下載鏈接: https://pan.baidu.com/s/1Q_oP8w1R2XutAk1IrsVZEA 提取碼: h7kp飛凌OKMX6ULL-C開(kāi)發(fā)平臺(tái)-開(kāi)發(fā)資料
2. 系統(tǒng)登陸與網(wǎng)絡(luò)功能配置
2.1 系統(tǒng)登陸
初次上電建議使用Type-C串口(波特率115200)進(jìn)行系統(tǒng)登陸。
//------系統(tǒng)登陸 賬戶:root 密碼:無(wú) //------Log Running local boot scripts (/etc/rc.local). Freescale i.MX Release Distro 4.1.15-2.0.1 fl-imx6ull /dev/ttymxc0 fl-imx6ull login: root Password: root@fl-imx6ull:~# uname -a Linux fl-imx6ull 4.1.15-00050-ge85def2 #1 SMP PREEMPT Mon Apr 18 17:42:50 CST 2022 armv7l armv7l armv7l GNU/Linux root@fl-imx6ull:~# pstree init-+-S01xserver-nodm---xinit-+-Xorg | `-matchbox-window-+-Xsession---matchbox-keyboa | |-at-spi-bus-laun-+-dbus-daemon | | |-{gdbus} | | `-{gmain) S 561 561 | |-connman-applet | |-matchbox-deskto | `-matchbox-panel |-atd |-avahi-daemon---avahi-daemon |-connmand |-crond |-2*[dbus-daemon] |-dbus-launch |-dropbear |-gconfd-2 |-getty |-klogd |-ofonod |-rpc.statd |-rpcbind |-settings-daemon |-start_getty---bash---pstree |-syslogd |-udevd `-vsftpd root@fl-imx6ull:~#
//------U-Boot信息截圖:
U-Boot
2.2 WIFI功能配置
WIFI連接可以選擇SMA天線、FPC天線或者不用。
//------WIFI連接 //---指令 fltest_cmd_wifi.sh -i 8723du -s YUSUR-YF -p 2018YUSURserver //---含義 “-i 8723du” :wifi驅(qū)動(dòng)為8723du “-s YUSUR-YF”:wifi名稱 “-p 2018YUSURserver”:wifi密碼 //---校驗(yàn)驅(qū)動(dòng)(查看wlan0驅(qū)動(dòng)) ethtool -i wlan0 lsmod //---ping測(cè)試 ping www.baidu.com //------Log信息 root@fl-imx6ull:~# fltest_cmd_wifi.sh -i 8723du -s YUSUR-YF -p 2018YUSURserver wifi 8723du ssid YUSUR-YF pasw 2018YUSURserver usbcore: deregistering interface driver rtl8723du usbcore: registered new interface driver rtl8723du IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready Successfully initialized wpa_supplicant rfkill: Cannot open RFKILL control device udhcpc (v1.24.1) started Sending discover... wlan0: Trying to associate with d4:d5:1b:e4:13:13 (SSID='YUSUR-YF' freq=2452 MHz) IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready wlan0: Associated with d4:d5:1b:e4:13:13 wlan0: WPA: Key negotiation completed with d4:d5:1b:e4:13:13 [PTK=CCMP GTK=CCMP] wlan0: CTRL-EVENT-CONNECTED - Connection to d4:d5:1b:e4:13:13 completed [id=0 id_str=] wlan0: WPA: Group rekeying completed with d4:d5:1b:e4:13:13 [GTK=CCMP] 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.7.213... Lease of 192.168.7.213 obtained, lease time 259200 /etc/udhcpc.d/50default: Adding DNS 192.168.7.249 /etc/udhcpc.d/50default: Adding DNS 192.168.7.250 WLAN Finshed! root@fl-imx6ull:~# ifconfig eth0 Link encap:Ethernet HWaddr 26:54:f3:65:34:f0 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) eth1 Link encap:Ethernet HWaddr ea:27:54:f3:65:34 UP BROADCAST MULTICAST DYNAMIC MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:2 errors:0 dropped:0 overruns:0 frame:0 TX packets:2 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:140 (140.0 B) TX bytes:140 (140.0 B) wlan0 Link encap:Ethernet HWaddr b4:6d:c2:2e:b1:94 inet addr:192.168.7.213 Bcast:192.168.7.255 Mask:255.255.252.0 inet6 addr: fe80::b66d:c2ff:fe2e:b194/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:103 errors:0 dropped:0 overruns:0 frame:0 TX packets:41 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:26199 (25.5 KiB) TX bytes:9211 (8.9 KiB) root@fl-imx6ull:~# ethtool -i wlan0 driver: rtl8723du version: firmware-version: expansion-rom-version: bus-info: 1-1.4:1.2 supports-statistics: no supports-test: no supports-eeprom-access: no supports-register-dump: no supports-priv-flags: no root@fl-imx6ull:~# lsmod Module Size Used by 8723du 1302499 0 root@fl-imx6ull:~#wifi
3.1 CPU性能測(cè)試
3.1.1 查看CPU信息
查看CPU信息,反饋結(jié)果是ARMv7 Processor(單核處理器),位寬32bit。
//------查看CPU信息:lscpu //---指令 cat /proc/cpuinfo //---結(jié)果 指令集:ARMv7 Processor rev 5 (v7l) 單核CPU:編號(hào)0 //---注意: lscpu指令并不支持。其他可以查看CPU核數(shù)的指令是 ls -la /sys/bus/cpu/devices/ 反饋信息只有cpu0,即單核。 //------查看CPU頻率: //---指令(當(dāng)前頻率、最高頻率、最低頻率) cat /sys/bus/cpu/devices/cpu0/cpufreq/cpuinfo_cur_freq cat /sys/bus/cpu/devices/cpu0/cpufreq/cpuinfo_max_freq cat /sys/bus/cpu/devices/cpu0/cpufreq/cpuinfo_min_freq //------查看CPU溫度 cat /sys/class/thermal/thermal_zone0/temp 在U-Boot中顯示CPU工作溫度范圍(-40C to 105C),設(shè)置節(jié)溫為105攝氏度。 //------Log信息 root@fl-imx6ull:~# cat /proc/cpuinfo processor : 0 model name : ARMv7 Processor rev 5 (v7l) BogoMIPS : 3.00 Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x0 CPU part : 0xc07 CPU revision : 5 Hardware : Freescale i.MX6 Ultralite (Device Tree) Revision : 0000 Serial : 172041d75d5b170c root@fl-imx6ull:~# ls -la /sys/bus/cpu/devices/ drwxr-xr-x 2 root root 0 Dec 16 10:34 . drwxr-xr-x 4 root root 0 Dec 16 10:34 .. lrwxrwxrwx 1 root root 0 Dec 16 10:34 cpu0 -> ../../../devices/system/cpu/cpu0 root@fl-imx6ull:~# ls /sys/bus/cpu/devices/ cpu0 root@fl-imx6ull:~# cat /sys/bus/cpu/devices/cpu0/cpufreq/cpuinfo_cur_freq 198000 root@fl-imx6ull:~# cat /sys/bus/cpu/devices/cpu0/cpufreq/cpuinfo_max_freq 792000 root@fl-imx6ull:~# cat /sys/bus/cpu/devices/cpu0/cpufreq/cpuinfo_min_freq 198000 root@fl-imx6ull:/sys/bus/cpu/devices# cat /sys/class/thermal/thermal_zone0/temp 52178 root@fl-imx6ull:~#
3.1.2 CPU 壓力測(cè)試
CPU 的壓力的測(cè)試方式有很多,我們通過(guò) bc 命令來(lái)計(jì)算圓周率方法來(lái)測(cè)試 CPU 在運(yùn)算過(guò)程中的穩(wěn)定性。
//------CPU壓力測(cè)試:PI(派)運(yùn)算 //---執(zhí)行PI(派)運(yùn)算 echo "scale=500; 4*a(1)" | bc -l -q 或者 echo "scale=500; 4*a(1)" | bc -l -q & //---計(jì)時(shí)模式執(zhí)行PI(派)運(yùn)算:統(tǒng)計(jì)時(shí)間只能當(dāng)作參考 time echo "scale=500; 4*a(1)" | bc -l -q & 或者 time echo "scale=5000; 4*a(1)" | bc -l -q & 上述命令將在后臺(tái)計(jì)算的 PI,并精確到小數(shù)點(diǎn)后 500位 或 5000位,計(jì)算過(guò)程需要一段時(shí)間。 圓周率500位計(jì)算時(shí)間約0.53秒,圓周率5000位計(jì)算時(shí)間約2分24秒后。 在計(jì)算期間 CPU 使用率達(dá)到 100%,沒(méi)有發(fā)生異常,說(shuō)明 CPU 壓力測(cè)試通過(guò)。還可以繼續(xù)增加精確值,可進(jìn)一步提高測(cè)試壓力。 //------Log信息 root@fl-imx6ull:~# echo "scale=500; 4*a(1)" | bc -l -q 3.141592653589793238462643383279502884197169399375105820974944592307 81640628620899862803482534211706798214808651328230664709384460955058 22317253594081284811174502841027019385211055596446229489549303819644 28810975665933446128475648233786783165271201909145648566923460348610 45432664821339360726024914127372458700660631558817488152092096282925 40917153643678925903600113305305488204665213841469519415116094330572 70365759591953092186117381932611793105118548074462379962749567351885 75272489122793818301194912 root@fl-imx6ull:~# time echo "scale=500; 4*a(1)" | bc -l -q 3.141592653589793238462643383279502884197169399375105820974944592307 81640628620899862803482534211706798214808651328230664709384460955058 22317253594081284811174502841027019385211055596446229489549303819644 28810975665933446128475648233786783165271201909145648566923460348610 45432664821339360726024914127372458700660631558817488152092096282925 40917153643678925903600113305305488204665213841469519415116094330572 70365759591953092186117381932611793105118548074462379962749567351885 75272489122793818301194912 real 0m0.531s user 0m0.500s sys 0m0.020s root@fl-imx6ull:~# time echo "scale=5000; 4*a(1)" | bc -l -q 3.141592653589793238462643383279502884197169399375105820974944592307 (此處省略部分?jǐn)?shù)字) 74351362222477158915049530984448933309634087807693259939780541934144 73774418426312986080998886874132604720 real 2m24.559s user 2m24.060s sys 0m0.020s root@fl-imx6ull:~#
3.1.3 SHELL腳本實(shí)現(xiàn)溫度監(jiān)測(cè)
通過(guò)將讀取的溫度值進(jìn)行浮點(diǎn)除法運(yùn)算,即可將溫度直觀的轉(zhuǎn)換為常用的攝氏度;添加sleep的1秒延時(shí),可以實(shí)現(xiàn)一秒一次溫度打印輸出。
溫度讀取腳本“run_cpu_thermal.sh”內(nèi)容如下:
#!/bin/bash # ------ dividend=1000 ; while true do echo "***********************************" date # echo "Board_Temperature is :" # cat /sys/class/thermal/thermal_zone0/temp echo "" temp=/sys/class/thermal/thermal_zone0/temp ; divisor=$(cat $temp) ; echo "Board_Temperature is : $bd_temp" bd_temp= awk 'BEGIN{printf " %.4f ℃ n",'$divisor' '/' '$dividend'}' sleep 1 done
3.2 DDR內(nèi)存性能測(cè)試
飛凌OKMX6ULL-C開(kāi)發(fā)平臺(tái)采用 512MB DDR-SDRAM ,下面進(jìn)行內(nèi)存測(cè)試。
3.2.1 DDR內(nèi)存基本信息
通過(guò)“free -h”指令讀取內(nèi)存DDR的使用情況。
//------測(cè)試工具 free //---測(cè)試指令 free -h 或者 free -m //---參數(shù)解析 -h 參數(shù)代表單位為 GByte -m 參數(shù)代表單位為 MByte total :內(nèi)存總量 used :被使用的內(nèi)存量 free :可使用的內(nèi)存量 //------Log信息 root@fl-imx6ull:~# free -h total used free shared buff/cache available Mem: 477M 31M 373M 1.1M 73M 368M Swap: 0B 0B 0B root@fl-imx6ull:~#
3.2.2 查看內(nèi)存信息
讀取系統(tǒng)中的內(nèi)存的參數(shù)信息,則可以通過(guò)/proc/meminfo 文件得到。
//------查看內(nèi)存信息 cat /proc/meminfo //---參數(shù)解析 MemTotal:所有可用的 RAM 大小,物理內(nèi)存減去預(yù)留位和內(nèi)核使用 MemFree :LowFree + HighFree Buffers:用來(lái)給塊設(shè)備做緩存的大小 Cached:文件的緩沖區(qū)大小 SwapCached:已經(jīng)被交換出來(lái)的內(nèi)存。與 I/O 相關(guān) Active:經(jīng)常(最近)被使用的內(nèi)存 Inactive:最近不常使用的內(nèi)存 //------Log信息 root@fl-imx6ull:~# cat /proc/meminfo MemTotal: 489380 kB MemFree: 382032 kB MemAvailable: 377844 kB Buffers: 15772 kB Cached: 43064 kB SwapCached: 0 kB Active: 54068 kB Inactive: 27196 kB Active(anon): 22648 kB Inactive(anon): 864 kB Active(file): 31420 kB Inactive(file): 26332 kB Unevictable: 0 kB Mlocked: 0 kB HighTotal: 0 kB HighFree: 0 kB LowTotal: 489380 kB LowFree: 382032 kB SwapTotal: 0 kB SwapFree: 0 kB Dirty: 0 kB Writeback: 0 kB AnonPages: 22428 kB Mapped: 24564 kB Shmem: 1084 kB Slab: 16620 kB SReclaimable: 9384 kB SUnreclaim: 7236 kB KernelStack: 728 kB PageTables: 1024 kB NFS_Unstable: 0 kB Bounce: 0 kB WritebackTmp: 0 kB CommitLimit: 244688 kB Committed_AS: 76468 kB VmallocTotal: 1548288 kB VmallocUsed: 37188 kB VmallocChunk: 1329932 kB CmaTotal: 327680 kB CmaFree: 326632 kB root@fl-imx6ull:~#
3.2.3 內(nèi)存功能壓力測(cè)試-memtester
內(nèi)存功能壓力測(cè)試-memtester
通過(guò)給定測(cè)試內(nèi)存的大小和次數(shù), 可以對(duì)系統(tǒng)現(xiàn)有的內(nèi)存進(jìn)行壓力上的測(cè)試??墒褂孟到y(tǒng)工具 memtester 進(jìn)行測(cè)試,如指定內(nèi)存大小 128MB,測(cè)試次數(shù)為 10,測(cè)試命令為“memtester 128M 10"。
下列以使用 128MB 內(nèi)存空間,單次測(cè)試為例:
//------測(cè)試工具 memtester //------測(cè)試指令 memtester 128M 1 //---指令說(shuō)明 指定內(nèi)存大小 128MB,測(cè)試次數(shù)為 1 //------Log信息 root@fl-imx6ull:~# memtester memtester version 4.3.0 (32-bit) Copyright (C) 2001-2012 Charles Cazabon. Licensed under the GNU General Public License version 2 (only). pagesize is 4096 pagesizemask is 0xfffff000 need memory argument, in MB Usage: memtester [-p physaddrbase [-d device]] [B|K|M|G] [loops] root@fl-imx6ull:~# memtester 128M 1 memtester version 4.3.0 (32-bit) Copyright (C) 2001-2012 Charles Cazabon. Licensed under the GNU General Public License version 2 (only). pagesize is 4096 pagesizemask is 0xfffff000 want 128MB (134217728 bytes) got 128MB (134217728 bytes), trying mlock ...locked. Loop 1/1: Stuck Address : ok Random Value : ok Compare XOR : ok Compare SUB : ok Compare MUL : ok Compare DIV : ok Compare OR : ok Compare AND : ok Sequential Increment: ok Solid Bits : ok Block Sequential : ok Checkerboard : ok Bit Spread : ok Bit Flip : ok Walking Ones : ok Walking Zeroes : ok Done. root@fl-imx6ull:~#
//------memtester測(cè)試截圖:
memtester
3.2.4 內(nèi)存帶寬測(cè)試-bw_mem
內(nèi)存帶寬測(cè)試-bw_mem工具可以對(duì)內(nèi)存RAM進(jìn)行指定容量讀寫測(cè)試。
//------測(cè)試工具 bw_mem //---測(cè)試指令(容量根據(jù)實(shí)際情況指定) bw_mem 100m rd bw_mem 100m wr //---測(cè)試結(jié)果 WR寫帶寬:455.97MB/S RD讀帶寬:917.36MB/S //------Log信息 root@fl-imx6ull:~# bw_mem 100M wr 100.00 455.97 root@fl-imx6ull:~# bw_mem 100M rd 100.00 917.36 root@fl-imx6ull:~#
4. 存儲(chǔ)功能測(cè)試
飛凌OKMX6ULL-C開(kāi)發(fā)平臺(tái)的存儲(chǔ)介質(zhì)包括eMMC、TF卡(自備TF卡)和USB2.0(自備U盤)。
4.1 eMMC測(cè)試
簡(jiǎn)單測(cè)試 eMMC。
//------eMMC信息查詢: dmesg | grep mmc //------WR寫入測(cè)試:40.1MB/S dd if=/dev/zero of=/test bs=1M count=500 conv=fsync //------RD讀取測(cè)試:52.7MB/S dd if=/test of=/dev/zero bs=1M count=500 //---Log信息 root@fl-imx6ull:~# dmesg | grep mmc [ 0.000000] Kernel command line: console=ttymxc0,115200 calibrate= cma=64M root=/dev/mmcblk1p2 rootwait rw [ 3.082278] sdhci-esdhc-imx 2190000.usdhc: No vqmmc regulator found [ 3.135344] mmc0: SDHCI controller on 2190000.usdhc [2190000.usdhc] using ADMA [ 3.156792] sdhci-esdhc-imx 2194000.usdhc: No vmmc regulator found [ 3.161708] sdhci-esdhc-imx 2194000.usdhc: No vqmmc regulator found [ 3.213904] mmc1: SDHCI controller on 2194000.usdhc [2194000.usdhc] using ADMA [ 3.318388] mmc1: MAN_BKOPS_EN bit is not set [ 3.351543] mmc1: new DDR MMC card at address 0001 [ 3.356257] mmcblk1: mmc1:0001 88A398 7.28 GiB [ 3.359897] mmcblk1boot0: mmc1:0001 88A398 partition 1 4.00 MiB [ 3.365047] mmcblk1boot1: mmc1:0001 88A398 partition 2 4.00 MiB [ 3.370035] mmcblk1rpmb: mmc1:0001 88A398 partition 3 4.00 MiB [ 3.376503] mmcblk1: p1 p2 [ 3.838887] EXT3-fs (mmcblk1p2): using internal journal [ 3.843337] EXT3-fs (mmcblk1p2): recovery complete [ 3.846845] EXT3-fs (mmcblk1p2): mounted filesystem with ordered data mode [ 8.107465] FAT-fs (mmcblk1p1): utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive! [ 8.190005] FAT-fs (mmcblk1p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck. root@fl-imx6ull:~# dd if=/dev/zero of=/test bs=1M count=500 conv=fsync 500+0 records in 500+0 records out 524288000 bytes (524 MB, 500 MiB) copied, 13.081 s, 40.1 MB/s root@fl-imx6ull:~# dd if=/test of=/dev/zero bs=1M count=500 500+0 records in 500+0 records out 524288000 bytes (524 MB, 500 MiB) copied, 9.9576 s, 52.7 MB/s root@fl-imx6ull:~#
//------eMMC測(cè)試:
eMMC測(cè)試
4.2 TF卡測(cè)試
將 TF 卡插入開(kāi)發(fā)板底板上的 TF 卡插槽,正常情況下開(kāi)發(fā)板終端默認(rèn)無(wú)打印信息使用 dmesg 命令可以看到信息。
//------TF卡第一分區(qū)為FAT32格式 |---mmcblk1p1:FAT32 |---mmcblk1p2:EXT4 //------WR寫入測(cè)試:10.3MB/S dd if=/dev/zero of=/mnt/sd_0/largefile bs=1M count=512 conv=fsync //------RD讀取測(cè)試:22.2MB/S dd if=/mnt/sd_0/largefile of=/dev/zero bs=1M count=512
4.3 U盤測(cè)試
將U盤插入任意一個(gè)USB2.0接口,系統(tǒng)自動(dòng)掛載 /run/media/ 目錄。
//------USB2.0接口插入U(xiǎn)SB3.0的U盤 //------WR寫入測(cè)試:25.4MB/S dd if=/dev/zero of=/run/media/sda2/test bs=1M count=500 conv=fsync oflag=direct //------RD讀取測(cè)試: 33.2MB/S dd if=/run/media/sda2/test of=/dev/zero bs=1M count=512
5. USB攝像頭
飛凌OKMX6ULL-C開(kāi)發(fā)平臺(tái)并未預(yù)留MIPI-CSI攝像頭接口,不過(guò)它支持常見(jiàn)的USB攝像頭(UVC)。
//------UVC / USB-Camera UVC通俗的講就是USB攝像頭,全稱為USB Video Class,即:USB視頻類,是一種為USB視頻捕獲設(shè)備定義的協(xié)議標(biāo)準(zhǔn)。
5.1 攝像頭接口設(shè)備
攝像頭設(shè)備位于” /dev/video*“。一般情況下, /dev/video0為USB攝像頭。
//------查看攝像頭設(shè)備節(jié)點(diǎn) a.通過(guò)設(shè)備列表查看 ls -la /dev/video* b.通過(guò)v4l2-ctl工具查看 v4l2-ctl --list-devices //------Log信息 root@fl-imx6ull:~# ls -la /dev/video* crw-rw---- 1 root video 81, 0 Dec 16 10:34 /dev/video0 crw-rw---- 1 root video 81, 1 Dec 16 11:56 /dev/video1 root@fl-imx6ull:~# ls /dev/video* /dev/video0 /dev/video1 root@fl-imx6ull:~# v4l2-ctl --list-devices pxp (pxp_v4l2): /dev/video0 HD 720P webcam (usb-ci_hdrc.1-1.2): /dev/video1 root@fl-imx6ull:~#
5.2 USB攝像頭拍照測(cè)試
將USB攝像頭插入開(kāi)發(fā)板,將自動(dòng)安裝 uvc 添加設(shè)備節(jié)點(diǎn)。
//------USB-Camera(某寶幾十塊買的USB攝像頭) a.確認(rèn)USB攝像頭的設(shè)備節(jié)點(diǎn),此處為/dev/video1。 v4l2-ctl --list-devices b.查看攝像頭支持的格式與分辨率(此處打印信息較多) v4l2-ctl --list-formats-ext -d /dev/video1 c..攝像頭預(yù)覽(拍照) gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=3 ! jpegenc ! filesink location=~/pic_of_video1.jpg (由于沒(méi)有顯示屏,只能將照片拷貝到U盤后在電腦查看……) e.USB-Camera設(shè)備信息(查看硬件變動(dòng)信息即可) dmesg | tail -11 //------示例Log信息: root@fl-imx6ull:~# v4l2-ctl --list-devices pxp (pxp_v4l2): /dev/video0 HD 720P webcam (usb-ci_hdrc.1-1.2): /dev/video1 root@fl-imx6ull:~# gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=3 ! jpegenc ! filesink location=~/pic_of_video1.jpg Setting pipeline to PAUSED ... uvcvideo: Failed to query (GET_DEF) UVC control 1 on unit 2: -110 (exp. 2). Pipeline is live and does not need PREROLL ... Setting pipeline to PLAYING ... New clock: GstSystemClock Got EOS from element "pipeline0". Execution ended after 0:00:04.654356001 Setting pipeline to PAUSED ... Setting pipeline to READY ... Setting pipeline to NULL ... Freeing pipeline ... root@fl-imx6ull:~# lsusb Bus 001 Device 003: ID 0bda:d723 Bus 001 Device 004: ID 1bcf:2701 Bus 001 Device 002: ID 1a40:0101 Bus 001 Device 001: ID 1d6b:0002 root@fl-imx6ull:~# root@fl-imx6ull:~# dmesg | tail -11 [ 4953.560706] uvcvideo: Found UVC 1.00 device HD 720P webcam (1bcf:2701) [ 4953.590650] input: HD 720P webcam as /devices/platform/soc/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.2/1-1.2:1.0/input/input3 [ 4953.792335] usb 1-1.2: 3:1: cannot get freq at ep 0x86 [ 4953.851710] usb 1-1.2: 3:2: cannot get freq at ep 0x86 [ 4953.912622] usb 1-1.2: 3:3: cannot get freq at ep 0x86 [ 4953.973263] usb 1-1.2: 3:4: cannot get freq at ep 0x86 [ 4954.017584] usb 1-1.2: Warning! Unlikely big volume range (=4096), cval->res is probably wrong. [ 4954.025174] usb 1-1.2: [7] FU [Mic Capture Volume] ch = 1, val = 0/4096/1 [ 4954.046983] usbcore: registered new interface driver snd-usb-audio [ 5144.468020] uvcvideo: Failed to query (GET_DEF) UVC control 6 on unit 2: -32 (exp. 2). [ 5144.476376] uvcvideo: Failed to query (GET_DEF) UVC control 6 on unit 2: -32 (exp. 2). root@fl-imx6ull:~#
5.3 USB攝像頭視頻測(cè)試
USB攝像頭視頻測(cè)試。
//------USB攝像頭視頻測(cè)試 攝像頭預(yù)覽(視頻) gst-launch-1.0 v4l2src device=/dev/video1 io-mode=2 ! 'video/x-raw, format=YUY2, width=640, height=480, framerate=30/1' ! waylandsink window-x=0 window-y=0 window-width=1024 window-height=600 或者 ffplay -f video4linux2 -framerate 30 -video_size hd720 /dev/video1
6. 音頻測(cè)試
飛凌OKMX6ULL-C開(kāi)發(fā)平臺(tái)在硬件上采用WM8960音頻芯片,軟件上使用主流音頻框架ALSA(Advanced Linux Sound Arhitechture),為應(yīng)用層提供了alsa-lib,應(yīng)用程序調(diào)用系統(tǒng)提供的API就可以完成對(duì)底層的操作。用戶可以使用文件系統(tǒng)自帶的ALSA進(jìn)行音頻錄制、播放和配置。
飛凌OKMX6ULL-C開(kāi)發(fā)平臺(tái)提供了一個(gè)3.5mm音頻插座,支持左右聲道播放和MIC錄音。
此處各測(cè)試項(xiàng)的詳細(xì)內(nèi)容參考Log日志記錄。
6.1 聲卡檢測(cè)
聲卡檢測(cè)通過(guò)“aplay -l”或者“aplay -L”可以查看。通過(guò)Log信息可以看到只有一個(gè)聲卡:card-0。
功能:card-0用于處理多媒體、系統(tǒng)和伴流等音頻流。
至于系統(tǒng)中聲卡的具體原理還沒(méi)有深入研究,應(yīng)該和設(shè)備樹(shù)、驅(qū)動(dòng)相關(guān),汗……
//------聲卡檢測(cè) aplay -l 或者 aplay -L //------Log信息 root@fl-imx6ull:~# aplay -l **** List of PLAYBACK Hardware Devices **** card 0: wm8960audio [wm8960-audio], device 0: HiFi wm8960-hifi-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 0: wm8960audio [wm8960-audio], device 1: HiFi-ASRC-FE (*) [] Subdevices: 1/1 Subdevice #0: subdevice #0 root@fl-imx6ull:~# aplay -L null Discard all samples (playback) or generate zero samples (capture) pulse PulseAudio Sound Server sysdefault:CARD=wm8960audio wm8960-audio, Default Audio Device root@fl-imx6ull:~#
6.2 音頻參數(shù)設(shè)置
音頻參數(shù)主要包括音量、聲道等內(nèi)容。
//------音頻參數(shù)配置 //---3.5mm耳機(jī)音量 amixer sset Headphone 110,110 amixer cset name='Playback Volume' 255,255 amixer cset name='Capture Volume' 0,31 amixer sset name='Left Output Mixer PCM' on amixer sset name='Right Output Mixer PCM' on amixer cset name='Capture Volume' 63,63 //---配置播放音量 amixer sset Headphone 110,110 amixer cset name='ADC PCM Capture Volume' 220,220 amixer cset name='Left Input Boost Mixer LINPUT2 Volume' 7 amixer cset name='Left Input Boost Mixer LINPUT3 Volume' 7 amixer cset name='Right Input Boost Mixer LINPUT1 Volume' 7 amixer cset name='Right Input Boost Mixer LINPUT2 Volume' 7
6.3 播放與錄音測(cè)試
音頻播放使用aplay指令(詳細(xì)指令參考“ aplay -h ”),錄音使用arecord指令(詳細(xì)指令參考“ arecord -h ”)。
//------播放與錄音測(cè)試 //---播放測(cè)試 aplay ~/test.wav //---錄音測(cè)試 arecord -r 44100 -f S16_LE -c 2 -d 10 record.wav 說(shuō)明:-r 采樣頻率;-f 聲音效果模式;-c 通道設(shè)置;-d 設(shè)置錄音時(shí)間(單位秒);record.wav 文件名。 //------Log信息 root@fl-imx6ull:~# aplay ~/test.wav Playing WAVE '/home/root/test.wav' : Signed 16 bit Little Endian, Rate 22050 Hz, Stereo root@fl-imx6ull:~# arecord -r 44100 -f S16_LE -c 2 -d 10 record.wav Recording WAVE 'record.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo root@fl-imx6ull:~#
7. 網(wǎng)絡(luò)丟包測(cè)試
飛凌OKMX6ULL-C開(kāi)發(fā)平臺(tái)包括兩個(gè)100M有線網(wǎng)口eth0和eth1,可以使用iperf3工具進(jìn)行丟包測(cè)試。
7.1 分配IP地址
測(cè)試前需要給兩個(gè)網(wǎng)口配置ip地址。
//------配置IP地址 ifconfig eth0 192.168.1.100 ifconfig eth1 192.168.1.101 //------Log信息 root@fl-imx6ull:~# ifconfig eth0 Link encap:Ethernet HWaddr 26:54:f3:65:34:f0 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) eth1 Link encap:Ethernet HWaddr ea:27:54:f3:65:34 UP BROADCAST MULTICAST DYNAMIC MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:2 errors:0 dropped:0 overruns:0 frame:0 TX packets:2 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:140 (140.0 B) TX bytes:140 (140.0 B) root@fl-imx6ull:~# ifconfig eth0 192.168.1.100 root@fl-imx6ull:~# ifconfig eth1 192.168.1.101 root@fl-imx6ull:~# ifconfig eth0 Link encap:Ethernet HWaddr 26:54:f3:65:34:f0 inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) eth1 Link encap:Ethernet HWaddr ea:27:54:f3:65:34 inet addr:192.168.1.101 Bcast:192.168.1.255 Mask:255.255.255.0 UP BROADCAST MULTICAST DYNAMIC MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:2 errors:0 dropped:0 overruns:0 frame:0 TX packets:2 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:140 (140.0 B) TX bytes:140 (140.0 B) root@fl-imx6ull:~# fec 20b4000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready fec 2188000.ethernet eth1: Link is Up - 100Mbps/Full - flow control rx/tx IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready root@fl-imx6ull:~#
7.2 UDP模式丟包測(cè)試
UDP模式丟包測(cè)試。
//------UDP模式丟包測(cè)試 #服務(wù)器端執(zhí)行命令 iperf3 -u -s #客戶端執(zhí)行命令 iperf3 -u -c 192.168.1.100(服務(wù)端IP) -b 100M -t 60 //在udp模式下,以100Mbps為數(shù)據(jù)發(fā)送速率,客戶端到服務(wù)器192.168.1.100上傳帶寬測(cè)試,測(cè)試時(shí)間為60秒。 iperf3 -u -c 192.168.1.100 -b 5M -P 30 -t 60 //客戶端同時(shí)向服務(wù)器端發(fā)起30個(gè)連接線程,以5Mbps為數(shù)據(jù)發(fā)送速率。 iperf3 -u -c 192.168.1.100 -b 100M -d -t 60 //以100M為數(shù)據(jù)發(fā)送速率,進(jìn)行上下行帶寬測(cè)試。
7.3 TCP模式
TCP模式丟包測(cè)試。
//------TCP模式丟包測(cè)試 #服務(wù)器端執(zhí)行命令 iperf3 -s #客戶端執(zhí)行命令 iperf3 -c 192.168.1.100(服務(wù)端IP) -t 60 //在tcp模式下,客戶端到服務(wù)器192.168.20.249. 上傳帶寬測(cè)試,測(cè)試時(shí)間為60秒。 iperf3 -c 192.168.1.100 -P 30 -t 60 //客戶端同時(shí)向服務(wù)器端發(fā)起30個(gè)連接線程。 iperf3 -c 192.168.1.100 -d -t 60 //進(jìn)行上下行帶寬測(cè)試。
測(cè)試完一輪將服務(wù)端和客戶端對(duì)換,再測(cè)一遍。
測(cè)試結(jié)束后使用ifconfig命令查看是否丟包,RX errors和TX errors 所在行各項(xiàng)數(shù)值全為零才是正常。
//------END
審核編輯 黃宇
-
TCP
+關(guān)注
關(guān)注
8文章
1347瀏覽量
78933 -
開(kāi)發(fā)板
+關(guān)注
關(guān)注
25文章
4896瀏覽量
97058 -
開(kāi)發(fā)平臺(tái)
+關(guān)注
關(guān)注
0文章
91瀏覽量
14251
發(fā)布評(píng)論請(qǐng)先 登錄
相關(guān)推薦
評(píng)論