Dear All,
I do have the same problem as jcpep. I can not send or receive CAN bus data on the SABRE Lite board.
Let me give you some information about our system. A colleague of mine did buy a "SABRE Lite" board from boundarydevices.com. We installed one of the available builds, which was offered by boundarydevices. Unfortunately not every available build was bootable, after we have created an SD-Card as described on the corresponding web page. To cut a long story short, my colleague did find a linaro Ubuntu image, which we could install with this USB-Image-tool. (Side note: I also tried to install the Freescale image with this tool, but after creating the SD card the system didn't not boot)
Nevertheless the linaro image boots properly and I can log into the system. On the following you can see the output of
$ cat /proc/version
Linux version 3.0.15-01386-g5c661b1 (ericn@ericsony) (gcc version 4.4.4 (4.4.4_09.06.2010) ) #64 SMP PREEMPT Tue Jun 26 11:16:43 MST 2012
I additionally installed libsocketcan and canutils:
http://www.pengutronix.de/software/libsocketcan/download/libsocketcan-0.0.8.tar.bz2
http://www.pengutronix.de/software/socket-can/download/canutils/v4.0/canutils-4.0.6.tar.bz2
I compiled the sources and everything looks fine. I can theoretically start and configure the can0 interface. On the following you can see the commands and the output on the terminal:
$ sudo canconfig can0 bitrate 500000
can0 bitrate: 500000, sample-point: 0.866
$ sudo ifconfig can0 up
If I check the interface with ifconfig, I get an output like this:
linaro@linaro-ubuntu-desktop /$ ifconfig
can0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-0
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)
Interrupt:142
From my point of view the hardware seems to be configured properly. At least I can not see any error message. Now I tried to test the CAN interface. But unfortunately it didn't work. I connected the board to a PC on which the tool CANalyzer is running. Than I did try to send some data on the CAN bus, but nothing was send.
$ sudo cansend can0 -i0x100 11 22 33 44
interface = can0, family = 29, type = 3, proto = 1
No data could be send. CANalyzer itself works properly, which I did check by connecting another device to it. Also the bitrates are set correctly.
I tried to send the data a couple of times, but nothing changed. When I check the ip statistics I get following output:
$ ip -det -stat link show can0
2: can0: <NO-CARRIER,NOARP,UP,ECHO> mtu 16 qdisc pfifo_fast state DOWN qlen 10
link/can
can state BUS-OFF (berr-counter tx 0 rx 0) restart-ms 0
bitrate 50000 sample-point 0.866
tq 1333 prop-seg 6 phase-seg1 6 phase-seg2 2 sjw 1
flexcan: tseg1 4..16 tseg2 2..8 sjw 1..4 brp 1..256 brp-inc 1
clock 30000000
re-started bus-errors arbit-lost error-warn error-pass bus-off
0 0 0 8 7 7
RX: bytes packets errors dropped overrun mcast
128 16 0 0 0 0
TX: bytes packets errors dropped carrier collsns
20 0 0 0 0 0
There are two interesting observations. Every time when I send some data the bus-off flag is incremented. Than I have to restart the can0 device. The second thing is, that the RX bytes are always increased by 8.
I also tried to send data on the can0 interface, when there was no device connected on the CAN bus interface of the SABRE Lite board. The behavior was the same. The bus-off flag was incremented and also the RX bytes increased by 8. I am still wondering, why there are 8 bytes at RX, although there was no device connected.
I also tried to read data on the can0 interface. But unfortunately also nothing happened.
$ sudo canecho can0 -v
interface-in = can0, interface-out = can0, family = 29, type = 3, proto = 1
$ sudo candump can0
interface = can0, family = 29, type = 3, proto = 1
I also did run the example mentioned by Gurumoorthi Rasiah. Of course I did change the device to can0. But nothing happened. I also checked the cable connection. But as mentioned before, I also get the same behavior, if even there is no device connected. I looked in the web for solutions. Unfortunately I could find a solution. I would be very grateful, if you can give me some hints to fix this problem. Honestly speaking I am new to the CAN bus and embedded PC's. I would appreciate, if you can give me detailed information. If there is another (Ubuntu Desktop like) Linux image, which can be easily installed on a 16GB SD-Card (by just copying it or diskdumping it) that would be great, too.
Thank you in advance for your efforts.
Bye Oezguer