MYZR-IMX6-EK140P Linux-4.1.15 测试手册

来自明远智睿的wiki
Admin讨论 | 贡献2018年10月8日 (一) 17:24的版本

跳转至: 导航搜索


测试环境

  • 开发板型号:MYIMX6140P-6Y-512M-4G
  • 内核版本:Linux-4.1.15
  • 文件系统:L4115-core-image-base-myimx6a7.tar.bz2


网口测试

ETH0 测试
  • 关闭 ETH1
# ifconfig eth1 down  
  • 配置 ETH0
# ifconfig eth0 192.168.137.81  
  • 使用 ping 进行测试
# ping 192.168.137.99 -c 2 -w 4  
  
PING 192.168.137.99 (192.168.137.99): 56 data bytes  
64 bytes from 192.168.137.99: seq=0 ttl=128 time=0.838 ms  
64 bytes from 192.168.137.99: seq=1 ttl=128 time=0.449 ms  
  
--- 192.168.137.99 ping statistics ---  
2 packets transmitted, 2 packets received, 0% packet loss  
round-trip min/avg/max = 0.449/0.643/0.838 ms  
ETH1 测试
  • 关闭 ETH0
# ifconfig eth0 down  
  • 配置 ETH0
# ifconfig eth1 192.168.137.82  
  • 使用 ping 进行测试
# ping 192.168.137.99 -c 2 -w 4  
  
PING 192.168.137.99 (192.168.137.99): 56 data bytes  
64 bytes from 192.168.137.99: seq=0 ttl=128 time=0.999 ms  
64 bytes from 192.168.137.99: seq=1 ttl=128 time=0.503 ms  
  
--- 192.168.137.99 ping statistics ---  
2 packets transmitted, 2 packets received, 0% packet loss  
round-trip min/avg/max = 0.503/0.751/0.999 ms  

USB 测试

  • 插入U盘
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  
  • 拔出U盘
usb 1-1.4: USB disconnect, device number 4  

TF卡测试

  • 查看内核输入的信息
# dmesg | grep mmc0  
  
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  
  • 查看系统的TF卡设备
# ls /dev/mmcblk0*  
  
/dev/mmcblk0    /dev/mmcblk0p1  /dev/mmcblk0p2  

标准 GPIO 测试

  • 配置 P21:36 为输出
# 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 为输入
# OUT_IO_IN_NUM=3  
# echo ${OUT_IO_IN_NUM} > /sys/class/gpio/export  
# echo "in" > /sys/class/gpio/gpio${OUT_IO_IN_NUM}/direction  
  • 短接 P21: 35,36
  • 配置 P21:36 输出高电平并通过 P21:35 读取输入电平状态
# echo 1 > /sys/class/gpio/gpio${OUT_IO_OUT_NUM}/value  
# cat /sys/class/gpio/gpio${OUT_IO_IN_NUM}/value  
  • 配置 P21:36 输出低电平并通过 P21:35 读取输入电平状态
# echo 0 > /sys/class/gpio/gpio${OUT_IO_OUT_NUM}/value  
# cat /sys/class/gpio/gpio${OUT_IO_IN_NUM}/value  

GPIO-LED 测试

led-heartbeat
  • led-heartbeat 连接到 D11,系统启动后可以看到 D11 在有规律的闪烁。
led-timer
  • led-timer 连接到 D12,系统启动后可以看到 D12 在有规律的闪烁。
  • 更改灭的时间
# echo 1000 > /sys/class/leds/led-timer/delay_off  
  • 更改亮的时间
# echo 2000 > /sys/class/leds/led-timer/delay_on  
led-default
  • led-default 连接到 D8,系统启动后默认状态为常亮。
  • 使 D8 灭
echo 0 > /sys/class/leds/default/brightness  
  • 使 D8 常亮
echo 1 > /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
  • 测试指令
# /my-demo/linux-4.1.15/MY_SERIAL_TEST_L4115_MYIMX6A7.out /dev/ttymxc1 "www.myzr.com.cn"  
  
Welcome to TTYtest  
  
