Hi all,
Add socketcan-users and avolkov in the loop.
1. Kernel version 2.6.39-rc7
2.CAN utils:
libsocketcan-0.0.8.tar.gz
canutils-4.0.6.tar.bz2
3. Test step:
(1) Do a cable to connect two fsl_imx25pdk board through CAN BUS interface,
The RX pin for The CAN BUS of baord1 connect to The TX pin
for the board2. The TX pin for The CAN BUS of baord1 connect to The RX pin
for the board2. as following:
(2) start can0 device
root@localhost:/root> ip link set can0 type can bitrate 500000
root@localhost:/root> ifconfig can0 up
root@localhost:/root> ifconfig
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:64
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
eth1 Link encap:Ethernet HWaddr 00:04:9F:00:F6:85
inet addr:128.224.163.143 Bcast:128.224.163.255
Mask:255.255.254.0
inet6 addr: fe80::204:9fff:fe00:f685/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:32699 errors:0 dropped:0 overruns:0 frame:0
TX packets:13310 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:32742183 (31.2 MiB) TX bytes:2294256 (2.1 MiB)
Interrupt:192
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:560 (560.0 b) TX bytes:560 (560.0 b)
root@localhost:/root>
(3) The first board run candump to receive data.
root@localhost:/usr/canutils/bin> ./candump can0
interface = can0, family = 29, type = 3, proto = 1
(4) The other board run cansend to send can data
root@localhost:/usr/canutils/bin> cat /proc/net/dev
Inter-| Receive | Transmit
face |bytes packets errs drop fifo frame compressed multicast|bytes
packets errs drop fifo colls carrier compressed
lo: 560 8 0 0 0 0 0 0
560 8 0 0 0 0 0 0
can0: 0 0 0 0 0 0 0 0
90 14 0 0 0 0 0 0
eth0: 0 0 0 0 0 0 0 0
1180 2 0 0 0 0 0 0
eth1: 34574162 42679 0 0 0 0 0 10215
3002895 17229 0 0 0 0 0 0
root@localhost:/usr/canutils/bin> ./cansend can0 123#1122334455667788
interface = can0, family = 29, type = 3, proto = 1
root@localhost:/usr/canutils/bin> cat /proc/net/dev
Inter-| Receive | Transmit
face |bytes packets errs drop fifo frame compressed multicast|bytes
packets errs drop fifo colls carrier compressed
lo: 560 8 0 0 0 0 0 0
560 8 0 0 0 0 0 0
can0: 0 0 0 0 0 0 0 0
91 15 0 0 0 0 0 0
eth0: 0 0 0 0 0 0 0 0
1180 2 0 0 0 0 0 0
eth1: 34581833 42758 0 0 0 0 0 10250
3009673 17266 0 0 0 0 0 0
root@localhost:/usr/canutils/bin>
>From above information, The CAN data have already sent successful, But the
receive CAN data board have not any response.
Thanks to everyone who answered my question.
_______________________________________________
Socketcan-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-users