测试手册 ======== 复位按键 -------- + 接口丝印:SW2 **功能测试** 1)说明:短按复位按键可以使设备电源复位。 2)操作:在主板电源开启的情况下,短按 SW1 即可使设备电源复位。 3)结果:按下时可以看到主板指示灯灭,松开时可以看到主板指示灯亮起,即功能正常。 RTC --- + 设备接口:/dev/rtc + 测试说明:RTC 测试需要安装纽扣电池,电池位置在丝印 BT1。 **功能测试** + **RTC时间** 1)说明:设置RTC时间,之后断电重启后再核对RTC时间 2)操作 a)设置 RTC 时间,具体操作如下: + 输入指令更新系统时间: .. code-block:: shell date -s "2023-02-06 12:34:56" + 可以看到系统当前时间更新为设置的时间: .. code-block:: text Mon Feb 6 12:34:56 UTC 2023 + 输入指令设置系统时间到 RTC: .. code-block:: shell hwclock -w -f /dev/rtc b)断电重启设备。 c)核对 RTC 时间,具体操作如下: + 输入指令: .. code-block:: shell hwclock -f /dev/rtc + 可以看到RTC存储的时间与我们设置的时间基本相同,类似如下: .. code-block:: text 2023-02-06 12:35:34.485664+00:00 3)结果:执行操作后,核对 RTC 时间基本没有问题,且操作过程中的输出符合预期即功能正常。 网口 ---- + 接口丝印:U8(ETH1),U12(ETH2) + 系统接口:eth0(ETH1),eth1(ETH2) **功能测试** + **网口一** 1)说明:采用开发板向PC发送ICMP报文的方式进行测试 2)操作 a)配置电脑有线网卡IP为 192.168.137.99。 b)把开发板的这个网口用网线跟电脑网口连接起来。 c)配置开发板网口IP,具体配置命令如下: .. code-block:: shell ifconfig eth1 down ifconfig eth0 up ifconfig eth0 192.168.137.81 d)执行网口测试命令 + 输入指令: .. code-block:: shell ping 192.168.137.99 -c 2 -w 4 + 输出信息: .. code-block:: text 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-1.35 ms 64 bytes from 192.168.137.99: icmp_seq-2 ttl-64 time-1.35 ms --- 192.168.137.99 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1002ms rtt min/avg/max/mdev - 1.347/1.347/1.348/0.000 ms 3)结果:“0% packet loss”表示测试通过。 + **网口二** 1)说明:采用开发板向PC发送ICMP报文的方式进行测试 2)操作 a)配置电脑有线网卡IP为 192.168.137.99。 b)把开发板的这个网口用网线跟电脑网口连接起来。 c)配置开发板网口IP,具体配置命令如下: .. code-block:: shell ifconfig eth0 down ifconfig eth1 up ifconfig eth1 192.168.137.82 d)执行网口测试命令 + 输入指令: .. code-block:: shell ping 192.168.137.99 -c 2 -w 4 + 输出信息: .. code-block:: text 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.595 ms 64 bytes from 192.168.137.99: icmp_seq-2 ttl-64 time-0.843 ms --- 192.168.137.99 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1001ms rtt min/avg/max/mdev - 0.595/0.719/0.843/0.124 ms 3)结果:“0% packet loss”表示测试通过。 CAN --- 两组 CAN 接口丝印看开发板背面丝印 **功能测试** 1)说明:使用两组 CAN 总线对方对收的方式进行测试。 2)操作 a)使用杜邦线将 J8:CAN2_H 与 CAN1_H 连接, CAN2_L 与 CAN1_L 连接。 b)在串口终端输入命令配置 CAN 接口: .. code-block:: shell ip link set can0 up type can bitrate 125000 ip link set can1 up type can bitrate 125000 .. note:: 可以看到终端输出类似信息:link becomes ready c)在串口终端输入命令使 CAN1(can0) 后台接收: .. code-block:: shell candump can0 & d)在串口终端输入命令使 CAN2(can1) 发送测试数据: + 输入命令: .. code-block:: shell cansend can1 1F334455#1122334455667788 + 输出信息: .. code-block:: text can0 1F334455 [8] 11 22 33 44 55 66 77 88 3)结果:“d)”操作时输出信息正确,即功能正常。 I2C --- **功能测试** 1)说明:执行 I2C 检测指令并观察结果。 2)操作 a)检测系统的 I2C 总线 + 输入命令: .. code-block:: shell i2cdetect -l + 输出信息类似如下,表示检测到 I2C 0、1、2 和 HDMI 的适配器。 .. code-block:: text i2c-0 i2c STM32F7 I2C(0x40012000) I2C adapter i2c-3 i2c STM32F7 I2C(0x4c005000) I2C adapter i2c-4 i2c STM32F7 I2C(0x4c006000) I2C adapter b)检测总线上的 I2C 设备 + 输入命令: .. code-block:: shell i2cdetect -y 4 .. note:: i2cdetect 带的参数 4 可以是上一步检测出的总线序号,如 0、3、4。 + 输出有类似如下信息,非 “\--” 表示在 I2C 总线对应地址检测到设备。 .. code-block:: text 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- UU 70: -- -- -- -- -- -- -- -- 3)结果:操作过程中的输出信息与预期基本一致,即功能正常。 UART ---- +----------+-----------+--------------+ | 管脚位置 | 管脚配置 | 系统接口 | +----------+-----------+--------------+ | P3:30 | UART7_TXD | /dev/ttySTM7 | +----------+-----------+ + | P3:28 | UART7_RXD | | +----------+-----------+ + | P3:26 | UART7_RTS | | +----------+-----------+ + | P3:24 | UART7_CTS | | +----------+-----------+--------------+ | P3:29 | UART8_TXD | /dev/ttySTM8 | +----------+-----------+ + | P3:27 | UART8_RXD | | +----------+-----------+ + | P3:25 | UART8_RTS | | +----------+-----------+ + | P3:23 | UART8_CTS | | +----------+-----------+--------------+ **功能测试** 1)说明:使用串口自发自收的方式进行测试。 2)操作 a)使用杜邦线连接 P3:30 和 P3:28。 b)运行测试程序: + 输入命令: .. code-block:: shell /usr/local/my-demo/serial_test.out /dev/ttySTM7 "www.myzr.com.cn" + 输出信息: .. code-block:: text 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: 3)结果:执行测试操作后,输入信息符合正确预期即功能正常。 RS232 -------- +----------+------------+----------------+ | 管脚位置 | 管脚配置 | 系统接口 | +----------+------------+----------------+ | J8:20 | RS232_RTS2 | /dev/ttySTM2 | +----------+------------+ + | J8:19 | RS232_CTS2 | | +----------+------------+ + | J8:18 | RS232_TX2 | | +----------+------------+ + | J8:17 | RS232_RX2 | | +----------+------------+----------------+ | J8:15 | RS232_TX5 | /dev/ttySTM5 | +----------+------------+ + | J8:14 | RS232_RX5 | | +----------+------------+----------------+ **功能测试** 1)说明:使用串口自发自收的方式进行测试。 2)操作 a)使用杜邦线连接 J8:18 和 J8:17。 b)运行测试程序: + 输入命令: .. code-block:: shell /usr/local/my-demo/serial_test.out /dev/ttySTM2 "www.myzr.com.cn" + 输出信息: .. code-block:: text 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: 3)结果:执行测试操作后,输入信息符合正确预期即功能正常。 RS485 ----- +----------+-----------+--------------+ | 管脚位置 | 管脚配置 | 系统接口 | +----------+-----------+--------------+ | J8:12 | B1 | /dev/ttySTM1 | +----------+-----------+ + | J8:11 | A1 | | +----------+-----------+--------------+ | J8:9 | B6 | /dev/ttySTM6 | +----------+-----------+ + | J8:8 | A6 | | +----------+-----------+--------------+ **功能测试** 1)使用485-232转换头连接B1和A1,另一端与电脑usb口连接。 2)打开串口调试助手,设置波特率为9600,无校验位,8位数据位,1位停止位。 3)开发板使用ssh登录,向电脑端发送数据: .. code-block:: shell echo 12323 > /dev/ttySTM1 可以看到串口助手接收到字符串“12323” 4)开发板接收数据,电脑端发送数据: .. code-block:: shell cat /dev/ttySTM1 当串口助手发送字符串时,开发板会接收到数据: .. code-block:: shell cat /dev/ttySTM4 myzr GPIO ---- **功能测试** + GPIO 输出测试 1)说明:通过系统的接口控制 GPIO 的输出电平。 2)操作 a)列出系统上所有的gpiochip: .. code-block:: shell gpiodetect 输出信息: .. code-block:: shell gpiochip0 [GPIOA] (16 lines) gpiochip1 [GPIOB] (16 lines) gpiochip2 [GPIOC] (16 lines) gpiochip3 [GPIOD] (16 lines) gpiochip4 [GPIOE] (16 lines) gpiochip5 [GPIOF] (16 lines) gpiochip6 [GPIOG] (16 lines) gpiochip7 [GPIOH] (15 lines) gpiochip8 [GPIOI] (8 lines) b)输入命令控制 IO 输出高电平,以P1:6管脚为例: .. code-block:: shell gpioset gpiochip0 15=1 .. note:: 这时用万用表测试 P1:6,电压应当是 3.3V。 c)控制 IO 输出低电平: .. code-block:: shell gpioset gpiochip0 15=0 .. note:: 这时用万用表测试 P1:6,电压应当是 0V。 3)结果:在测试操作中控制IO电平时,测得的电压与预期符合即正常。 + GPIO 输入测试 1)说明:通过系统的接口配置并读取GPIO的输入电平。 2)操作 a)用杜邦线或跳线帽连接 P1:34和P1:36脚。 b)输入如下命令读取P1:34脚即PH8的电平。 .. code-block:: shell gpioget gpiochip7 8 输出信息: .. code-block:: shell 0 表示读取到PH8管脚为低电平。 c)用杜邦线连接 P1:34和P1:4脚,以接上3.3v电压,再次输出如下命令 .. code-block:: shell gpioget gpiochip7 8 输出信息: .. code-block:: shell 1 表示读取到高电平 3)结果:在测试操作中,读取到的电平符合正确预期,即功能正常。 SPI --- **功能测试** 1)说明:通过 SPI 接口发送字符串。 2)操作 a)短接P3:6和P3:8脚,输入如下命令: .. code-block:: shell /usr/local/my-demo/spidev_test.out -D /dev/spidev0.0 b)输出如下信息表示,SPI收发正常: .. code-block:: shell 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 3)结果:看到的输出信息符合正确预期,表示发送成功。 USB WiFi -------- + 接口丝印:U19 **功能测试** 1)说明:WIFI连接到AP后,开发板向外网发送ICMP报文来验证连接正常。 2)操作: a)把WIFI天线连接到“E2”接口上 b)生成 SSID 的 WPA PSK 文件,输入: .. code-block:: shell wpa_passphrase MYZR-WIFI myzr2012 > /etc/wpa_supplicant.conf c)连接: .. code-block:: shell wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf d)获取IP: .. code-block:: shell udhcpc -i wlan0 e)测试连接: .. code-block:: shell ping -I wlan0 www.baidu.com USB 蓝牙 -------- + 接口丝印:U19 **功能测试** 1)说明:扫描到蓝牙设备后,发送L2CAP回应请求并接收回答。 2)操作: a)把天线连接到“E2”接口上 b)启动蓝牙: .. code-block:: shell hciconfig hci0 up c)扫描外部蓝牙设备: .. code-block:: shell hcitool scan 扫出我手机蓝牙地址: .. code-block:: shell 88:46:04:4C:11:A7 Redmi K40 d)发送发送L2CAP包测试: .. code-block:: shell l2ping 88:46:04:4C:11:A7 连接成功显示: .. code-block:: shell Ping: 88:46:04:4C:11:A7 from B0:F1:EC:A7:E8:03 (data size 44) ... 44 bytes from 88:46:04:4C:11:A7 id 0 time 44.84ms 44 bytes from 88:46:04:4C:11:A7 id 1 time 28.58ms 44 bytes from 88:46:04:4C:11:A7 id 2 time 46.05ms 44 bytes from 88:46:04:4C:11:A7 id 3 time 44.86ms 44 bytes from 88:46:04:4C:11:A7 id 4 time 44.67ms 44 bytes from 88:46:04:4C:11:A7 id 5 time 52.32ms 44 bytes from 88:46:04:4C:11:A7 id 6 time 24.86ms 44 bytes from 88:46:04:4C:11:A7 id 7 time 59.71ms ^C8 sent, 8 received, 0% loss TF卡 ---- + 接口丝印:J16 **功能测试** .. note:: 设备的 TF 卡接口支持热插拔,TF 卡座是自弹式。 + TF卡插入测试 1)说明:插入 TF 卡,观察设备能否正确识别到卡。 2)操作 a)用一张 TF 卡,插入到设备的 TF 卡接口。 b)输出信息类似如下: .. code-block:: text ... mmc1: new ultra high speed SDR104 SDHC card at address 0001 mmcblk1: mmc1:0001 SD16G 14.9 GiB ... 3)结果:操作后输出信息符合正确预期,表示正确识别到 TF 卡。 + TF卡弹出测试 1)弹出 TF 卡,观察设备能否正确响应。 2)操作 a)往 TF 卡插入方向往里按(听到“咔”一声松手,TF卡会弹出)。 b)输出信息类似如下: .. code-block:: text ... mmc1: card 0001 removed ... 3)结果:操作时的现象符合正确预期,表示 TF 热插拔正常。 USB 2.0 ------- + 接口丝印:J4 **功能测试** 1)说明:采用插拔USB存储设备(U盘)的方式进行测试 2)操作: a)将USB设备插入底板USB接口,系统会输出类似如下信息: .. code-block:: text [ 2649.580746] usb 2-1.1: new high-speed USB device number 3 using ehci-platform [ 2649.735676] usb-storage 2-1.1:1.0: USB Mass Storage device detected [ 2649.752030] scsi host0: usb-storage 2-1.1:1.0 [ 2649.951147] usbcore: registered new interface driver uas [ 2650.801744] scsi 0:0:0:0: Direct-Access aigo U330 2.00 PQ: 0 ANSI: 4 [ 2650.822371] sd 0:0:0:0: [sda] 61440000 512-byte logical blocks: (31.5 GB/29.3 GiB) [ 2650.830508] sd 0:0:0:0: Attached scsi generic sg0 type 0 [ 2650.851173] sd 0:0:0:0: [sda] Write Protect is off [ 2650.871241] sd 0:0:0:0: [sda] No Caching mode page found [ 2650.875217] sd 0:0:0:0: [sda] Assuming drive cache: write through [ 2650.896991] sda: sda1 [ 2650.916261] sd 0:0:0:0: [sda] Attached SCSI removable disk b)将USB设备从底板拔出,系统会输出类似如下信息: .. code-block:: text [ 2690.764161] usb 2-1.1: USB disconnect, device number 3 ADC --- + 接口丝印:P1:27 、P1:29 **功能测试** 1)先查找ADC对应的外设: .. code-block:: shell grep -H "" /sys/bus/iio/devices/*/name | grep adc 输出: .. code-block:: shell /sys/bus/iio/devices/iio:device0/name:48003000.adc:adc@0 2)在ADC上执行一次转换,并读取ADC的比例和偏移量: .. code-block:: shell cd /sys/bus/iio/devices/iio\:device0/ cat in_voltage6_raw //获取adc1通道6上的数据(原始值) 4095 cat in_voltage_scale //读取比例 0.805664062 cat in_voltage_offset //读取偏移 0 awk "BEGIN{printf (\"%d\n\", (4095 + 0) * 0.805664062)}" //计算真实值 3299 //3299mv 4G模式EC20 ----------- + 接口丝印:J7 **功能测试** 1)接上4G模块EC20,接上4G天线和SIM卡 2)启动开发板。 3)输入如下命令进行拨号: .. code-block:: shell ./quectel-CM & 4)获取ip .. code-block:: shell udhcpc -i usb0 5)测试连接情况 .. code-block:: shell ping -I usb0 www.baidu.com -------------------------------------------------------------------------------- :: -------------------------------------------------------------------------------- * 珠海明远智睿科技有限公司 * ZhuHai MYZR Technology CO.,LTD. * Latest Update: 2023/4/26 * Supporter: Kuangwh --------------------------------------------------------------------------------