Send test data------www.myzr.com.cn  
read char is w   
read char is w   
read char is w   
read char is .   
read char is m   
read char is y   
read char is z   
read char is r   
read char is .   
read char is c   
read char is o   
read char is m   
read char is .   
read char is c   
read char is n   
Read Test Data finished,Read Test Data is-------www.myzr.com.cn  
UART3
  • 位置:P21: 25,26
  • 设备:/dev/ttymxc2
  • 测试指令
# /my-demo/linux-4.1.15/MY_SERIAL_TEST_L4115_MYIMX6A7.out /dev/ttymxc2 "www.myzr.com.cn"  
  
Welcome to TTYtest  
  
Send test data------www.myzr.com.cn  
read char is w   
read char is w   
read char is w   
read char is .   
read char is m   
read char is y   
read char is z   
read char is r   
read char is .   
read char is c   
read char is o   
read char is m   
read char is .   
read char is c   
read char is n   
Read Test Data finished,Read Test Data is-------www.myzr.com.cn  

CAN 测试

  • 测试准备
    将CAN1的CAN_L与CAN2的CAN_L连接;将CAN1的CAN_H与CAN2的CAN_H连接。
  • 配置 CAN1 (can0)
# ip link set can0 up type can bitrate 125000  
  • 配置 CAN2 (can1)
# ip link set can1 up type can bitrate 125000  
  • CAN1 (can0) 后台接收
# candump can0 &  
  • CAN2 (can1) 发送数据
# cansend can1 1F334455#1122334455667788  

SPI测试

ECSPI1 测试
  • 位置:P21: 3,4
  • 测试设备:/dev/spidev0.0
  • 测试指令
# /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)  
  
FF FF FF FF FF FF   
40 00 00 00 00 95   
FF FF FF FF FF FF   
FF FF FF FF FF FF   
FF FF FF FF FF FF   
DE AD BE EF BA AD   
F0 0D   
ECSPI2 测试
  • 位置:P21: 9,10
  • 测试设备:/dev/spidev1.0
  • 测试指令
# /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)  
  
FF FF FF FF FF FF   
40 00 00 00 00 95   
FF FF FF FF FF FF   
FF FF FF FF FF FF   
FF FF FF FF FF FF   
DE AD BE EF BA AD   
F0 0D  

Watchdog 测试

超时复位测试
# /unit_tests/wdt_driver_test.out 10 15 1  
  
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  
  
  
U-Boot 2016.03-svn246 (Sep 11 2018 - 16:45:21 +0800)  
  
CPU:   Freescale i.MX6ULL rev1.0 528 MHz (running at 396 MHz)  
CPU:   Industrial temperature grade (-40C to 105C) at 49C  
Reset cause: WDOG  
Board: MYIMX6EK140P-6Y  
喂狗测试
# /unit_tests/wdt_driver_test.out 4 2 1 &  
  
[1] 603  
root@myimx6ek140p:~# 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 测试

  • 查看当前系统时钟
# date  
  
Wed Sep 19 14:57:13 UTC 2018  
  • 查看当前RTC芯片时钟
# hwclock   
  
Wed Sep 19 14:58:36 2018  0.000000 seconds  
  • 设置系统时钟,并同步到RTC芯片
# date -s "2018-09-21 12:34:56"  
  
Fri Sep 21 12:34:56 UTC 2018  
  • 将系统时钟写入硬件时钟
# hwclock -w  
  • 断电重启评估板
  • 查看当前系统时钟
# date  
  
Fri Sep 21 12:36:11 UTC 2018  
  • 查看当前RTC芯片时钟
# hwclock  
  
Fri Sep 21 12:36:16 2018  0.000000 seconds  

定时唤醒测试

  • 设定 10 秒后产生唤醒事件
# echo +10 > /sys/class/rtc/rtc1/wakealarm 
  • 使设备进入
# echo mem > /sys/power/state
  • 睡眠信息
PM: Syncing filesystems ... done.
Freezing user space processes ... Freezing remaining freezable tasks ... (elapsed 0.003 seconds) done.
Suspending console(s) (use no_console_suspend to debug)
  • 唤醒信息
