MYZR-SAMA5 Linux-3.18 测试手册

来自明远智睿的wiki
Admin讨论 | 贡献2018年6月11日 (一) 16:07的版本

跳转至: 导航搜索

测试前的准备(preparation before test)


   1)请按照《Linux快速启动手册》中的“Linux快速启动” -> “连接设备”进行连接。

  please refer to "connection of device"->"Linux fast boot" in 《Linux fast boot manual》 for the connection。

   2)请按照《Linux快速启动手册》中的“Linux快速启动” -> “启动设备”进行启动。

  please refer to "booting device" ->"Linux fast boot" in 《Linux fast boot manual》 for the booting。

测试项目(test item)


网口测试(lan port test)

MY-SAMA5-EK200支持双网口(1个百兆网口,一个千兆网口)。
MY-SAMA5-EK200 support dual lan port(one Mbps ethernet lan port,one Gbps ethernet lan port)

测试说明(test instruction)

  • 第1个以太网口位置底板正面“J3”,第2个以太网口位置底板正面“J2”。

MY-SAMA5-EK200 support dual lan port(one Mbps ethernet lan port,one Gbps ethernet lan port)

测试方法(test method)

1) 测试第1个以太网口(百兆网口)
test the first ethernet lan port(Mbps ethernet lan port)

  • 连接网线:用网络连接评估板“J3”与计算机网口

connect lan line:connect “J3”on evaluation board with computer lan port through network

  • 设置计算机IP:设置计算机网口IP为192.168.18.18

set computer IP:set computer lan port IP as 192.168.18.18
MY-SAMA5 Linux-3.18 2.1.2.1.png

  • 设置评估板IP:

set IP of evaluation board
# ifconfig eth0 192.168.18.81 # configure the eth0
# ifconfig eth1 down

  • 执行测试命令:

execute test command
# ping 192.168.18.18 -c 2 -w 4 # send ICMP to HOST

  • 观察测试结果:系统会输出类似如下信息:

observe test result:system will output information like below:
--- 192.168.18.18 ping statistics ---

2packets transmitted, 2 packets received, 0% packet loss

  • 测试结果:“0% packet loss”表示测试通过

test result:“0% packet loss”represent test passing

  • 附图

figure
MY-SAMA5 Linux-3.18 2.1.2.2.png
2) 测试第2个以太网口(千兆网口)
test the second ethernet lan port

  • 连接网线:拔下第1个网口的网线接口插入到评估板“J2”,网线另一端保持与计算机网口相连。

connect lan line:take out lan line from the first lan port then plug in “J2”on evaluation board,another end of lan line is kept in connection with lan port of computer

  • 设置计算机IP:设置计算机网口IP为192.168.18.18(如已经设置过可执行下一步骤)。

set computer IP:set computer lan port IP as 192.168.18.18(if the setting was already done then go direclty into next step)

  • 设置第2个网口IP:

set the second lan port IP:
# ifconfig eth1 192.168.18.82 # configure the eth1
# ifconfig eth0 down
设置后系统会输出第2个网口的工作状态信息,类似如下:
after the setting system will output working condition of the second lan port, as below
macb f0028000.ethernet eth1: link up (1000/Full)

  • 执行测试命令:

run test command
# ping 192.168.18.18 -c 2 -w 4 # send ICMP to HOST

  • 观察测试结果:系统会输出类似如下信息:

observe test result:system will output the following message:
--- 192.168.18.18 ping statistics ---

2packets transmitted, 2 packets received, 0% packet loss


  • 测试结果:“0% packet loss”表示测试通过

test result:“0% packet loss”represent test passing

  • 附图

figures
MY-SAMA5 Linux-3.18 2.1.2.3.png

USB测试(USB test)

测试说明(test instruction)

MY-IMX6-EK200有2个USB HOST接口,位于底板正面“J8”。
MY-IMX6-EK200 has two USB HOST ports,in“J8”in top view of base board

