测试指导
LED测试
输入命令点亮LED2:
echo 1 > /sys/class/leds/user-led0/brightness
输入命令点亮LED3:
echo 1 > /sys/class/leds/user-led1/brightness
网口测试
网口1
配置电脑有线网卡IP为 192.168.137.99
ifconfig eth1 down
ifconfig eth0 up
ifconfig eth0 192.168.137.81
输入指令如下进行验证网口1:
ping -I eth0 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.444 ms
64 bytes from 192.168.137.99: seq=1 ttl=128 time=0.419 ms
--- 192.168.137.99 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 0.419/0.431/0.444 ms
网口2
千兆以太网口:
配置电脑有线网卡IP为 192.168.137.99
ifconfig eth0 down
ifconfig eth1 up
ifconfig eth1 192.168.137.81
输入指令如下进行验证网口2:
ping -I eth1 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.683 ms
64 bytes from 192.168.137.99: seq=1 ttl=128 time=0.390 ms
--- 192.168.137.99 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 0.390/0.536/0.683 ms
# [ 239.952473] random: crng init done
网口3
配置电脑有线网卡IP为 192.168.137.99
echo 342 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio342/direction
ifconfig eth0 down
ifconfig eth1 down
ifconfig eth2 up
ifconfig eth3 down
ifconfig eth2 192.168.137.81
输入指令如下进行验证网口2:
ping -I eth2 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.683 ms
64 bytes from 192.168.137.99: seq=1 ttl=128 time=0.390 ms
--- 192.168.137.99 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 0.390/0.536/0.683 ms
# [ 239.952473] random: crng init done
网口4
配置电脑有线网卡IP为 192.168.137.99
echo 342 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio342/direction
ifconfig eth0 down
ifconfig eth1 down
ifconfig eth2 down
ifconfig eth3 up
ifconfig eth3 192.168.137.81
输入指令如下进行验证网口2:
ping -I eth3 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.515 ms
64 bytes from 192.168.137.99: seq=1 ttl=128 time=0.481 ms
--- 192.168.137.99 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 0.481/0.498/0.515 ms
USB测试
将USB设备插入底板USB接口,系统会输出类似如下信息:
...
[ 988.019550] sd 0:0:0:0: [sda] 1966080 512-byte logical blocks: (1.01 GB/960 MiB)
[ 988.028539] sd 0:0:0:0: [sda] Write Protect is off
[ 988.033907] sd 0:0:0:0: [sda] Mode Sense: 0b 00 00 08
[ 988.040290] sd 0:0:0:0: [sda] No Caching mode page found
[ 988.046236] sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 988.076798] sda:
[ 988.081909] sd 0:0:0:0: [sda] Attached SCSI removable disk
将USB设备从底板拔出,系统会输出类似如下信息:
[ 1046.519402] usb 1-1.1.4: USB disconnect, device number 6
SD接口测试
将TF卡安装到SD接口,开发会输出如下信息:
...
[ 1181.653628] mmc1: new high speed SDHC card at address 0001
[ 1181.660659] mmcblk1: mmc1:0001 TF 4G 3.68 GiB
[ 1181.669095] mmcblk1: p1
...
将TF拔出,输出信息如下:
...
[ 1235.622463] mmc1: card 0001 removed
...
音频播放测试
把耳机接入丝印对应的接口
输入指令如下进行测试:
aplay -l
LINEOUT
aplay -Dhw:0 music_test.wav
录音测试(暂时)
把带MIC的耳机插入丝印对应的接口
输入如下指令进行10秒的录音:
arecord -d 10 -f cd -r 44100 -c 2 -t wav record.wav
把耳机或者喇叭接入丝印J16对应的接口播放录制的音频文件,输入如下指令:
aplay -D hw:0,0 record.wav
Wifi测试
把WIFI天线连接到”U12”接口上
生成 SSID 的 WPA PSK 文件
wpa_passphrase命令格式:wpa_passphrase + wifi名称 + wifi密码 > /etc/wpa_supplicant.conf
dmesg -n 1
wpa_passphrase MY-WIFI My202412 > /etc/wpa_supplicant.conf
连接,输入指令如下:
wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf
Successfully initialized wpa_supplicant
nl80211: kernel reports: Authentication algorithm number required
[ 266.744713] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
获取IP,输入指令如下:
udhcpc -i wlan0
udhcpc: started, v1.36.0
udhcpc: broadcasting discover
udhcpc: broadcasting select for 192.168.61.187, server 192.168.60.1
udhcpc: lease of 192.168.61.187 obtained from 192.168.60.1, lease time 86400
deleting routers
adding dns 192.168.60.1
测试连接,输入指令如下:
ping -I wlan0 www.baidu.com -c 3
PING www.baidu.com (183.2.172.177) from 192.168.61.73 wlan0: 56(84) bytes of data.
64 bytes from 183.2.172.177: icmp_seq=1 ttl=54 time=10.0 ms
64 bytes from 183.2.172.177: icmp_seq=2 ttl=54 time=13.2 ms
64 bytes from 183.2.172.177: icmp_seq=3 ttl=54 time=14.5 ms
--- www.baidu.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 10.031/12.576/14.482/1.872 ms
蓝牙测试(没驱动)
把天线连接到”U12”接口上
启动蓝牙,输入指令如下:
hciconfig hci0 up
扫描外部蓝牙设备,输入指令如下:
hcitool scan
Scanning ...
40:45:A0:49:3B:1A chensz
发送L2CAP包测试,输入指令如下:
l2ping 40:45:A0:49:3B:1A
Ping: 40:45:A0:49:3B:1A from E8:5C:5F:B5:7A:11 (data size 44) ...
44 bytes from 40:45:A0:49:3B:1A id 0 time 32.41ms
44 bytes from 40:45:A0:49:3B:1A id 1 time 77.03ms
44 bytes from 40:45:A0:49:3B:1A id 2 time 90.89ms
44 bytes from 40:45:A0:49:3B:1A id 3 time 59.38ms
44 bytes from 40:45:A0:49:3B:1A id 4 time 93.44ms
^C5 sent, 5 received, 0% loss
can测试
使用杜邦线,将J14的H2接H4,L2接L4
配置can,输入指令如下:
ip link set can1 up type can bitrate 1000000 dbitrate 5000000 fd on
ip link set can3 up type can3 bitrate 1000000 dbitrate 5000000 fd on
candump can3 &
can1发送数据,输入指令如下:
cansend can1 1F334455#1122334455667788
更改的can配置,can3发送数据,输入指令如下:
candump can1 &
cansend can3 1F334455#1122334455667788
uart测试
TTL
使用TTL-USB转换头连接开发板和电脑
使用Xshell打开对应串口,将波特兰设置成115200,数据为8位,停止位1位
发送测试,输入如下命令
num=7
stty -F /dev/ttyAS$num 115200
echo MYZR > /dev/ttyAS$num
接收测试,在485串口终端,直接输入123再按回车键发送,可以看到信息
cat /dev/ttyAS$num
RS232
使用485-USB转换头连接开发板和电脑
使用Xshell打开对应串口,将波特兰设置成115200,数据为8位,停止位1位
发送测试,输入如下命令
num=1
stty -F /dev/ttyAS$num 115200 -crtscts
echo 200 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio200/direction
echo 1 > /sys/class/gpio/gpio200/value
echo MYZR > /dev/ttyAS$num
接收测试,在485串口终端,直接输入123再按回车键发送,可以看到信息
echo 200 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio200/direction
echo 0 > /sys/class/gpio/gpio200/value
cat /dev/ttyAS$num
...
123
RS485
使用485-USB转换头连接开发板和电脑
使用Xshell打开对应串口,将波特兰设置成115200,数据为8位,停止位1位
发送测试,输入如下命令
num=1
stty -F /dev/ttyAS$num 115200 -crtscts
echo 200 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio200/direction
echo 1 > /sys/class/gpio/gpio200/value
echo MYZR > /dev/ttyAS$num
接收测试,在485串口终端,直接输入123再按回车键发送,可以看到信息
echo 200 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio200/direction
echo 0 > /sys/class/gpio/gpio200/value
cat /dev/ttyAS$num
...
123
rtc测试
断电,检查纽扣电池是否安装,用万用表检查RTC电池有没有电,测出来是3.3v左右才是正常的
设备通电,查看当前系统时钟,输入指令如下:
date
Wed May 14 02:06:10 UTC 2025
查看rtc时钟,输入指令:
hwclock
Wed May 14 02:06:20 2025 0.000000 seconds
设置系统时间
date -s "2025-5-14 10:30:00"
将系统时间写入rtc,查看有没有成功写入,输入指令如下:
hwclock -w
hwclock
Wed May 14 10:30:10 2025 0.000000 seconds
设备断电重启,查看rtc时钟,输入指令如下:
hwclock
Wed May 14 10:30:43 2025 0.000000 seconds
按键测试
输入指令并按K5:
od -x /dev/input/event23
0000000 1d3f 0000 0000 0000 14f4 000f 0000 0000
0000020 0001 0095 0001 0000 1d3f 0000 0000 0000
0000040 14f4 000f 0000 0000 0000 0000 0000 0000
0000060 1d40 0000 0000 0000 78c1 0002 0000 0000
0000100 0001 0095 0000 0000 1d40 0000 0000 0000
0000120 78c1 0002 0000 0000 0000 0000 0000 0000
输入指令并按K5:
od -x /dev/input/event11
0000000 1d46 0000 0000 0000 a050 0006 0000 0000
0000020 0001 0094 0001 0000 1d46 0000 0000 0000
0000040 a050 0006 0000 0000 0000 0000 0000 0000
0000060 1d46 0000 0000 0000 afc4 000a 0000 0000
0000100 0001 0094 0000 0000 1d46 0000 0000 0000
0000120 afc4 000a 0000 0000 0000 0000 0000 0000
HDMI测试
将HDMI接口的屏幕和开发板上对应丝印接口连接
将程序lt8912_force_1080p拷贝到板子上
输入如下,命令
echo 202 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio202/direction
echo 0 > /sys/class/gpio/gpio202/value
./lt8912_force_1080p
输出该信息后
LT8912b chip ID: 0x12, 0xb2
GPIO测试
丝印 |
1 |
3 |
5 |
7 |
11 |
… |
16 |
GIPO |
GPIO1_B4 |
GPIO1_B5 |
GPIO1_B6 |
GPIO1_B7 |
GND |
… |
GPIO1_C7 |
高电平 |
1.8V |
1.8V |
1.8V |
1.8V |
… |
1.8V |
输入如下指令使GPIO1_B4处于高电平:
./test_app/gpio_test.out GPIO1_B4 1
et GPIO44 HIGH
输入如下指令使GPIO1_B4处于低电平:
./test_app/gpio_test.out GPIO1_B4 0
Set GPIO44 LOW
中断检测,触发方式为下降沿触发,将管脚J23:1和J23:2使用杜邦线连接,输入如下指令使管脚进入中断检测
./test_app/gpio_test.out GPIO1_B4 irq &
./test_app/gpio_test.out GPIO1_B5 1
./test_app/gpio_test.out GPIO1_B5 0
GPIO44 interrupt detected! Value: 0
5G
./test_app/quectel-CM &
[01-01_00:07:13:012] Find /sys/bus/usb/devices/1-1.3 idVendor=0x2c7c idProduct=0x800, bus=0x001, dev=0x004
[01-01_00:07:13:012] Auto find qmichannel = /dev/qcqmi2
[01-01_00:07:13:012] Auto find usbnet_adapter = eth2
[01-01_00:07:13:012] netcard driver = GobiNet, driver version = 6.1.75
[01-01_00:07:13:012] qmap_mode = 1, qmap_version = 5, qmap_size = 16384, muxid = 0x81, qmap_netcard = eth2
[01-01_00:07:13:012] Modem works in QMI mode
[01-01_00:07:13:024] Get clientWDS = 7
[01-01_00:07:13:056] Get clientDMS = 8
[01-01_00:07:13:088] Get clientNAS = 9
[01-01_00:07:13:121] Get clientUIM = 10
[01-01_00:07:13:152] requestBaseBandVersion RM500QGLABR11A02M4G
[01-01_00:07:13:280] requestGetSIMStatus SIMStatus: SIM_READY
[01-01_00:07:13:345] requestGetProfile[pdp:1 index:1] cmnet///0/IPV4
[01-01_00:07:13:377] requestRegistrationState2 MCC: 460, MNC: 0, PS: Attached, DataCap: 5G_SA
[01-01_00:07:13:409] requestQueryDataCall IPv4ConnectionStatus: DISCONNECTED
[01-01_00:07:13:409] ip addr flush dev eth2
[01-01_00:07:13:416] ip link set dev eth2 down
[ 391.576009] GobiNet 1-1.3:1.4: Runtime PM usage count underflow!
[01-01_00:07:14:048] requestSetupDataCall WdsConnectionIPv4Handle: 0xe5441560
[ 392.332033] net eth2: link_state 0x0 -> 0x1
[01-01_00:07:14:177] ip link set dev eth2 up
[01-01_00:07:14:188] busybox udhcpc -f -n -q -t 5 -i eth2
udhcpc: started, v1.36.1
udhcpc: broadcasting discover
[ 392.386699] GobiNet::GobiNetDriverRxQmapFixup rx_pkts=1, rx_len=312
udhcpc: broadcasting select for 10.60.64.247, server 10.60.64.248
udhcpc: lease of 10.60.64.247 obtained from 10.60.64.248, lease time 7200
[01-01_00:07:14:246] deleting routers
[01-01_00:07:14:278] adding dns 120.196.165.7
[01-01_00:07:14:278] adding dns 221.179.38.7
[ 392.578960] IPv6: ADDRCONF(NETDEV_CHANGE): eth2: link becomes ready
[ 393.671782] GobiNet::GobiNetDriverRxQmapFixup rx_pkts=1, rx_len=328
ping -I eth2 www.baidu.com -c 2 -w 4
PING www.a.shifen.com (183.240.99.169) from 10.60.64.247 eth2: 56(84) bytes of data.
64 bytes from 183.240.99.169: icmp_seq=1 ttl=52 time=26.0 ms
64 bytes from 183.240.99.169: icmp_seq=2 ttl=52 time=24.2 ms
--- www.a.shifen.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1002ms
rtt min/avg/max/mdev = 24.219/25.096/25.973/0.877 ms
4G
./test_app/quectel-CM &
[01-01_00:07:13:012] Find /sys/bus/usb/devices/1-1.3 idVendor=0x2c7c idProduct=0x800, bus=0x001, dev=0x004
[01-01_00:07:13:012] Auto find qmichannel = /dev/qcqmi2
[01-01_00:07:13:012] Auto find usbnet_adapter = eth2
[01-01_00:07:13:012] netcard driver = GobiNet, driver version = 6.1.75
[01-01_00:07:13:012] qmap_mode = 1, qmap_version = 5, qmap_size = 16384, muxid = 0x81, qmap_netcard = eth2
[01-01_00:07:13:012] Modem works in QMI mode
[01-01_00:07:13:024] Get clientWDS = 7
[01-01_00:07:13:056] Get clientDMS = 8
[01-01_00:07:13:088] Get clientNAS = 9
[01-01_00:07:13:121] Get clientUIM = 10
[01-01_00:07:13:152] requestBaseBandVersion RM500QGLABR11A02M4G
[01-01_00:07:13:280] requestGetSIMStatus SIMStatus: SIM_READY
[01-01_00:07:13:345] requestGetProfile[pdp:1 index:1] cmnet///0/IPV4
[01-01_00:07:13:377] requestRegistrationState2 MCC: 460, MNC: 0, PS: Attached, DataCap: 5G_SA
[01-01_00:07:13:409] requestQueryDataCall IPv4ConnectionStatus: DISCONNECTED
[01-01_00:07:13:409] ip addr flush dev eth2
[01-01_00:07:13:416] ip link set dev eth2 down
[ 391.576009] GobiNet 1-1.3:1.4: Runtime PM usage count underflow!
[01-01_00:07:14:048] requestSetupDataCall WdsConnectionIPv4Handle: 0xe5441560
[ 392.332033] net eth2: link_state 0x0 -> 0x1
[01-01_00:07:14:177] ip link set dev eth2 up
[01-01_00:07:14:188] busybox udhcpc -f -n -q -t 5 -i eth2
udhcpc: started, v1.36.1
udhcpc: broadcasting discover
[ 392.386699] GobiNet::GobiNetDriverRxQmapFixup rx_pkts=1, rx_len=312
udhcpc: broadcasting select for 10.60.64.247, server 10.60.64.248
udhcpc: lease of 10.60.64.247 obtained from 10.60.64.248, lease time 7200
[01-01_00:07:14:246] deleting routers
[01-01_00:07:14:278] adding dns 120.196.165.7
[01-01_00:07:14:278] adding dns 221.179.38.7
[ 392.578960] IPv6: ADDRCONF(NETDEV_CHANGE): eth2: link becomes ready
[ 393.671782] GobiNet::GobiNetDriverRxQmapFixup rx_pkts=1, rx_len=328
ping -I eth2 www.baidu.com -c 2 -w 4
PING www.a.shifen.com (183.240.99.169) from 10.60.64.247 eth2: 56(84) bytes of data.
64 bytes from 183.240.99.169: icmp_seq=1 ttl=52 time=26.0 ms
64 bytes from 183.240.99.169: icmp_seq=2 ttl=52 time=24.2 ms
--- www.a.shifen.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1002ms
rtt min/avg/max/mdev = 24.219/25.096/25.973/0.877 ms
外部看门狗测试
跳线帽选择 ON 档位,使能外部硬件看门狗。若不执行任何操作,将在 1~3min内重启。
echo 8 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio8/direction
while true; do echo 1 > /sys/class/gpio/gpio8/value;sleep 1;echo 0 > /sys/class/gpio/gpio8/value;sleep 1; done
ADC测试
根据原理图,确定管脚位置
用杜邦线将2和1相接
echo 1 > /sys/class/gpadc/gpadc_chip1/data
cat /sys/class/gpadc/gpadc_chip1/data
gpadc1-channel1 voltage data is 1797
cat /sys/class/gpadc/gpadc_chip1/data
gpadc1-channel1 voltage data is 0