`
hyshucom
  • 浏览: 802837 次
文章分类
社区版块
存档分类
最新评论

arm-linux MCP2515 Can Bus tools with iproute2

 
阅读更多

1)git clone git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git

2)vim Makefile

CC = arm-linux-gcc
AR= arm-linux-ar
LD= arm-linux-ld
AS= arm-linux-as
RANLIB= arm-linux-ranlib
HOSTCC=arm-linux-gcc

3)Make


4)copy ip/ip binary to Board


5)use Ip in arm linux board

[root@FriendlyARM /]# ./ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
link/ether 08:90:90:90:90:90 brd ff:ff:ff:ff:ff:ff
3: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN qlen 10
link/can
4: usb0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
link/ether 06:5a:30:ed:3e:48 brd ff:ff:ff:ff:ff:ff
[root@FriendlyARM /]# ./ip link set can0 up type can bitrate 250000
mcp251x spi0.0: CNF: 0x01 0xb5 0x01
[root@FriendlyARM /]# ifconfig can0 up
[root@FriendlyARM /]# ifconfig can0
can0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
UP RUNNING 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)


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics