MYZR-IMX6-EK140P Linux-4.1.15 测试手册
目录
测试环境
- 开发板型号:MY-IMX6-EK140P-6Y-512M-4G
- 内核版本:Linux-4.1.15
- 文件系统:L4115-fsl-image-gui-myimx6a7.tar.bz2
测试前的准备
1)请按照《MY-IMX6-EK140P 启动手册》中的“Linux快速启动” -> “连接设备”进行连接。
2)请按照《MY-IMX6-EK140P 启动手册》中的“Linux快速启动” -> “启动设备”进行启动。
测试项目
网口测试
MY-IMX6-EK140P 支持两个百兆网口。
接口属性
Eth0 接口位置:P10
Eth1 接口位置:P8
测试方法
1)配置计算机IP
设置计算机有线网卡IP为 192.168.137.99
2)Eth0 连接测试
连接网线:将评估板“Eth0”对应的接口与计算机有线网卡的接口用网线相连接。
注意:检查跳线帽,保证是接上状态
- 设置评估板IP:
# ifconfig eth0 192.168.137.81
- 执行测试命令:
# ifconfig eth1 down # ping 192.168.137.99 -c 2 -w 4
- 观察测试结果,系统会输出类似如下信息:
PING 192.168.137.99 (192.168.137.99) 56(84) bytes of data. 64 bytes from 192.168.137.99: icmp_seq=1 ttl=64 time=0.685 ms 64 bytes from 192.168.137.99: icmp_seq=2 ttl=64 time=0.374 ms --- 192.168.137.99 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 999ms rtt min/avg/max/mdev = 0.374/0.529/0.685/0.157 ms
- 测试结果:“0% packet loss”表示测试通过。
3)Eth1 连接测试
连接网线:将评估板“Eth1”对应的接口与计算机有线网卡的接口用网线相连接。
注意:检查跳线帽,保证是接上状态
- 设置第2个网口IP:
# ifconfig eth1 192.168.137.82
- 设置后系统会输出第2个网口的工作状态信息:
fec 20b4000.ethernet eth1: Freescale FEC PHY driver [Generic PHY] (mii_bus:phy_addr=20b4000.ethernet:01, irq=-1) IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready fec 20b4000.ethernet eth1: Link is Up - 100Mbps/Full - flow control rx/tx IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
- 执行测试命令:
# ifconfig eth0 down # ping 192.168.137.99 -c 2 -w 4
- 观察测试结果,系统会输出类似如下信息:
PING 192.168.137.99 (192.168.137.99) 56(84) bytes of data. 64 bytes from 192.168.137.99: icmp_seq=1 ttl=64 time=0.705 ms 64 bytes from 192.168.137.99: icmp_seq=2 ttl=64 time=0.386 ms --- 192.168.137.99 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 999ms rtt min/avg/max/mdev = 0.386/0.545/0.705/0.161 ms
- 测试结果:“0% packet loss”表示测试通过。
USB 测试
接口属性
接口位置:P20
测试方法
1)开始测试 将USB设备插入底板USB接口,系统会输出类似如下信息:
usb 1-1.4: new high-speed USB device number 4 using ci_hdrc usb-storage 1-1.4:1.0: USB Mass Storage device detected scsi host0: usb-storage 1-1.4:1.0 scsi 0:0:0:0: Direct-Access Mass Storage Device 1.00 PQ: 0 ANSI: 0 CCS sd 0:0:0:0: [sda] 7716864 512-byte logical blocks: (3.95 GB/3.67 GiB) sd 0:0:0:0: [sda] Write Protect is off sd 0:0:0:0: [sda] No Caching mode page found sd 0:0:0:0: [sda] Assuming drive cache: write through sda: sda1 sda2 sd 0:0:0:0: [sda] Attached SCSI removable disk
2)结束测试 将USB设备从底板拔出,系统会输出类似如下信息:
usb 1-1.4: USB disconnect, device number 4
TF卡测试
接口属性
接口位置:P13
接口类型:MicroSD
测试方法
1)开始测试
开发板断电,往TF卡安装好TF卡。
输入如下命令:
# dmesg | grep mmc0
系统输出类似以下信息,即表示 TF 接口正常:
mmc0: SDHCI controller on 2190000.usdhc [2190000.usdhc] using ADMA mmc0: host does not support reading read-only switch, assuming write-enable mmc0: new high speed SDHC card at address 1234 mmcblk0: mmc0:1234 SA04G 3.67 GiB
2)查看系统的TF卡设备
输入如下命令:
# ls /dev/mmcblk0*
系统会输出类似以下信息:
/dev/mmcblk0 /dev/mmcblk0p1 /dev/mmcblk0p2
标准 GPIO 测试
接口属性
接口位置:P21
1)GPIO输出测试
标准GPIO的测试以P21:35和P21:36为例,其它GPIO测试可参照此测试方法。
- 配置 P21:35 为输出低电平
输入如下命令:
# OUT_IO_OUT_NUM=4 # echo ${OUT_IO_OUT_NUM} > /sys/class/gpio/export # echo "out" > /sys/class/gpio/gpio${OUT_IO_OUT_NUM}/direction # echo 0 > /sys/class/gpio/gpio${OUT_IO_OUT_NUM}/value
注意:配置 P21:35 输出低电平并通过万用表测量,如果管脚P21:35电压为0V,则配置OK
- 配置 P21:36 为输出高电平
输入如下命令:
# OUT_IO_OUT_NUM=3 # echo ${OUT_IO_OUT_NUM} > /sys/class/gpio/export # echo "out" > /sys/class/gpio/gpio${OUT_IO_OUT_NUM}/direction # echo 1 > /sys/class/gpio/gpio${OUT_IO_OUT_NUM}/value
注意:配置 P21:36 输出高电平并通过万用表测量,如果管脚P21:36电压为3.3V,则配置OK
2)控制输出电平
输入如下命令:
# echo 0 > /sys/class/gpio/gpio${OUT_IO_OUT_NUM}/value # echo 1 > /sys/class/gpio/gpio${OUT_IO_OUT_NUM}/value
可以实现控制输出电平。
- 其它可用GPIO:P21:33,34,23;对应的 IO序号Number 为:2,1,110
GPIO-LED 测试
led-heartbeat
- led-heartbeat 连接到指示灯 D12,系统启动后可以看到 D12 在有规律的闪烁。
led-timer
- led-timer 连接到指示灯 D8,系统启动后可以看到 D8 在有规律的闪烁。
- 控制高低电平持续的时间
1)更改灭的时间
# echo 1000 > /sys/class/leds/led-timer/delay_off
2)更改亮的时间
# echo 2000 > /sys/class/leds/led-timer/delay_on
led-default
- led-default 连接到 D11,系统启动后默认状态为常亮。
1)使 D11 常亮
Default-on可以通过brightness控制 ,Default-on的实现是初始触发状态为on,即初始触发后为高电平。
输入如下命令:
# echo 1 > /sys/class/leds/default/brightness
2)使 D11 灭
往brightness写0即可检测到低电平。
输入如下命令:
# echo 0 > /sys/class/leds/default/brightness
PWM 测试
PWM-LED
输入如下命令:
# PWM_DEV=pwmchip4 # echo 0 > /sys/class/pwm/$PWM_DEV/export # echo 1000000000 > /sys/class/pwm/$PWM_DEV/pwm0/period # echo 100000000 > /sys/class/pwm/$PWM_DEV/pwm0/duty_cycle # echo 1 > /sys/class/pwm/$PWM_DEV/pwm0/enable
- 说明:可以看到 LED(D7) 在 1 秒(1000000000 纳秒)内闪烁一次(高电平持续时间为 100000000 纳秒 = 0.1 秒)。
PWM-Buzzer
输入如下命令:
# PWM_DEV=pwmchip1 # echo 0 > /sys/class/pwm/$PWM_DEV/export # echo 1000000000 > /sys/class/pwm/$PWM_DEV/pwm0/period # echo 100000000 > /sys/class/pwm/$PWM_DEV/pwm0/duty_cycle # echo 1 > /sys/class/pwm/$PWM_DEV/pwm0/enable
- 说明:可以听到蜂鸣器在 1 秒(1000000000 纳秒)内响一次(高电平持续时间为 100000000 纳秒 = 0.1 秒)。
串口测试
测试说明:采用串口自发自收测试。
UART2
接口属性
- 位置:P21:27,28
- 设备:/dev/ttymxc1
1)测试准备
短接串口2的发送发接收管脚(P21的27和28号管脚)
2)进行测试
输入如下命令:
# /my-demo/linux-4.1.15/MY_SERIAL_TEST_L4115_MYIMX6A7.out /dev/ttymxc1 "www.myzr.com.cn"
系统会输出类似以下信息:
Starting send data...finish Starting receive data: ASCII: 0x77 Character: w ASCII: 0x77 Character: w ASCII: 0x77 Character: w ASCII: 0x2e Character: . ASCII: 0x6d Character: m ASCII: 0x79 Character: y ASCII: 0x7a Character: z ASCII: 0x72 Character: r ASCII: 0x2e Character: . ASCII: 0x63 Character: c ASCII: 0x6f Character: o ASCII: 0x6d Character: m ASCII: 0x2e Character: . ASCII: 0x63 Character: c ASCII: 0x6e Character: n ASCII: 0x0 Character:
UART3
接口属性
- 位置:P21: 25,26
- 设备:/dev/ttymxc2
1)测试准备
短接串口3的发送发接收管脚(P21的25和26号管脚)
2)进行测试
输入如下命令:
# /my-demo/linux-4.1.15/MY_SERIAL_TEST_L4115_MYIMX6A7.out /dev/ttymxc2 "www.myzr.com.cn"
系统会输出类似以下信息:
Starting send data...finish Starting receive data: ASCII: 0x77 Character: w ASCII: 0x77 Character: w ASCII: 0x77 Character: w ASCII: 0x2e Character: . ASCII: 0x6d Character: m ASCII: 0x79 Character: y ASCII: 0x7a Character: z ASCII: 0x72 Character: r ASCII: 0x2e Character: . ASCII: 0x63 Character: c ASCII: 0x6f Character: o ASCII: 0x6d Character: m ASCII: 0x2e Character: . ASCII: 0x63 Character: c ASCII: 0x6e Character: n ASCII: 0x0 Character:
CAN 测试
测试说明;MY-IMX6-EK140P有两组CAN接口,采用CAN1发送,CAN0接收的方式。
接口属性
位置:CAN1 P7:1,2
位置:CAN2 P9:1,2
1)测试准备
将CAN1的CAN_L(P7:1)与CAN2的CAN_L (P9:1)连接;将CAN1的CAN_H (P7:2)与CAN2的CAN_H (P9:2)连接。
2)输入测试指令
- 配置 CAN1 (can0)
# ip link set can0 up type can bitrate 125000
系统会输出类似如下信息:
flexcan 2090000.can can0: writing ctrl=0x0e312005 IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready
- 配置 CAN2 (can1)
# ip link set can1 up type can bitrate 125000
系统会输出类似如下信息:
flexcan 2094000.can can1: writing ctrl=0x0e312005 IPv6: ADDRCONF(NETDEV_CHANGE): can1: link becomes ready
- CAN1 (can0) 后台接收
# candump can0 &
系统会输出类似如下信息:
[1] 589
- CAN2 (can1) 发送数据
# cansend can1 1F334455#1122334455667788
系统会输出类似如下信息:
can0 1F334455 [8] 11 22 33 44 55 66 77 88
SPI测试
测试说明;评估板一共有2路SPI。
ECSPI1 测试
接口属性
- 位置:P21: 3,4
- 测试设备:/dev/spidev0.0
1)测试准备 短接P21的3和4管脚。
2)输入测试指令
# /my-demo/linux-4.1.15/MY_SPIDEV_TEST_L4115_MYIMX6A7.out -D /dev/spidev0.0
测试结果类似如下输出,则表示测试通过:
spi mode: 0 bits per word: 8 max speed: 500000 Hz (500 KHz) 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ECSPI2 测试
接口属性
- 位置:P21: 9,10
- 测试设备:/dev/spidev1.0
1)测试准备
短接P21的9和10管脚。
2)输入测试指令
# /my-demo/linux-4.1.15/MY_SPIDEV_TEST_L4115_MYIMX6A7.out -D /dev/spidev1.0
测试结果类似如下输出,则表示测试通过:
spi mode: 0 bits per word: 8 max speed: 500000 Hz (500 KHz) 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Watchdog 测试
测试说明:WatchDog测试包括2项:一项是复位测试,一项是喂狗测试。
超时复位测试
1)测试说明
复位测试将启动WatchDog,但是并不喂狗,超时后系统将会复位。
2)输入测试指令
# /unit_tests/wdt_driver_test.out 10 15 1
运行测试命令后等待10秒后,WatchDog超时,系统被复位。
将会在终端看到系统重新启动输出的信息类似如下:
Starting wdt_driver (timeout: 10, sleep: 15, test: write) Trying to set timeout value=10 seconds The actual timeout was set to 10 seconds Now reading back -- The timeout is 10 seconds random: nonblocking pool is initialized U-Boot 2016.03-svn270 (Oct 08 2018 - 16:52:53 +0800) CPU: Freescale i.MX6ULL rev1.0 528 MHz (running at 396 MHz) CPU: Industrial temperature grade (-40C to 105C) at 51C Reset cause: WDOG Board: MYIMX6EK140P-6Y
喂狗测试
1)测试说明
喂狗测试将启动WatchDog,并且每2秒钟进行1次喂狗,系统将会在超时时间(这里是4秒)内复位。
2)输入测试指令
# /unit_tests/wdt_driver_test.out 4 2 1 &
测试结果类似如下输出,则表示测试通过:
[1] 585 Starting wdt_driver (timeout: 4, sleep: 2, test: write) Trying to set timeout value=4 seconds The actual timeout was set to 4 seconds Now reading back -- The timeout is 4 seconds
RTC 测试
1)测试说明
断电重启设备,查看当前系统时间和硬件时间
- 查看当前系统时钟命令如下:
# date
系统输出信息如下:
Wed Sep 19 17:39:19 UTC 2018
2)查看当前RTC芯片时钟
命令如下:
# hwclock
系统输出信息如下:
Wed Sep 19 17:40:05 2018 0.000000 seconds
3)设置系统时钟,并同步到RTC芯片
命令如下:
# date -s "2018-09-21 12:34:56"
系统输出信息如下:
Fri Sep 21 12:34:56 UTC 2018
4)将系统时钟写入硬件时钟
# hwclock -w
5)断电重启评估板,查看当前系统时钟和硬件时钟
命令如下:
# date
系统输出信息如下:
Fri Sep 21 12:36:02 UTC 2018
6)查看当前RTC芯片时钟 命令如下:
# hwclock
系统输出信息如下:
Fri Sep 21 12:36:12 2018 0.000000 seconds
定时唤醒测试
1)设定 10 秒后产生唤醒事件
# echo +10 > /sys/class/rtc/rtc1/wakealarm
2)使设备进入
# echo mem > /sys/power/state
3)睡眠信息
PM: Syncing filesystems ... done. Freezing user space processes ... Freezing remaining freezable tasks ... (elapsed 0.006 seconds) done. Suspending console(s) (use no_console_suspend to debug)
4)唤醒信息
(elapsed 0.001 seconds) done. PM: suspend of devices complete after 708.601 msecs PM: suspend devices took 0.710 seconds PM: late suspend of devices complete after 2.543 msecs PM: noirq suspend of devices complete after 2.410 msecs Disabling non-boot CPUs ... PM: noirq resume of devices complete after 1.494 msecs PM: early resume of devices complete after 1.571 msecs PM: resume of devices complete after 223.182 msecs PM: resume devices took 0.230 seconds Restarting tasks ... done.
音频测试
播放音频
测试说明:这项测试是通过播放音频文件验证评估板的音频功能。
1)测试准备
2)执行测试命令
# aplay /unit_tests/audio8k16S.wav
3)执行上面的测试命令后会听到音频设备输出的声音。 系统会输出类似如下信息:
Playing WAVE '/unit_tests/audio8k16S.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Stereo
音频录音
1)测试准备
2)输入测试命令
- 录音
# arecord -d 5 -f S16_LE -t wav foobar.wav
- 播放录音
# aplay foobar.wav
3)执行上面的测试命令后会听到音频设备播放的录音。
4G模块EC20(选配)测试
接口位置:P19
测试说明:在断电下接入4G模块,接入天线并插入SIM卡后启动评估板
输入如下命令:
# /my-demo/linux-4.1.15/MY_EC20_QuectelCM_L4115_MYIMX6A7.out &
系统会输出类似如下信息:
[1] 607 [09-21_13:36:14:352] WCDMA<E_QConnectManager_Linux&Android_V1.1.34 [09-21_13:36:14:353] /my-demo/linux-4.1.15/MY_EC20_QuectelCM_L4115_MYIMX6A7.out profile[1] = (null)/(null)/(null)/0, pincode = (null) [09-21_13:36:14:356] Find /sys/bus/usb/devices/1-1.2 idVendor=2c7c idProduct=0125 [09-21_13:36:14:356] Find /sys/bus/usb/devices/1-1.2:1.4/net/eth2 [09-21_13:36:14:356] Find usbnet_adapter = eth2 [09-21_13:36:14:356] Find /sys/bus/usb/devices/1-1.2:1.4/GobiQMI/qcqmi2 [09-21_13:36:14:357] Find qmichannel = /dev/qcqmi2 [09-21_13:36:14:403] Get clientWDS = 7 [09-21_13:36:14:435] Get clientDMS = 8 [09-21_13:36:14:467] Get clientNAS = 9 [09-21_13:36:14:499] Get clientUIM = 10 [09-21_13:36:14:532] Get clientWDA = 11 [09-21_13:36:14:563] requestBaseBandVersion EC20CEFAR02A10M4G [09-21_13:36:14:659] requestGetSIMStatus SIMStatus: SIM_READY [09-21_13:36:14:692] requestGetProfile[1] cmnet///0 [09-21_13:36:14:724] requestRegistrationState2 MCC: 460, MNC: 0, PS: Attached, DataCap: LTE [09-21_13:36:14:755] requestQueryDataCall IPv4ConnectionStatus: DISCONNECTED [09-21_13:36:14:819] requestRegistrationState2 MCC: 460, MNC: 0, PS: Attached, DataCap: LTE [09-21_13:36:16:036] requestSetupDataCall WdsConnectionIPv4Handle: 0x87756f40 [09-21_13:36:16:132] requestQueryDataCall IPv4ConnectionStatus: CONNECTED [09-21_13:36:16:163] ifconfig eth2 up [09-21_13:36:16:193] busybox udhcpc -f -n -q -t 5 -i eth2 [09-21_13:36:16:211] udhcpc (v1.24.1) started [09-21_13:36:16:318] Sending discover... [09-21_13:36:16:378] Sending select for 10.151.159.101... [09-21_13:36:16:438] Lease of 10.151.159.101 obtained, lease time 7200 [09-21_13:36:16:522] /etc/udhcpc.d/50default: Adding DNS 221.179.38.7 [09-21_13:36:16:522] /etc/udhcpc.d/50default: Adding DNS 120.196.165.7
显示屏(选配)测试
在系统启动过程中,可以看到 Linux 小企鹅和 OpenEmbedded 启动画面。
FXLS8471(选配)测试
- 使传感器 Enable
# echo 1 > /sys/class/misc/FreescaleAccelerometer/enable
- 查看传感器数据
# cat /sys/class/misc/FreescaleAccelerometer/data
MAG3110(选配)测试
- 使传感器 Enalbe
# echo 1 > /sys/class/misc/FreescaleGyroscope/enable
- 测试
# evtest
系统会输出类似如下信息:
No device specified, trying to scan all of /dev/input/event* Available devices: /dev/input/event0: 20cc000.snvs:snvs-powerkey Select the device event number [0-0]:
FXAS2100(选配)测试
- 测试
# evtest
系统会输出类似如下信息:
No device specified, trying to scan all of /dev/input/event* Available devices: /dev/input/event0: 20cc000.snvs:snvs-powerkey Select the device event number [0-0]:
-------------------------------------------------------------------------------- * Looking forward to communicating with you for more functions and field applications. * 珠海明远智睿科技有限公司 * ZhuHai MYZR Technology CO.,LTD. * Latest Update: 2018/10/22 --------------------------------------------------------------------------------