测试方法(test method)

1) 开始测试
start test
将USB设备插入底板USB接口,系统会输出类似如下信息:
plug USB device in USB port in base board,system will output the following message:
usb *-*.*: new high-speed USB device number * using atmel-ehci
……

2) 测试结束
complete test
将USB设备从底板拔出,系统会输出类似如下信息:
take out USB device from the base board,system will output the following message:
usb *-*.*: USB disconnect, device number *

附图(figures)

MY-SAMA5 Linux-3.18 2.2.3.1.png
说明:在USB口上插拔U盘时,系统输出信息类似如下:
instruction:insert U disk in USB port, system will output information like below:

SD卡接口测试(SD card interface test)

测试说明(test instruction )

SD卡接口位于底板背面“J29”。
SD card interface is in“J29”in bottom view of base board。

开始测试(start test)

  1) 往SD卡槽插入设备
  insert device in SD card slot
  插入SD卡到底板SD卡接口。系统输出以下信息(见附图)即表示SD接口正常:
  insert SD card in SD card port in base board, system will output following message(see attached image),e.g.SD port is normal:
mmc*: new high speed SD card at address ****
……
  2)从SD卡槽弹出设备
  pop-up device from SD card slot
  再次住SD卡槽按下SD卡,底板会弹出SD卡。系统输出以下信息(见附图)表示SD卡接口弹出正常:
  press again SD card in SD card slot,base board will pop-up SD card。system will output following message(see attached image),e.g.function of SD card port pop-up is normal:
mmc*: card **** removed
  3) 结束测试
  complete test
SD卡弹出后拨出SD卡即结束测试。
take out SD card after SD card pop-up,to end the test。

附图(figures)

MY-SAMA5 Linux-3.18 2.3.3.1.png

LED(GPIO)测试(LED(GPIO)test)

LED(GPIO)定义(LED(GPIO)definition)

在MY-SAMA5-EK200底板正面有4个LED,详细如下:
there are 4 LEDs on the base board of MY-SAMA5-EK200,details as below:

丝印
(silkscreen)
CPU引脚
(CPU pin)
LED属性
(LED property)
用途
(application)
D12 PE1 default 内核启动后点亮
(brighten after booting of kernel)
D13 PE2 heartbeat CPU工作时闪烁
(flash when CPU is in working)
D14 PE3 gpio 用户控制输出
(user control output)
D15 PE4 timer Timer演示
(Timer demonstration)

led-default测试(led-default test)

led-default对应D12。系统启动完成后,该LED默认被点亮,通常可用作供电指示。就是说在用户没有控制该指示灯的情况下,亮表示设备通电(即电源工作正常)。当然,用户也可以控制该指示灯的亮灭,但这时候灯灭与电源是否工作不存在关联。
led-default corresponds with D12. when booting of system is completed,the LED is brightened defaulty,which is ususally ussed as power indicator,in other words,brightenness of the LED represent a switching on of devices on the condition that user doesn't control the LED.Of course,user can control on and off of the LED,in this case,there is not any relation between on/off of the LED and working condition of power source.
控制命令如下:
control command as below:
# echo 0 > /sys/class/leds/default/brightness
# echo 1 > /sys/class/leds/default/brightness
MY-SAMA5 Linux-3.18 2.4.2.1.png

led-heartbeat

led-heartbeat对应D13。系统启动后,该LED闪烁,该LED的状态可表示CPU的工作状态。闪烁表示CPU工作正常。常亮或常灭表示CPU工作不正常(即可能是CPU不工作了)。
led-heartbeat correspond with D13. after system is booted,the LED flash,so the condition of the LED can represent the working condition of CPU,e.g.flashing means CPU works normally. solid light or always going out means that CPU doesn't work normally(e.g CPU is unworkable)

led-gpio测试(led-gpio test)

