MYZR-IMX6-EK140P Linux-4.1.15 测试手册
来自明远智睿的wiki
目录
测试环境
- 开发板型号: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:P21:33,34,23;对应的 Number 为:2,1,110
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/uart_test.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/uart_test.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/spidev_test.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/spidev_test.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
音频测试
播放音频
# 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
显示屏(选配)测试
在系统启动过程中,可以看到 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/09/26 --------------------------------------------------------------------------------