登录Buildroot后,打印出这个
ip: either "dev" is duplicate, or "type" is garbage
ip: either "dev" is duplicate, or "txqueuelen" is garbage
[ 12.695775] c_can_platform ffc00000.can can0: bit-timing not yet defined
[ 12.705218] c_can_platform ffc00000.can can0: failed to open can device
ifconfig: SIOCSIFFLAGS: Invalid argument
[root@buildroot]:~$:terminate called after throwing an instance of 'std::string'
我在启动脚本里有配置can波特率,但是无法生效,手动设置波特率,执行
ip link set can0 type can bitrate 1000000
回复ip: either "dev" is duplicate, or "type" is garbage
但是ifconfig -a倒是可以看到有can0
can0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
NOARP MTU:16 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:10
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:33
解决方法:执行 ip link set can0 type can bitrate 125000 命令不成功,是因为buildroot默认生成的ip命令不支持配置can。构建root时,在Target ->Networking->勾选iproute2选项,再次编译生成的文件系统里的ip命令就可以执行了。