(elapsed 0.012 seconds) done.
PM: suspend of devices complete after 693.963 msecs
PM: suspend devices took 0.700 seconds
PM: late suspend of devices complete after 2.419 msecs
PM: noirq suspend of devices complete after 2.303 msecs
Disabling non-boot CPUs ...
PM: noirq resume of devices complete after 1.402 msecs
PM: early resume of devices complete after 1.476 msecs
PM: resume of devices complete after 121.763 msecs
PM: resume devices took 0.130 seconds
Restarting tasks ... done.

音频测试

播放音频
# aplay /unit_tests/audio8k16S.wav   
  
Playing WAVE '/unit_tests/audio8k16S.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Stereo  
音频录音
  • 录音
# arecord -d 5 -f S16_LE -t wav foobar.wav  
  • 播放录音
# aplay foobar.wav  

4G模块EC20(选配)测试

# /my-demo/linux-4.1.15/MY_EC20_QuectelCM_L4115_MYIMX6A7.out &

[1] 636
[10-01_14:02:10:616] WCDMA&LTE_QConnectManager_Linux&Android_V1.1.34
[10-01_14:02:10:617] /my-demo/linux-4.1.15/MY_EC20_QuectelCM_L4115_MYIMX6A7.out profile[1] = (null)/(null)/(null)/0, pincode = (null)
[10-01_14:02:10:619] Find /sys/bus/usb/devices/1-1.2 idVendor=2c7c idProduct=0125
[10-01_14:02:10:620] Find /sys/bus/usb/devices/1-1.2:1.4/net/eth2
[10-01_14:02:10:620] Find usbnet_adapter = eth2
[10-01_14:02:10:620] Find /sys/bus/usb/devices/1-1.2:1.4/GobiQMI/qcqmi2
[10-01_14:02:10:620] Find qmichannel = /dev/qcqmi2
[10-01_14:02:10:665] Get clientWDS = 7
[10-01_14:02:10:697] Get clientDMS = 8
[10-01_14:02:10:729] Get clientNAS = 9
[10-01_14:02:10:760] Get clientUIM = 10
[10-01_14:02:10:792] Get clientWDA = 11
[10-01_14:02:10:825] requestBaseBandVersion EC20CEFAR02A10M4G
[10-01_14:02:10:920] requestGetSIMStatus SIMStatus: SIM_READY
[10-01_14:02:10:953] requestGetProfile[1] cmnet///0
[10-01_14:02:10:985] requestRegistrationState2 MCC: 460, MNC: 0, PS: Attached, DataCap: LTE
[10-01_14:02:11:017] requestQueryDataCall IPv4ConnectionStatus: DISCONNECTED
[10-01_14:02:11:081] requestRegistrationState2 MCC: 460, MNC: 0, PS: Attached, DataCap: LTE
[10-01_14:02:11:144] requestSetupDataCall WdsConnectionIPv4Handle: 0x87779840
[10-01_14:02:11:241] requestQueryDataCall IPv4ConnectionStatus: CONNECTED
[10-01_14:02:11:274] ifconfig eth2 up
[10-01_14:02:11:305] busybox udhcpc -f -n -q -t 5 -i eth2
[10-01_14:02:11:321] udhcpc (v1.24.1) started
[10-01_14:02:11:433] Sending discover...
[10-01_14:02:11:493] Sending select for 10.127.206.63...
[10-01_14:02:11:552] Lease of 10.127.206.63 obtained, lease time 7200
[10-01_14:02:11:637] /etc/udhcpc.d/50default: Adding DNS 211.136.17.107
[10-01_14:02:11:638] /etc/udhcpc.d/50default: Adding DNS 211.136.20.203

显示屏(选配)测试

在系统启动过程中,可以看到 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  

FXAS2100(选配)测试

  • 测试
# evtest  



--------------------------------------------------------------------------------  
* Looking forward to communicating with you for more functions and field applications.  
* 珠海明远智睿科技有限公司    
* ZhuHai MYZR Technology CO.,LTD.  
* Latest Update: 2018/10/08    
--------------------------------------------------------------------------------