本文主要是介绍龙芯L2K0300开发板综合测试,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
CPU
查看cpu版本信息
cat /proc/cpuinfo
可以看到cpu是64位的LoongsonArch架构
stress压力测试结果
RAM
久久派板载512MB DDR4-2666内存,查看内存信息
cat /proc/meminfo
可以用memtester进行内存性能测试
memtester <size> <times>
memtester测试结果
FLASH
查看磁盘/分区大小
fdisk -l
df -lh
挂载点
mount # 查看挂载点
mount -o remount,ro / # 只读挂载分区
mount -o remount,rw / # 读写挂载分区
可以使用lmbench里边的lmdd命令查看写入速度
./lmdd if=internal of=/home/root/test count=1000 bs=1M fsync=1
NET
Ethernet
查看网卡信息
ethtool eth0
确认eth0支持千兆以太网
开启、禁用网卡
ifconfig eth0 up
ifconfig eth0 down
修改MAC地址
ifconfig eth0 down
ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx
ifconfig eth0 up
添加网关
route add default gw 192.168.137.1
删除网关
route del default gw xx:xx:xx:xx
下载iperf3.9并配置交叉编译,完成后部署到开发板
wget -O config.sub "git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD"
wget -O config.guess "git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD"export PATH=$PATH:/home/asensing/loongson/loongson-gnu-toolchain-8.3-x86_64-loongarch64-linux-gnu-rc1.3-1/bin
./configure --prefix=$PWD/build --host=loongarch64-linux-gnu CC=loongarch64-linux-gnu-gcc CXX=loongarch64-linux-gnu-g++ LD=loongarch64-linux-gnu-ld AR=loongarch64-linux-gnu-ar --disable-dependency-tracking --without-opensslmake
在开发板和虚拟机分别udp测试
./iperf3 -s -i 1 -p 9009 # 开发板
iperf3 -u -c 192.168.137.204 -b 120m -t 10 -p 9009 # 虚拟机
udp测试结果
在开发板和虚拟机分别tcp测试
./iperf3 -s # 开发板
iperf3 -c 192.168.137.204 -p 5201 -t 10 -i 5 # 虚拟机
tcp测试结果
WLAN
iw命令扫描周围热点信息
iw dev
ip link show wlan0
iw wlan0 scan | grep SSID
通过wpa方式连接wifi
wpa_supplicant -D nl80211 -i wlan0 -c /etc/wpa_supplicant.conf -B
wpa_supplicant -B -i wlan0 -c<(wpa_passphrase "hywing" "12345678")
udhcpc -i wlan0
CAN
配置can2.0
ip link set can0 down
ip link set up can0 type can bitrate 500000 berr-reporting on loopback off
ip link set can0 up
配置canfd
ip link set can0 down
ip link set can0 type can bitrate 1000000 sample-point 0.8 dbitrate 1000000 dsample-point 0.8 fd on restart-ms 1000
ip link set can0 up
发送数据
cansend can0 45#1122334455667788
接收数据
candump can0
外设
GPIO
配置
echo 1 > /sys/class/gpio/gpio48/value
echo /sys/class/gpio/gpio48/value
echo 48 > /sys/class/gpio/export
i2c
查看总线上挂载的从设备
i2cdetect -y 0
读取寄存器
i2cget -f -y 0 0x51 0x02
写寄存器
i2cset -y 0 0x51 0x00 0x00
adc
读取adc指定通道的电压值
while truedovol_raw=$(cat /sys/bus/iio/devices/iio\:device0/in_voltage0_raw)vol_scale=$(cat /sys/bus/iio/devices/iio\:device0/in_voltage_scale)#vol=$(echo "scale=3.3; $vol_raw*$vol_scale/1000" | bc )#echo "vol_raw:$vol_raw,vol_scale:$vol_scale,vol:$vol V"echo $vol_raw, $vol_scalesleep 1sdone
pwm
配置pwm脉冲周期、占空比
num=1
while true
doecho 0 > /sys/class/pwm/pwmchip1/pwm0/enableecho 100000 > /sys/class/pwm/pwmchip1/pwm0/periodecho $num > /sys/class/pwm/pwmchip1/pwm0/duty_cycleecho "inversed" sys/erclass/pwm/pwmchip1/pwm0/polarityecho 1 > /sys/class/pwm/pwmchip1/pwm0/enablesleep 0.1let num+=50
done
uart
配置串口
stty -F /dev/ttyS1 speed 9600 cs8 -parenb -cstopb raw -echo -echoe -echok -echoctl -echoke
读取串口
cat /dev/ttyS1
RTC
写入时间
hwclock -f /dev/rtc1 -w
读取时间
date
i2s
查看声卡设备列表
aplay -l
播放音乐
aplay test.wav
录音
arecord -d 10 -r 48000 -c 2 -f S16_LE audio.wav
开源工具
UnixBench
代码地址:https://github.com/imadcat/UnixBench_5.1.3.git
交叉编译
export PATH=$PATH:/home/asensing/loongson/loongson-gnu-toolchain-8.3-x86_64-loongarch64-linux-gnu-rc1.3-1/bin
make CC=loongarch64-linux-gnu-gcc
memtester
下载地址:https://pyropus.ca./software/memtester/old-versions/memtester-4.6.0.tar.gz
交叉编译
export PATH=$PATH:/home/asensing/loongson/loongson-gnu-toolchain-8.3-x86_64-loongarch64-linux-gnu-rc1.3-1/bin
loongarch64-linux-gnu-gcc *.c *.h -o memtester
lmbench
下载地址:lmbench download | SourceForge.net
交叉编译
export PATH=$PATH:/home/asensing/loongson/loongson-gnu-toolchain-8.3-x86_64-loongarch64-linux-gnu-rc1.3-1/bin
make CC=loongarch64-linux-gnu-gcc
stress
下载地址:container-stress/stress-1.0.4.tar.gz at master · mohsenmottaghi/container-stress (github.com)
交叉编译
export PATH=$PATH:/home/asensing/loongson/loongson-gnu-toolchain-8.3-x86_64-loongarch64-linux-gnu-rc1.3-1/bin
./configure --prefix=$PWD/build --host=loongarch64-linux-gnu CC=loongarch64-linux-gnu-gcc CXX=loongarch64-linux-gnu-g++ LD=loongarch64-linux-gnu-ld AR=loongarch64-linux-gnu-ar
make
这篇关于龙芯L2K0300开发板综合测试的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!