led-gpio对应D14。系统启动后,该LED默认保持常灭的状态。进入系统后,我们可通过指令来控制该LED的亮灭。
led-gpio corresponds with D14.after system is booted,the LED is kept defaulty in state of going out,we can control on/off of the LED through commands after entrance of system
该LED使用的CPU引脚为PE3,在系统中表现由/sys/class/leds/gpioE3/目录下相关的文件表示它的属性。
pin of CPU used by the LED is PE3, its property is represented by the relevant files under directory of /sys/class/leds/gpioE3/ in the system
控制指令如下:
controling commands as below:
# echo 1 > /sys/class/leds/gpioE3/brightness
# echo 0 > /sys/class/leds/gpioE3/brightness
MY-SAMA5 Linux-3.18 2.4.4.1.png

led-timer测试(led-timer test)

led-timer对应D15。这主要演示GPIO作为timer信号。
led-timer corresponds with D15,this mainly demonstrate GPIO as timer signal
在系统中由/sys/class/leds/timer/目录下相关的文件表示它的属性。
its property is represented by the relevant files under directory of /sys/class/leds/timer in the system
我们可能通过设置delay来控制该GPIO高低电平保持的时间。
we can set dealy to control holding time of high/low electrical level of GPIO
控制指令如下:
controling commands as below:
# echo 1000 > /sys/class/leds/timer/delay_off
通过delay_off控制低电平保持的时间,1000即1000ms
control holding time of low electrical level via delay_off,1000 means 1000ms
# echo 2000 > /sys/class/leds/timer/delay_on
通过delay_on控制低电平保持的时间,2000即2000ms
control holding time of low electrical level via delay_on,2000 means 2000ms
执行上面两条指令后,我们看到的效果是:D15灭1秒后,亮2秒,如此循环。
after execution of the above two commands,the result: 1 second after D15 goes out,then lit for 2 seconds,cycle this way.
MY-SAMA5 Linux-3.18 2.4.5.1.png

串口测试(serial port test)

MY-SAMA5-EK200评估板有6个串口,其中5个为用户串口,1个为调试串口(位于底板正面“P1”位置)。
MY-SAMA5-EK200 evaluation board has 6 serial ports, 5 of them are user serial port, 1 of them is debug serial port(in"P1" on top view of based board)

MPU定义
(definition)
功能实现
(function realization)
Linux设备文件
(Linux device file)
连接位置
(position of connection)
DBGU 调试串口
(debug serial port)
/dev/ttyS0 P1
USART0 RS232 /dev/ttyS1 J27:5,6(RX,TX)
USART1 RS232,RS485 /dev/ttyS2 J26:14,11(RX,TX)
USART2 RS232,RS485 /dev/ttyS3 J26:10,7(RX,TX)
USART3 RS232 /dev/ttyS4 J27:1,2(RX,TX)
UART0 RS232 /dev/ttyS5 J27:3,4(RX,TX)

在串口测试中我们测试5个用户串口。
we will test the 5 user serial port in the test of serial port

测试说明(test instruction)

  • 测试方法说明:

instruction of test method
采用串口自发自收的方式进行。
adopt method of self-sending & self-receiving of serial port

  • 测试结果说明:

instruction of test result
通过测试程序向串口发送字符串,并输出串口接收到的字符串。
send charater string to serial port via test program,and output the charater string received by the serial port

测试方法(test method)

1)短接串口的收发引脚
short connect transceiver pins of serial port
这一步请根据需要测试的串口找到对应的引脚,并仔细检查,确保无误。如不确定请在硬件工程师的支持下进行。错误的短接可能会对评估板造成损坏。
please find the corresponding pins according to the serial ports which need to be tested and check carefully to make sure 100% correct. if you are not sure of how to do it please ask hardware engineer for a support.it may cause damage to the evaluation board by a wrong short connection
2)准备测试程序
prepare test program

  • 下载测试应用程序

