Kernel:2.6.29
MCU:s3c6410
Can Driver:SocketCan
Chip:mcp2515
使用两个Can通信,使用cansend 发送测试,工作正常.
[root@Tommy canbustest]# 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:1 errors:0 dropped:0 overruns:0 frame:0
TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:10
RX bytes:8 (8.0 B) TX bytes:8 (8.0 B)
我们进入开发板A:
[root@Tommy canbustest]# pwd
/testResource/canbustest
[root@Tommy canbustest]# ./ip link set can0 type can bitrate 125000
[root@Tommy canbustest]# ifconfig can0 up
mcp251x spi0.0: CNF: 0x03 0xb5 0x01
[root@Tommy canbustest]# ./cansend can0 111#1122334455667788
[root@Tommy canbustest]# ifconfig can0 up
[root@Tommy canbustest]# 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)
--->我们开发板B还没有打开,所以发的数据都在buffer里面.
tommy.hung 2011-11-03 17:35:32:
我们进入开发板B:
[root@Tommy canbustest]# ./ip link set can0 type can bitrate 125000
[root@Tommy canbustest]# ifconfig can0 up
mcp251x spi0.0: CNF: 0x03 0xb5 0x01
[root@Tommy canbustest]# 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:1 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:8 (8.0 B) TX bytes:0 (0.0 B)
(接收到开发板A传过来的报文)
tommy.hung 2011-11-03 17:35:38:
我们再进入开发板A:
[root@Tommy canbustest]# 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:1 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:10
RX bytes:0 (0.0 B) TX bytes:8 (8.0 B)