操作与出错信息如下:
[root@Loongson-GD:~]# ifconfig can0 down
[root@Loongson-GD:~]# ip link set can0 up type can bitrate 250000
ip: either "dev" is duplicate, or "type" is garbage
[root@Loongson-GD:~]# ifconfig can0 up
[ 1408.592235] sja1000_platform 1fe00c00.can can0: bit-timing not yet defined
ifconfig: SIOCSIFFLAGS: Invalid argument
[root@Loongson-GD:~]# which ip
/sbin/ip
[root@Loongson-GD:~]# ls -l /sbin/ip
1000 1000 14 Mar 29 2021 /sbin/ip -> ../bin/busybox
搜索了一圈说是busybox
自带的ip
不支持设置can
的速率。需要移植 iproute2
中的ip
。
下载iproute2 交叉编译后,替换busybox
中的ip
,工作正常。