download test application
将uart_test.out下载到评估板,参考命令如下:
download uart_test.out to the evaluation board,reference command as below:
# tftp –gr uart_test.out 192.168.18.18
MY-SAMA5 Linux-3.18 2.5.2.1.png

  • 为测试程序添加可执行权限

add executable authority for the test program
# chmod +x uart_test.out
MY-SAMA5 Linux-3.18 2.5.2.2.png
3)测试USART0(ttyS1)
test USART0(ttyS1)

  • 指定需要测试的串口

specify serial port which need to be tested
指定USART0为被测试设备,根据前面的表格,UASRT0对应ttyS1
specify USART0 as device tested,according to the previous form,UASRT0 correspond with ttyS1
# USART_DEV="/dev/ttyS1"
MY-SAMA5 Linux-3.18 2.5.2.3.png

  • 执行测试命令

execute test command
# ./uart_test.out $USART_DEV "www.myzr.com.cn"
MY-SAMA5 Linux-3.18 2.5.2.4.png
3)其它串口测试
test of other serial ports
测试其它串口同样需要指定对应的设备文件,并执行测试命令,参考如下:
likewise,corresponding device file need to be specified for the test of other serial ports and execute test command,reference as below:
# USART_DEV="/dev/ttyS2"
# ./uart_test.out $USART_DEV "www.myzr.com.cn"
MY-SAMA5 Linux-3.18 2.5.2.5.png
# USART_DEV="/dev/ttyS3"
# ./uart_test.out $USART_DEV "www.myzr.com.cn"
MY-SAMA5 Linux-3.18 2.5.2.6.png
# USART_DEV="/dev/ttyS4"
# ./uart_test.out $USART_DEV "www.myzr.com.cn"
MY-SAMA5 Linux-3.18 2.5.2.7.png
# USART_DEV="/dev/ttyS5"
# ./uart_test.out $USART_DEV "www.myzr.com.cn"
MY-SAMA5 Linux-3.18 2.5.2.8.png

RTC测试(RTC test)

测试说明(test instruction)

     受快递运输影响,MY-SAMA5-EK200 评估板发货时不带电池。测试RTC前请自备纽扣电池并安装到底板背面“BT1”上(在丝印“RTC”旁边)。

  due to restrictions in transportation,MY-SAMA5-EK200 evaluation board doesn't contatin battery in delivery。before RTC test please prepare button cell to install on “BT1”in bottom view of base board(beside silkscreened name of“RTC”)

测试方法(test method)

   1)断电重启设备,查看当前系统时间和硬件时间。

  power off then reboot device,to check the current time of system and hardware。

  • 查看当前系统时钟命令如下:

command to check current system clock as below
# date

  • 系统输出信息如下:

message outputed by system as below:
Tue Nov 17 06:07:13 UTC 2015
MY-SAMA5 Linux-3.18 2.6.2.1.png

   2)查看当前RTC芯片时钟命令如下:

  command to check clock of RTC chip as below:
# hwclock

  • 系统输出信息如下:

message outputed by system as below:
Tue Nov 17 06:08:14 2015 0.000000 seconds
MY-SAMA5 Linux-3.18 2.6.2.2.png

   3)设置系统时钟,并同步到RTC芯片

  set system clock and synchronously set to RTC chip)

  • 设置系统时钟命令参考如下:

command to set system clock as below:

   # date -s "2015-11-23 12:34:56"
  • 将系统时钟写入硬件时钟命令如下:

command to write system clock into hardware as below:

   # hwclock –w
MY-SAMA5 Linux-3.18 2.6.2.3.png
4)断电重启评估板,查看当前系统时钟和硬件时钟

  power off and reboot evaluation board,to check current system clock and hardware clock)

   请参考第1步

please refer to the first step
5)测试结果
test result
执行第3步以后看到的时钟为新设定的时钟。
it will be a newly-set clock after execution of step 3

SPI测试 (SPI test)

MY-SAMA5-EK200上有一组SPI接口,在“J22”位置上。
there are a group of SPI interfaces on MY-SAMA5-EK200,they are on "J22"

