forlinx_ok-g2lx 硬件测试 命令行功能测试 1.温度测试 核心板没有加散热片的工作温度49度 root@okg2l:~# cat /sys/class/thermal/thermal_zone0/temp 49000 2.LED测试 核心板上蓝色led心跳状态的控制 把触发条件修改为none,可以用1来打开,0来关闭 root@okg2l:~# echo none > /sys/class/leds/heartbeat/trigger root@okg2l:~# echo 1 > /sys/class/leds/heartbeat/brightness root@okg2l:~# echo 0 > /sys/class/leds/heartbeat/brightness 3.串口接口测试 串口回环测试 图1 root@okg2l:~# fltest_uarttest -d /dev/ttySC1 Welcome to uart test Send test data: forlinx_uart_test.1234567890... Read Test Data finished,Read: forlinx_uart_test.1234567890... 4.SPI测试 spi回环测试 图2 root@okg2l:~# fltest_spidev_test -D /dev/spidev2.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 5.CAN测试 (1)设置开发板can服务 root@okg2l:~# ip link set can0 up type can bitrate 500000 dbitrate 2000000 fd on root@okg2l:~# ip link set can1 up type can bitrate 500000 dbitrate 2000000 fd on (2)开发板发送和接收数据 root@okg2l:~# candump can0& [1] 417 root@okg2l:~# cangen -m can1 can0 217 [03] B0 AA D6 can0 123EC9C5 [48] 98 AB 1F 56 1C E6 CD 7D 98 AB 1F 56 1C E6 CD 7D 98 AB 1F 56 1C E6 CD 7D 98 AB 1F 56 1C E6 CD 7D 98 AB 1F 56 1C E6 CD 7D 98 AB 1F 56 1C E6 CD 7D can0 0B9CB6EB [04] 0F 5B 75 4E can0 0B113B2C [12] EE CE AD 18 45 E6 DA 29 EE CE AD 18 can0 0A4F70CE [07] 08 EA 4F 03 76 28 3A can0 1CAAADD7 [03] 75 1E CC can0 0FB773F2 [06] EA F5 20 46 A3 1E can0 30D [08] 24 3E EA 0C A6 AE 1E 77 can0 7C0 [1] 28 can0 0946B4C3 [8] DE A1 D3 5A B1 83 F4 01 can0 039AA5A9 [0] can0 10C [12] 89 03 6C 3C 81 EF 29 3A 89 03 6C 3C can0 1E1 [3] DE 59 03 can0 564 [12] 7E 6A 3C 3F 88 73 31 18 7E 6A 3C 3F can0 00D73902 [08] 10 FF 72 16 2B FB 81 0A can0 315 [8] remote request can0 055 [8] 20 28 01 22 9D 40 79 57 can0 117F4516 [12] D8 97 5D 44 9F 48 EB 2D D8 97 5D 44 can0 280 [00] can0 6B4 [2] 25 0D can0 0F4EA6A4 [05] 93 30 4B 62 B4 can0 6AB [8] 4F 35 B0 7B BF AA 57 64 can0 0EF [4] remote request can0 2A8 [05] 5B 7D FD 52 81 [......] (3)查看总线can0状态 root@okg2l:~# ip -details -statistics link show can0 2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 72 qdisc pfifo_fast state UP mode DEFAULT group default qlen 10 link/can promiscuity 0 minmtu 0 maxmtu 0 can <FD> state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0 bitrate 498750 sample-point 0.870 tq 20 prop-seg 43 phase-seg1 43 phase-seg2 13 sjw 1 rcar_canfd: tseg1 2..128 tseg2 2..32 sjw 1..32 brp 1..1024 brp-inc 1 dbitrate 1995000 dsample-point 0.680 dtq 20 dprop-seg 8 dphase-seg1 8 dphase-seg2 8 dsjw 1 rcar_canfd: dtseg1 2..16 dtseg2 2..8 dsjw 1..8 dbrp 1..256 dbrp-inc 1 clock 49875000 re-started bus-errors arbit-lost error-warn error-pass bus-off 0 0 0 0 0 0 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 RX: bytes packets errors dropped overrun mcast 1379 116 0 0 0 0 TX: bytes packets errors dropped carrier collsns 0 0 0 0 0 0 (4)设置总线的 bus-off 复位时间: root@okg2l:~# ifconfig can0 down read: Network is down [1]+ Done(1) candump can0 root@okg2l:~# ip link set can0 type can restart-ms 100 root@okg2l:~# ip -details -statistics link show can0 2: can0: <NOARP,ECHO> mtu 72 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 10 link/can promiscuity 0 minmtu 0 maxmtu 0 can <FD> state STOPPED (berr-counter tx 0 rx 0) restart-ms 100 bitrate 498750 sample-point 0.870 tq 20 prop-seg 43 phase-seg1 43 phase-seg2 13 sjw 1 rcar_canfd: tseg1 2..128 tseg2 2..32 sjw 1..32 brp 1..1024 brp-inc 1 dbitrate 1995000 dsample-point 0.680 dtq 20 dprop-seg 8 dphase-seg1 8 dphase-seg2 8 dsjw 1 rcar_canfd: dtseg1 2..16 dtseg2 2..8 dsjw 1..8 dbrp 1..256 dbrp-inc 1 clock 49875000 re-started bus-errors arbit-lost error-warn error-pass bus-off 0 0 0 0 0 0 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 RX: bytes packets errors dropped overrun mcast 1379 116 0 0 0 0 TX: bytes packets errors dropped carrier collsns 0 0 0 0 0 0 (5)设置发送队列长度: root@okg2l:~# ip link set dev can0 txqueuelen 100 root@okg2l:~# ip -details -statistics link show can0 2: can0: <NOARP,ECHO> mtu 72 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 100 link/can promiscuity 0 minmtu 0 maxmtu 0 can <FD> state STOPPED (berr-counter tx 0 rx 0) restart-ms 100 bitrate 498750 sample-point 0.870 tq 20 prop-seg 43 phase-seg1 43 phase-seg2 13 sjw 1 rcar_canfd: tseg1 2..128 tseg2 2..32 sjw 1..32 brp 1..1024 brp-inc 1 dbitrate 1995000 dsample-point 0.680 dtq 20 dprop-seg 8 dphase-seg1 8 dphase-seg2 8 dsjw 1 rcar_canfd: dtseg1 2..16 dtseg2 2..8 dsjw 1..8 dbrp 1..256 dbrp-inc 1 clock 49875000 re-started bus-errors arbit-lost error-warn error-pass bus-off 0 0 0 0 0 0 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 RX: bytes packets errors dropped overrun mcast 1379 116 0 0 0 0 TX: bytes packets errors dropped carrier collsns 0 0 0 0 0 0 6.Watchdog测试 (1)启动开门狗并喂狗,系统不会重启 root@okg2l:~# fltest_watchdog Watchdog Ticking Away! ^C[ 105.268110] watchdog: watchdog0: watchdog did not stop! 看门狗进程没有停止,在后台执行 (2)停止后台看门狗进程,执行 root@okg2l:~# fltest_watchdog -d Watchdog card disabled. (3)启动开门狗并不喂狗,系统10s后会重启 root@okg2l:~# fltest_watchdogrestart 7.RTC测试 root@okg2l:~# date Wed Oct 26 10:32:42 CST 2022 root@okg2l:~# date -s "2022-10-25 10:40:00" Tue Oct 25 10:40:00 CST 2022 root@okg2l:~# date Tue Oct 25 10:40:02 CST 2022 8.TF卡测试 开发板插入一块8G 文件格式vfat的TF卡 root@okg2l:~# fdisk -l Device Boot Start End Sectors Size Id Type /dev/mmcblk1p1 2048 15124479 15122432 7.2G c W95 FAT32 (LBA) 自动挂载到目录/run/media/mmcblk1p1 root@okg2l:~# df -h Filesystem Size Used Avail Use% Mounted on /dev/root 14G 665M 13G 5% / devtmpfs 743M 0 743M 0% /dev tmpfs 935M 0 935M 0% /dev/shm tmpfs 935M 9.9M 926M 2% /run tmpfs 935M 0 935M 0% /sys/fs/cgroup tmpfs 935M 8.0M 927M 1% /tmp tmpfs 935M 152K 935M 1% /var/volatile tmpfs 187M 0 187M 0% /run/user/0 /dev/mmcblk1p1 7.2G 324M 6.9G 5% /run/media/mmcblk1p1 写测试 root@okg2l:~# dd if=/dev/zero of=/run/media/mmcblk1p1/test bs=1M count=10 conv=fsync oflag=direct 10+0 records in 10+0 records out 10485760 bytes (10 MB) copied, 11.4723 s, 914 kB/s 读测试 root@okg2l:~# dd if=/run/media/mmcblk1p1/test of=/dev/null bs=1M iflag=direct 10+0 records in 10+0 records out 10485760 bytes (10 MB) copied, 1.37935 s, 7.6 MB/s 卸载 root@okg2l:~# umount /run/media/mmcblk1p1/ 9.USB接口读写U盘测试 与TF卡测试类似 10.休眠测试 root@okg2l:~# echo enabled > /sys/class/tty/ttySC0/power/wakeup root@okg2l:~# echo mem > /sys/power/state 进入休眠状态前,开发板静态工作电流250mA 进入休眠状态后,开发板静态工作电流190mA 敲击调试串口键盘可以唤醒开发板
|