$ ip link set can0 type can bitrate 1000000 dbitrate 3000000 fd on
打印can0信息
$ ip -details link show can0
启动CAN
$ ip link set can0 up
CAN发送
发送(标准帧,数据帧,ID:123,date:DEADBEEF)
$ cansend can0 123#DEADBEEF
发送(扩展帧,数据帧,ID:00000123,date:DEADBEEF)
$ cansend can0 00000123##1DEADBEEF
CAN接收
开启打印,等待接收
$ candump can0
回环模式测试
$ ip link set can0 down
$ ip link set can0 type can bitrate 500000 sample-point 0.8 dbitrate 2000000 sample-point 0.8 fd on loopback on
$ ip -details -statistics link show can0
$ ip link set can0 up
$ echo 4096 > /sys/class/net/can0/tx_queue_len
$ candump can0 &
6 TOPS*@INT8
Support int4/int8/int16/FP16/BF16/TF32
Support deep learning frameworks: TensorFlow, Caffe, Tflite, Pytorch, Onnx NN, Android NN, etc
Debian / Ubuntu
Rockchip 提供 npu 测试脚本
# ls /rockchip-test/npu2
model npu_freq_scaling.sh npu_stress_test.sh npu_test.sh
npu 频率测试脚本 npu_freq_scaling.sh
usage()
{
echo "Usage: npu_freq_scaling.sh [test_second] [every_freq_stay_second]"
echo "example: ./npu_freq_scaling.sh 3600 30"
echo "means npu_freq_scaling.sh will run 1 hour and every cpu frequency stay 30s"
}
示例:npu变频运行60秒,每10秒变频一次
# ./npu_freq_scaling.sh 60 10
test will run 60 seconds
every npu frqeucny will stay 10 seconds
set ddr frequency to 700000000
set ddr frequency to 300000000
set ddr frequency to 700000000
set ddr frequency to 950000000
set ddr frequency to 500000000
set ddr frequency to 700000000
======TEST SUCCESSFUL, QUIT=====
usage: mpi_enc_test [options]
-i input_file input frame file
-o output_file output encoded bitstream file
-w width the width of input picture
-h height the height of input picture
-hstride hor_stride the horizontal stride of input picture
-vstride ver_stride the vertical stride of input picture
-f format the format of input picture
-t type output stream coding type
-tsrc source type input file source coding type
-n max frame number max encoding frame number
-g gop reference mode gop_mode:gop_len:vi_len
-rc rate control mode set rc_mode, 0:vbr 1:cbr 2:fixqp 3:avbr
-bps bps target:min:max set tareget:min:max bps
-fps in/output fps set input and output frame rate
-qc quality control set qp_init:min:max:min_i:max_i
-fqc frm quality control set fqp min_i:max_i:min_p:max_p
-s instance_nb number of instances
-v trace option q - quiet f - show fps
-l loop count loop encoding times for each frame
-ini ini file encoder extra ini config file
-slt slt file slt verify data file
-sm scene mode scene_mode, 0:default 1:ipc
kickpi mpp[3560]: mpi_enc_test: chn 0 encode 100 frames time 4086 ms delay 36 ms fps 24.47 bps 19594276
硬解码测试
mpi_dec_test
usage: mpi_dec_test [options]
-i input_file input bitstream file
-o output_file output decoded frame file
-w width the width of input bitstream
-h height the height of input bitstream
-t type input stream coding type
-f format output frame format type
-n frame_number max output frame number
-s instance_nb number of instances
-v trace option q - quiet f - show fps
-slt slt file slt verify data file
-help help show help
-bufmode buffer mode hi - half internal (default) i -internal e - external
解码H.264 4096x2160 100帧测试
$ mpi_dec_test -t 7 -i test.h264 -n 100
查看结果
$ tail -f /var/log/syslog
kickpi mpp[3564]: mpi_dec_test: decode 100 frames time 596 ms delay 25 ms fps 167.53
解码H.265 4096x2160 100帧测试
$ mpi_dec_test -t 16777220 -i test.h265 -n 100
查看结果
$ tail -f /var/log/syslog
kickpi mpp[3569]: mpi_dec_test: decode 100 frames time 803 ms delay 49 ms fps 124.47
root@ubuntu2004:~# evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0: fe6e0030.pwm
/dev/input/event1: rk805 pwrkey
/dev/input/event2: rockchip-rk809 Headset
/dev/input/event3: hdmi_cec_key
/dev/input/event4: adc-keys
/dev/input/event5: gpio-keys
Select the device event number [0-5]: 5
Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x100
Input device name: "gpio-keys"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 2 (KEY_1)
Key repeat handling:
Repeat type 20 (EV_REP)
Repeat code 0 (REP_DELAY)
Value 250
Repeat code 1 (REP_PERIOD)
Value 33
Properties:
Testing ... (interrupt to exit)
Event: time 1699275783.300685, type 1 (EV_KEY), code 2 (KEY_1), value 1
Event: time 1699275783.300685, -------------- SYN_REPORT ------------
Event: time 1699275783.573759, type 1 (EV_KEY), code 2 (KEY_1), value 2
Event: time 1699275783.573759, -------------- SYN_REPORT ------------
Event: time 1699275783.610429, type 1 (EV_KEY), code 2 (KEY_1), value 2
Event: time 1699275783.610429, -------------- SYN_REPORT ------------
Event: time 1699275783.647094, type 1 (EV_KEY), code 2 (KEY_1), value 2
Event: time 1699275783.647094, -------------- SYN_REPORT ------------
Event: time 1699275783.647094, type 1 (EV_KEY), code 2 (KEY_1), value 0
Event: time 1699275783.647094, -------------- SYN_REPORT ------------