测试说明(test instruction)

SPI测试采用自发送(输出)自接收(输入)的方式。
method of self-sending(output)self-receiving(input) is adopted for SPI test
测试需要用到SPI接口的MISO和MOSI管脚。SPI接口的 MISO管脚在底板“J22的5号”,MOSI管脚为“J22的1号”。
MISO pin and MOSI pin of SPI port will be used for the test。MISO pin of SPI port is “no.5 of J22”on the base board,and MOSI pin is “no.1 of J22”。)

测试方法(test method)

1)短接SPI的收发引脚
short connect transceiver pin of SPI
短接J22的1号和5号管脚,并仔细检查,确保无误。如不确定请在硬件工程师的支持下进行。错误的短接可能会对评估板造成损坏。
short connect pins no.1 and no.5 of J22 ,and check carefully to make sure 100% correct. if you are not sure of how to do it please ask hardware engineer for a support it may cause damage to the evaluation board by a wrong short connection
2)准备测试程序
prepare test program

  • 下载测试应用程序

download test application
将spi_test.out下载到评估板,参考命令如下:
download spi_test.out to evaluation board, reference command as below:
# tftp –gr spidev_test.out 192.168.18.18
MY-SAMA5 Linux-3.18 2.7.2.1.png

  • 为测试程序添加可执行权限

add executable authority for the test program
# chmod +x spidev_test.out
MY-SAMA5 Linux-3.18 2.7.2.2.png
3)执行测试
execute test
# ./spidev_test.out -D /dev/spidev32765.0
MY-SAMA5 Linux-3.18 2.7.2.3.png
4)测试结果
test result
如果SPI正常,在终端上会看到如下字符:
if SPI is normal,you can see on terminal the following charaters:
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

CAN接口测试 (CAN infterface test)

测试说明(test instruction)

CAN测试需要用到示波器,没有示波器的客户请跳过CAN测试。
oscilloscope will be used for CAN test,please skip this step for users who don't have oscilloscope。
这里演示CAN0的测试,CAN1测试类似。
here demonstrate the test for CAN0,the same way for CAN1

测试方法(test method)

1)配置CAN0
configure CAN0
示例命令如下:
exampled command as below:
# ip link set can0 up type can bitrate 125000
MY-SAMA5 Linux-3.18 2.8.2.1.png
2)配置连接示波器
configure connection to oscilloscope
将示波器的CH1和CH2连接到评估板的“J12”(在底板正面最上面的蓝色座子)。
connect CH1 and CH2 of oscilloscope with “J12”of evaluation board(the blue stand on topside on top view of base board)
配置示波器(不会使用示波器的客户请找硬件工程师协助)。
configure oscilloscope(for users who don't know how to use oscilloscope ,please ask hardware engineers for assistance )
3)执行测试命令
execute test command
# cansend can0 5A1#11.2233.44556677.88
MY-SAMA5 Linux-3.18 2.7.2.2.png
4)测试结果
test result
执行测试命令的同时会在示波器上看到波形的变化。
when exectue the test command,at the same time you can see a change of wave shape on oscilloscope。

WIFI测试(WIFI test)

1)在网盘“4_烧录支持/mysama5ek200_image”下载编译好的 WIFI 驱动模块“8188eu.ko”。
download WIFI module “8188eu.ko”compiled under directory of “4_programing support/mysama5ek200_image”on the network disk
2)把 8188eu.ko 传输到开发板的 “~/my-demo/linux-3.18/” 目录。
transfer 8188eu.ko to the directory of “~/my-demo/linux-3.18/”of development board
3)测试
test
# insmod ~/my-demo/linux-3.18/8188eu.ko
# wpa_passphrase WIFI名称 WIFI密码 > /etc/wpa_supplicant.conf
# wpa_passphrase WIFI name WIFI password> /etc/wpa_supplicant.conf
# wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -B
# udhcpc -i wlan0