Feldspar17
Posts: 4
Joined: Tue Dec 16, 2014 5:08 pm

Re: CAN controller

Tue Dec 16, 2014 5:25 pm

sun-tracker wrote:All,

I think I'm very close to having a functional PICAN setup.
From the multiple posts in this thread and the http://lnxpps.de/rpie/ page, everything seems to be looking good as far as configuration and bringing up the can0 interface.

Now, I just need your HELP in understanding the solder joints (SJ1, SJ2, SJ3) and Jumpers (JP1, JP3) on the board.
Naturally I am using the schematic here: http://skpang.co.uk/catalog/images/rasp ... _rev_B.pdf

SK Pang makes another CANBus devices (not for the RPI) and provided this image for it: http://skpang.co.uk/catalog/images/mbed ... config.png
Seeing as how the pin references are identical to the PICAN schematic, should I be soldering the left sides of each of the solder joints? Do I need to do anything with the jumpers?
My preference is to use the DB9 cable since it carries CAN_H and CAN_L lines...

Bottom Line: Please help me determine what I need to do with the Solder Joints and Jumpers on the PICAN board!


UPDATE: I have a fully functional PICAN now (so far). Candump works without issue. I soldered the left sides of each of the 3 pads below the DB9 connector to use the OBD-II pin configuration. Working great at this time.
Hi sun-tracker, I hope you log in and see this reply. :) I used your post here to try and help me figure out why I wasn't getting any data from candump with my PICAN board. I tried soldering the three pads in the way you suggested, but I still get nothing from candump. However, when I run ip -d -s link show can0, it tells me that there has been some data received (at most, about 800-1000 bytes usually), but I can never see that data. Is soldering the pads the ONLY thing you did, or did you mess with the jumpers at all? I've got the configuration correct I believe on the kernel side of things, I just can't figure out why there's no data when it's plugged into my car with a DB9-OBDII cable. Thanks for any help anybody can provide!

Gasmotten
Posts: 2
Joined: Wed Dec 17, 2014 11:23 am

Re: CAN controller

Wed Dec 17, 2014 12:54 pm

Hi to everyone,

I'm doing a project with Raspberry Pi a PICAN Board and a Wifi dongle.
Features:
- Raspberry Pi B+ (kernel 3.12.28+)
- PICAN Board
- EDIMAX EW-7811Un (8192cu module)

I have readed all the posts, and they helped to configure all. I want to read the can bus and send a file ('.log') by Wifi.
But now, I'm stuck. I don't know how to make compatible the WIFI dongle with the Pi.

I tried to configure the PICAN Board with two different methods:
1) Install and configure all the modules following the instructions of http://skpang.co.uk/catalog/pican-canbu ... -1196.html.
Problem: The "can0" works fine, I can read it but the kernel changed to 3.1.9++. I have not been able to configure the wifi connection, beacuase "wlan0" doesn't appear in >>$ ifconfig.

2) Install and configure all the modules following the instructions of http://lnxpps.de/rpie/rpi-can-3.12.28+.tar.bz2.
Problem: The Kernel has the 3.12.28+ version, in this case, the wifi connection works fine but the PICAN Board doesn't work, I can't read the CAN BUS becasuse doesn´t recognized the 'mcp251x' module, this module is the transceiver.
I tried to copy the files inside "rpi-can-3.12.28+.tar.bz2" in my Raspy through 'Filezila', but this didn't work

Could anybody help me??

Thanks in advanced!

Eric

User avatar
robin48gx
Posts: 15
Joined: Mon Jul 16, 2012 11:20 am
Location: Brighton

Re: CAN controller

Mon Dec 29, 2014 10:45 am

we (at work on picomod6) had a similar problem with MCP2515 reception and it was fixed by changing the interrupt triggering from falling edge to level.

pauldcox
Posts: 2
Joined: Sat Nov 08, 2014 9:31 am

Re: CAN controller

Mon Jan 05, 2015 5:42 pm

As with Gasmutten above, I'm unable to get wifi and can0 working simultaneously. My hardware is mcp251x based skpang PICAN with Pi model B+. Anyone have any suggestions on what to try or what details we can post to help debug?

Also seeing the interface wedge from time to time under heavy traffic so will look into the interrupt edge/level suggestion unless someone has other suggestions? Maybe someone can explain how to get spi/can debug messages to be logged so I can figure out where in the driver things go bad...

Paul

dibelardino
Posts: 4
Joined: Wed Jan 07, 2015 7:40 am

Re: CAN controller

Wed Jan 07, 2015 2:45 pm

I am using Can Bus with a CAN SPI CLICK board.
http://www.mikroe.com/click/can-spi-5v/
After various unsuccessful try to install the mcp2515 library, I decided to write the software from the scratch.
So I wrote the initialization routine and the readMessage and writeMessage software, everything in Python.
For what I can see, one ef the biggest problem is that python is very slow, and in heavy traffic, a new message interrupt arrives when the software has not finished reading the previous one.
If a new interrupt arrives before the software has cleared the flag, the level of the INT pin is maintained LOW, and there is not a new "falling edge". In the depicted situation we are "stalled". There is a new interrupt, but the software doesn't detect it because of the missing falling edge.
I solved the problem in this way:
after the interrupt I do one readMsg() that reads the message and clear the interrupt flag, after that:

while True:
reg = readRegister (0x2c) # reads the register where the IRQ flags are
if reg & 0x01 or reg & 0x02: #if it finds that a new interrupt is rised
print readMsg() #reads an other message
else:
break # break occurs when there are no more interrupt flag rised

The correct solution would be to have a faster software rather than find tricks.
I read that there are some compilers for python. Maybe the compiled software would be fast enough to read the message before the next one.

Hope my English is clear enough for the topic.
regards Marco

Gasmotten
Posts: 2
Joined: Wed Dec 17, 2014 11:23 am

Re: CAN controller

Wed Jan 07, 2015 10:33 pm

Hi guys,

I find the way to work simultaneously, mcp251x and WiFi dongle. I try this code (RPi kernel: 3.12.28+ #709):

Code: Select all

cd /tmp; sudo wget http://lnxpps.de/rpie/rpi-can-3.12.28+.tar.bz2
cd /; sudo tar jxvf /tmp/rpi-can-3.12.28+.tar.bz2
sudo depmod -a
sudo reboot

Code: Select all

sudo nano /etc/modules
Copy all the text:

Code: Select all

# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
# Parameters can be specified after the module name.

snd-bcm2835
spi_bcm2708

# MCP2515 configuration for PICAN module
spi-config devices=\
bus=0:cs=0:modalias=mcp2515:speed=500000:gpioirq=25:pd=20:pds32-0=16000000:pdu32-4=0x2002:force_release

# load the module
mcp251x
Enter this code:

Code: Select all

sudo nano /etc/modprobe.d/raspi-blacklist.conf
Activated the following modules:

Code: Select all

# blacklist spi and i2c by default (many users don't need them)

#blacklist spi-bcm2708
blacklist i2c-bcm2708
#blacklist mcp251x
Reboot your RPi, and configure the PICAN board with the following commands (if you want, can create a script, follow this link: http://www.stuffaboutcode.com/2012/06/r ... rt-up.html):

Code: Select all

sudo ip link set can0 type can bitrate 500000 
sudo ip link set can0 up
Thanks a lot for all posts, Now my problem is transfer the '*.log' file via WiFi.
Anyone can help me?

Gasmotten

optimax
Posts: 2
Joined: Sat Sep 27, 2014 9:52 am

Re: CAN controller

Thu Jan 08, 2015 2:06 pm

Personally, I stopped fiddling with CAN bus on the Raspberry Pi. Just could not get it work reliably for more than a few hours. Then, one way or another, it would just hang. Tried many drivers, have recompiled most of them from scratch... to no avail.

I have switched to BeagleBone Black for CAN bus related projects. CAN works first time with the BBB (no need to compile or install anything), and is very stable (weeks of continuous running without a glitch so far...).
I still use the Raspberry Pi for a lot of other projects (it's a great little platform), as long as there is no CAN bus involved...

If you are happing fiddling with CAN, fine. If you want reliable CAN, BBB is definitely a premium candidate platform.

I hope this brings some light in your projects...

albenac
Posts: 1
Joined: Fri Jan 09, 2015 10:29 am

Re: CAN controller

Sat Jan 10, 2015 1:15 pm

Has anyone interface this Can Bus module?
Using wiringPi libraries?

Bye Alberto

dibelardino
Posts: 4
Joined: Wed Jan 07, 2015 7:40 am

Re: CAN controller

Wed Jan 14, 2015 9:04 pm

albenac wrote:Has anyone interface this Can Bus module?
Using wiringPi libraries?

Bye Alberto
Yes I did.
After spending some days trying to work with the mcp2515 library (without any success) I decided to write the python software by myself, using only the spidev library.
My software is for the CAN SPI CLICK board.
http://www.mikroe.com/click/can-spi-5v/
It works ,but it is very slow.

TeeTrinker
Posts: 6
Joined: Tue Jan 13, 2015 8:34 am

Re: CAN controller

Thu Jan 15, 2015 1:19 pm

Hey guys,
I am using PI-CAN and configured it like shown on this http://lnxpps.de/rpie/ page. I do have the same stats as the example on this page shows in :
ip -s -l link show can0;
lsmod: Used by:
spi config 0
mcp251x 0
can_bcm 0
can_raw 0
can_dev 1 mcp251x
can 2 can_bcm,canraw
spi_bcm2708 0

Interrupts :
195: GPIO mcp251x is shown.
80: bcm2708_spi.0 is shown.
dmesg shows the same as the website does.

The problem is :
$sudo candump any,0:0, #FFFFFFFF
sudo:candump:command not found

the candump:command not found message shows up everytime. I used every version of candump that was successfully used in this forum and more.
What could be wrong? I havent seen any problems with that command in this forum yet, at least not a comment to candump/cansend being unknown to the Kernel.
Kernel Version: 3.12.35+

Thanks,
TeeTrinker

PS:
sry I cannot show my messages directly out of the terminal. My raspberry has no connection to the internet and i dont have a USB-stick. Because of that i had to retype it. There is no way i am going to retype a whole dmesg. Hope it is still enough information for you guys ;)

EDIT:
Solved the problem. I didnt have the X rights on the executable file.

$chmod 777 candump

SUMIT GARETHIYA
Posts: 4
Joined: Mon Nov 24, 2014 4:42 am

Re: CAN controller

Wed Jan 28, 2015 9:16 am

Hello to all ,

i am using a LPC2148 board , to interface GPS and RFID card , i successfully interface a both of these with LPC2148 board serially , now i am trying to get the data from LPC2148 board to raspberry pi , through serially .

but i am fail to do this, please help me to interface raspberrry pi with LPC2148 board serially , so that i can transfer the value from RFID and GPS to raspberry pi..

please help me in this , and provide me a solution

thank you

gulyvz
Posts: 15
Joined: Wed Jan 28, 2015 9:22 am

Re: CAN controller

Wed Jan 28, 2015 9:29 am

TeeTrinker wrote:Hey guys,
I am using PI-CAN and configured it like shown on this http://lnxpps.de/rpie/ page. I do have the same stats as the example on this page shows in :
ip -s -l link show can0;
lsmod: Used by:
spi config 0
mcp251x 0
can_bcm 0
can_raw 0
can_dev 1 mcp251x
can 2 can_bcm,canraw
spi_bcm2708 0

Interrupts :
195: GPIO mcp251x is shown.
80: bcm2708_spi.0 is shown.
dmesg shows the same as the website does.

The problem is :
$sudo candump any,0:0, #FFFFFFFF
sudo:candump:command not found

the candump:command not found message shows up everytime. I used every version of candump that was successfully used in this forum and more.
What could be wrong? I havent seen any problems with that command in this forum yet, at least not a comment to candump/cansend being unknown to the Kernel.
Kernel Version: 3.12.35+

Thanks,
TeeTrinker

PS:
sry I cannot show my messages directly out of the terminal. My raspberry has no connection to the internet and i dont have a USB-stick. Because of that i had to retype it. There is no way i am going to retype a whole dmesg. Hope it is still enough information for you guys ;)

EDIT:
Solved the problem. I didnt have the X rights on the executable file.

$chmod 777 candump
Hi, i have same problem and still didnt solve. Could you explain what does it mean X rights on the executable file. When i try "$chmod 777 candump" chmod:cannot access 'candump': no such file or directory messagge shows up.

Thanks,
gulyvz

gulyvz
Posts: 15
Joined: Wed Jan 28, 2015 9:22 am

Re: CAN controller

Wed Jan 28, 2015 12:31 pm

Hi all,

I have same problem like TeeTrinker but i still can not solve. When i type "sudo candump any,0:0, #FFFFFFFF"
i received this message->"sudo:candump:command not found" . and also in my raspberry blacklist mcp251x module doesnt exist.

please help me in this situation.

Thanks
gulyvz

TeeTrinker
Posts: 6
Joined: Tue Jan 13, 2015 8:34 am

Re: CAN controller

Thu Jan 29, 2015 1:30 pm

hi guyvz,

if the lsmod shows the same as before, and the dmesg is right:

try to find out where candump is (whereis candump).
go to that directory: cd /your/directory.
check again on the permission of that file : $ls -al.
if there are no x permissions: sudo chmod 777 candump
if there are the x permissions: ./candump can0 any,0:0,#FFFFFFFF
if the can is recieving anything it is shown, if the bus is empty anyways it just sits there. ctrl+c to kill process. I always prefered to try this stuff out with cansend.

if it works :
check $PATH if /your/directory is within the PATH variable. if not add it:
PATH=$PATH:/your/directory

else: no idea :D

to test communication :
open 2 terminals, one with candump one with cansend. (loopback on)
When this works, your rdy for hardware !

Hope this serves you

TeeTrinker

gulyvz
Posts: 15
Joined: Wed Jan 28, 2015 9:22 am

Re: CAN controller

Thu Jan 29, 2015 3:05 pm

TeeTrinker wrote:hi guyvz,

if the lsmod shows the same as before, and the dmesg is right:

try to find out where candump is (whereis candump).
go to that directory: cd /your/directory.
check again on the permission of that file : $ls -al.
if there are no x permissions: sudo chmod 777 candump
if there are the x permissions: ./candump can0 any,0:0,#FFFFFFFF
if the can is recieving anything it is shown, if the bus is empty anyways it just sits there. ctrl+c to kill process. I always prefered to try this stuff out with cansend.

if it works :
check $PATH if /your/directory is within the PATH variable. if not add it:
PATH=$PATH:/your/directory

else: no idea :D

to test communication :
open 2 terminals, one with candump one with cansend. (loopback on)
When this works, your rdy for hardware !

Hope this serves you

TeeTrinker
Thank you for your reply TeeTrinker. I'm still in a trouble. When i write;

$whereis candump
candump: /usr/local/bin/candump

it showed up this message. Than i write

$cd /usr/local/bin/candump
bash: cd: /usr/local/bin/candump: not a directory

Also when i listed with $lsmod there is no candump file so i didnt check permission. I will try and try again. needs must solve this situation.

TeeTrinker
Posts: 6
Joined: Tue Jan 13, 2015 8:34 am

Re: CAN controller

Thu Jan 29, 2015 3:31 pm

hi guyvz,
$cd usr/local/bin/candump
candump is not a directory, it is the executable!
use that instead:

Code: Select all

$cd usr/local/bin
dont cd the candump!

Greetings
TeeTrinker

gulyvz
Posts: 15
Joined: Wed Jan 28, 2015 9:22 am

Re: CAN controller

Fri Jan 30, 2015 9:14 am

TeeTrinker wrote:hi guyvz,
$cd usr/local/bin/candump
candump is not a directory, it is the executable!
use that instead:

Code: Select all

$cd usr/local/bin
dont cd the candump!

Greetings
TeeTrinker
Hi TeeTrinker,

I have just solved all problem. Thank you for your helping. My can-bus messages are not meaningful beacuse of messages are not from real can-bus but everything is more clear right now. Thank you again.

gulyvz

Feldspar17
Posts: 4
Joined: Tue Dec 16, 2014 5:08 pm

Re: CAN controller

Sat Feb 07, 2015 11:47 pm

I've posted here before, hoping somebody can help me out.

I've got a Pi model B with a PICAN board. I've hooked up wires to the screen pins and an OBDII connector frame (correctly, pin 6 to CAN_H and pin 14 to CAN_L). Whenever I power up the Pi and SSH in from my laptop, ip -d -s link show can0 tells me that data has been received. However, there's only a small amount of packets received and I never receive anymore (until I reboot the RPi, and then I get a different number of packets received). Running candump, I never receive any CAN frames. Here are a couple of screenshots:

http://i.imgur.com/KFsoutV.png
http://i.imgur.com/DhTxcax.png

I followed instructions posted in this thread as far as setting up the kernel modules and all the SocketCAN utils are installed correctly (I can run a virtualCAN and send/receive messages on it). I'm not sure if there's something I'm not setting up correctly, but I'm totally stuck here. I've tried running candump in /etc/rc.local in log mode, trying to grab those frames that pop up when the Pi boots, but the log files are always empty. Any ideas or help would be appreciated.

gulyvz
Posts: 15
Joined: Wed Jan 28, 2015 9:22 am

Re: CAN controller

Fri Feb 13, 2015 1:11 pm

Hi all,
I have a CAN-Bus module ( from SKPang PICAN CAN-Bus board for raspberry). I want to use this module with MCP3008. When i use both of them, CAN module probe failed.

I use GPIO9,10,11, 8, 25 with CAN-Bus module.

Thanks,
gulyvz

msperl
Posts: 344
Joined: Thu Sep 20, 2012 3:40 pm

Re: CAN controller

Sun Feb 22, 2015 5:12 pm

After a long absence here a "trick" that works with the new device-tree enabled kernels which also works on the rpi2 or a device-tree enabled kernel for a RPI1...

Code: Select all

/*
 * Device tree overlay for mcp251x
 */

/dts-v1/;
/plugin/;

/ {
	compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";

	fragment@0 {
		target = <&spi0>;
		__overlay__ {
			status = "okay";

			spidev@0{
				status = "disabled";
			};
		};
	};

	fragment@1 {
		target = <&gpio>;
		__overlay__ {
			can0_pins: can0_pins {
				brcm,pins = <25>;
				brcm,function = <0>; /* input */
			};
		};
	};

	fragment@2 {
		target-path = "/clocks";
		__overlay__ {
			/* external oscillator of mcp2515 on SPI0.0 */
			can0_osc: can0_osc {
			   	compatible = "fixed-clock";
			   	#clock-cells = <0>;
				clock-frequency  = <16000000>;
			};
		};
	};

	fragment@3 {
		target = <&spi0>;
		__overlay__ {
			/* needed to avoid dtc warning */
			#address-cells = <1>;
			#size-cells = <0>;

		        can0: mcp2515@0 {
				reg = <0>;
                		compatible = "microchip,mcp2515";
				pinctrl-names = "default";
				pinctrl-0 = <&can0_pins>;
				spi-max-frequency = <10000000>;
		                interrupt-parent = <&gpio>;
		                interrupts = <25 0x2>;
				clocks = <&can0_osc>;
		        };
		};
	};

	__overrides__ {
		can0_oscillator =	<&can0_osc>,"oscillator-frequency";
		can0_speed =		<&can0>,"spi-max-frequency:0";
		can0_interrupt =	<&can0_pins>,"brcm,pins:0",<&can0>,"interrupts:0";
	};
};
to build it you have to run the following:

Code: Select all

/usr/local/bin/dtc -@ -I dts -O dtb -o /boot/overlays/mcp2515-can0.dtb /boot/overlays/mcp2515-can0.dts
(after saving the above as /boot/overlays/mcp2515-can0.dts)

Note that it requires a patched version of the device-tree-compiler that supports overlays, which you can get via this command:

Code: Select all

curl https://raw.githubusercontent.com/RobertCNelson/tools/master/pkgs/dtc.sh | sh
Then you can enable it via /boot/config.txt:

Code: Select all

dtoverlay=mcp2515-can0
dtparam=spi=on
For different clock parameters you can use:

Code: Select all

dtoverlay=mcp2515-can0,can0_oscillator=16000000,can0_interrupt=25
Now this only means that we have to get the mcp251x driver enabled in the foundation kernel as a module and then you can start using it "transparently"...

Maybe they will also add this as one of the default overlays that they ship - you might need to ask...

Martin

(updated after some communication with the Firmware team)
Last edited by msperl on Sun Feb 22, 2015 7:29 pm, edited 1 time in total.

msperl
Posts: 344
Joined: Thu Sep 20, 2012 3:40 pm

Re: CAN controller

Sun Feb 22, 2015 6:02 pm

See: https://github.com/raspberrypi/firmware/issues/371 for the request to enable CAN drivers in the firmware...

xxethanixx
Posts: 4
Joined: Mon Feb 23, 2015 4:44 am

Re: CAN controller

Mon Feb 23, 2015 4:54 am

Hello All,

I would like to thank this entire community for the support on this subject. I have spent my weekend attempting to configure my pi with the pican board. I seem to be getting pretty close to being able to use this pican board with the canutils, but I cant seem to get any output from candump even when sending sending data to the can device from another terminal. I noticed I have two major issues:

1.) Bit timing not defined - in dmesg (provided below)

2.) no bittiming in the dir: /sys/class/net/can0

root@raspberrypi:/sys/class/net/can0# ls
addr_assign_type addr_len carrier dev_id duplex ifalias iflink mtu operstate power speed subsystem type
address broadcast device dormant flags ifindex link_mode netdev_group phys_port_id queues statistics tx_queue_len uevent


I'm not sure if this has anything to do with my issue, but I have tried just about everything, and still cannot seem to get this to work correctly :( Please help!


Further details:

root@raspberrypi:~# uname -a
Linux raspberrypi 3.12.28+ #709 PREEMPT Mon Sep 8 15:28:00 BST 2014 armv6l GNU/Linux

(full dmesg found below)

[ 166.221222] mcp251x spi0.0: unable to set initial baudrate!
[ 167.222442] mcp251x spi0.0 can0: bit-timing not yet defined
[ 167.222480] mcp251x spi0.0: unable to set initial baudrate!
[ 168.223704] mcp251x spi0.0 can0: bit-timing not yet defined
[ 168.223742] mcp251x spi0.0: unable to set initial baudrate!
[ 169.224965] mcp251x spi0.0 can0: bit-timing not yet defined
[ 169.225003] mcp251x spi0.0: unable to set initial baudrate!
[ 170.226204] mcp251x spi0.0 can0: bit-timing not yet defined
[ 170.226239] mcp251x spi0.0: unable to set initial baudrate!
[ 171.227436] mcp251x spi0.0 can0: bit-timing not yet defined
[ 171.227472] mcp251x spi0.0: unable to set initial baudrate!
[ 172.228669] mcp251x spi0.0 can0: bit-timing not yet defined
[ 172.228708] mcp251x spi0.0: unable to set initial baudrate!
[ 173.229941] mcp251x spi0.0 can0: bit-timing not yet defined
[ 173.229979] mcp251x spi0.0: unable to set initial baudrate!
[ 174.231030] mcp251x spi0.0 can0: bit-timing not yet defined
[ 174.231066] mcp251x spi0.0: unable to set initial baudrate!
root@raspberrypi:~# cat /sys/bus/spi/devices/*/modalias
spi:mcp2515
spi:spidev
root@raspberrypi:~# cat /proc/interrupts
CPU0
3: 7083 ARMCTRL BCM2708 Timer Tick
16: 0 ARMCTRL bcm2708_fb dma
32: 66894 ARMCTRL dwc_otg, dwc_otg_pcd, dwc_otg_hcd:usb1
52: 0 ARMCTRL BCM2708 GPIO catchall handler
65: 28 ARMCTRL ARM Mailbox IRQ
66: 1 ARMCTRL VCHIQ doorbell
75: 1 ARMCTRL
77: 6259 ARMCTRL bcm2708_sdhci (dma)
80: 10 ARMCTRL bcm2708_spi.0
83: 19 ARMCTRL uart-pl011
84: 9725 ARMCTRL mmc0
FIQ: usb_fiq
Err: 0
root@raspberrypi:~# ip -s -d link show can0
4: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN mode DEFAULT qlen 10
link/can
can state STOPPED restart-ms 0
bitrate 0 sample-point 0.000
tq 0 prop-seg 0 phase-seg1 0 phase-seg2 0 sjw 0
mcp251x: tseg1 3..16 tseg2 2..8 sjw 1..4 brp 1..64 brp-inc 1
clock 8000000
re-started bus-errors arbit-lost error-warn error-pass bus-off
0 0 0 0 0 0
RX: bytes packets errors dropped overrun mcast
0 0 0 0 0 0
TX: bytes packets errors dropped carrier collsns
0 0 0 0 0 0


(sorry first time posting (hope this doesn't spam the forum))

root@raspberrypi:~# dmesg
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 3.12.28+ (dc4@dc4-XPS13-9333) (gcc version 4.8.3 20140303 (prerelease) (crosstool-NG linaro-1.13.1+bzr2650 - Linaro GCC 2014.03) ) #709 PREEMPT Mon Sep 8 15:28:00 BST 2014
[ 0.000000] CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cr=00c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
[ 0.000000] Machine: BCM2708
[ 0.000000] cma: CMA: reserved 8 MiB at 1b800000
[ 0.000000] Memory policy: ECC disabled, Data cache writeback
[ 0.000000] On node 0 totalpages: 114688
[ 0.000000] free_area_init_node: node 0, pgdat c061dd90, node_mem_map c06cf000
[ 0.000000] Normal zone: 896 pages used for memmap
[ 0.000000] Normal zone: 0 pages reserved
[ 0.000000] Normal zone: 114688 pages, LIFO batch:31
[ 0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[ 0.000000] pcpu-alloc: [0] 0
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 113792
[ 0.000000] Kernel command line: dma.dmachans=0x7f35 bcm2708_fb.fbwidth=592 bcm2708_fb.fbheight=448 bcm2708.boardrev=0xe bcm2708.serial=0xf06ee0cd smsc95xx.macaddr=B8:27:EB:6E:E0:CD sdhci-bcm2708.emmc_clock_freq=250000000 vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p6 rootfstype=ext4 elevator=deadline rootwait
[ 0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[ 0.000000] Memory: 439532K/458752K available (4498K kernel code, 242K rwdata, 1344K rodata, 143K init, 701K bss, 19220K reserved)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
[ 0.000000] vmalloc : 0xdc800000 - 0xff000000 ( 552 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xdc000000 ( 448 MB)
[ 0.000000] modules : 0xbf000000 - 0xc0000000 ( 16 MB)
[ 0.000000] .text : 0xc0008000 - 0xc05bca24 (5843 kB)
[ 0.000000] .init : 0xc05bd000 - 0xc05e0eac ( 144 kB)
[ 0.000000] .data : 0xc05e2000 - 0xc061e8a0 ( 243 kB)
[ 0.000000] .bss : 0xc061e8ac - 0xc06ce080 ( 702 kB)
[ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] Preemptible hierarchical RCU implementation.
[ 0.000000] NR_IRQS:394
[ 0.000000] sched_clock: 32 bits at 1000kHz, resolution 1000ns, wraps every 4294967ms
[ 0.000000] Switching to timer-based delay loop
[ 0.000000] Console: colour dummy device 80x30
[ 0.000000] console [tty1] enabled
[ 0.001171] Calibrating delay loop (skipped), value calculated using timer frequency.. 2.00 BogoMIPS (lpj=10000)
[ 0.001231] pid_max: default: 32768 minimum: 301
[ 0.001750] Mount-cache hash table entries: 512
[ 0.002574] Initializing cgroup subsys memory
[ 0.002685] Initializing cgroup subsys devices
[ 0.002722] Initializing cgroup subsys freezer
[ 0.002755] Initializing cgroup subsys blkio
[ 0.002904] CPU: Testing write buffer coherency: ok
[ 0.003372] Setting up static identity map for 0xc04487f8 - 0xc0448854
[ 0.005322] devtmpfs: initialized
[ 0.021306] VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 5
[ 0.022887] NET: Registered protocol family 16
[ 0.028213] DMA: preallocated 4096 KiB pool for atomic coherent allocations
[ 0.028898] cpuidle: using governor ladder
[ 0.028945] cpuidle: using governor menu
[ 0.029347] bcm2708.uart_clock = 0
[ 0.031432] hw-breakpoint: found 6 breakpoint and 1 watchpoint registers.
[ 0.031494] hw-breakpoint: maximum watchpoint size is 4 bytes.
[ 0.031529] mailbox: Broadcom VideoCore Mailbox driver
[ 0.031626] bcm2708_vcio: mailbox at f200b880
[ 0.031732] bcm_power: Broadcom power driver
[ 0.031769] bcm_power_open() -> 0
[ 0.031793] bcm_power_request(0, 8)
[ 0.532530] bcm_mailbox_read -> 00000080, 0
[ 0.532569] bcm_power_request -> 0
[ 0.532823] Serial: AMBA PL011 UART driver
[ 0.532997] dev:f1: ttyAMA0 at MMIO 0x20201000 (irq = 83, base_baud = 0) is a PL011 rev3
[ 0.891468] console [ttyAMA0] enabled
[ 0.918599] bio: create slab <bio-0> at 0
[ 0.924138] SCSI subsystem initialized
[ 0.928138] usbcore: registered new interface driver usbfs
[ 0.933845] usbcore: registered new interface driver hub
[ 0.939406] usbcore: registered new device driver usb
[ 0.945981] Switched to clocksource stc
[ 0.950255] FS-Cache: Loaded
[ 0.953421] CacheFiles: Loaded
[ 0.969314] NET: Registered protocol family 2
[ 0.975122] TCP established hash table entries: 4096 (order: 3, 32768 bytes)
[ 0.982536] TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.989128] TCP: Hash tables configured (established 4096 bind 4096)
[ 0.995576] TCP: reno registered
[ 0.998873] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 1.004745] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 1.011519] NET: Registered protocol family 1
[ 1.016504] RPC: Registered named UNIX socket transport module.
[ 1.022464] RPC: Registered udp transport module.
[ 1.027270] RPC: Registered tcp transport module.
[ 1.031993] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 1.039328] bcm2708_dma: DMA manager at f2007000
[ 1.044070] bcm2708_gpio: bcm2708_gpio_probe c05efef0
[ 1.049642] vc-mem: phys_addr:0x00000000 mem_base=0x1ec00000 mem_size:0x20000000(512 MiB)
[ 1.059225] audit: initializing netlink socket (disabled)
[ 1.064733] type=2000 audit(0.910:1): initialized
[ 1.235047] VFS: Disk quotas dquot_6.5.2
[ 1.239410] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[ 1.248380] FS-Cache: Netfs 'nfs' registered for caching
[ 1.255290] NFS: Registering the id_resolver key type
[ 1.260626] Key type id_resolver registered
[ 1.264834] Key type id_legacy registered
[ 1.269643] msgmni has been set to 874
[ 1.275384] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[ 1.283245] io scheduler noop registered
[ 1.287325] io scheduler deadline registered (default)
[ 1.292803] io scheduler cfq registered
[ 1.298016] BCM2708FB: allocated DMA memory 5bc00000
[ 1.303063] BCM2708FB: allocated DMA channel 0 @ f2007000
[ 1.310846] bcm2708_fb_pan_display(0,0) returns=0
[ 1.313085] Console: switching to colour frame buffer device 74x28
[ 1.313635] bcm2708_fb_pan_display(0,0) returns=0
[ 1.336716] bcm2708-dmaengine bcm2708-dmaengine: Load BCM2835 DMA engine driver
[ 1.347262] uart-pl011 dev:f1: no DMA platform data
[ 1.354255] vc-cma: Videocore CMA driver
[ 1.359699] vc-cma: vc_cma_base = 0x00000000
[ 1.365790] vc-cma: vc_cma_size = 0x00000000 (0 MiB)
[ 1.372627] vc-cma: vc_cma_initial = 0x00000000 (0 MiB)
[ 1.388974] brd: module loaded
[ 1.398759] loop: module loaded
[ 1.403541] vchiq: vchiq_init_state: slot_zero = 0xdb800000, is_master = 0
[ 1.414144] Loading iSCSI transport class v2.0-870.
[ 1.421756] usbcore: registered new interface driver smsc95xx
[ 1.429425] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[ 1.636811] Core Release: 2.80a
[ 1.641334] Setting default values for core params
[ 1.647582] Finished setting default values for core params
[ 1.854589] Using Buffer DMA mode
[ 1.859334] Periodic Transfer Interrupt Enhancement - disabled
[ 1.866611] Multiprocessor Interrupt Enhancement - disabled
[ 1.873592] OTG VER PARAM: 0, OTG VER FLAG: 0
[ 1.879370] Dedicated Tx FIFOs mode
[ 1.884567] WARN::dwc_otg_hcd_init:1042: FIQ DMA bounce buffers: virt = 0xdbc14000 dma = 0x5bc14000 len=9024
[ 1.897241] FIQ FSM acceleration enabled for :
[ 1.897241] Non-periodic Split Transactions
[ 1.897241] Periodic Split Transactions
[ 1.897241] High-Speed Isochronous Endpoints
[ 1.919346] dwc_otg: Microframe scheduler enabled
[ 1.919442] WARN::hcd_init:473: FIQ at 0xc0321550
[ 1.925572] WARN::hcd_init:474: FIQ ASM at 0xc0321800 length 36
[ 1.932945] WARN::hcd_init:500: MPHI regs_base at 0xdc806000
[ 1.940076] dwc_otg bcm2708_usb: DWC OTG Controller
[ 1.946438] dwc_otg bcm2708_usb: new USB bus registered, assigned bus number 1
[ 1.956452] dwc_otg bcm2708_usb: irq 32, io mem 0x00000000
[ 1.963378] Init: Port Power? op_state=1
[ 1.968720] Init: Power Port (0)
[ 1.973637] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[ 1.983215] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 1.993285] usb usb1: Product: DWC OTG Controller
[ 1.999477] usb usb1: Manufacturer: Linux 3.12.28+ dwc_otg_hcd
[ 2.006792] usb usb1: SerialNumber: bcm2708_usb
[ 2.013622] hub 1-0:1.0: USB hub found
[ 2.019006] hub 1-0:1.0: 1 port detected
[ 2.024825] dwc_otg: FIQ enabled
[ 2.024844] dwc_otg: NAK holdoff enabled
[ 2.024853] dwc_otg: FIQ split-transaction FSM enabled
[ 2.024874] Module dwc_common_port init
[ 2.025323] usbcore: registered new interface driver usb-storage
[ 2.033265] mousedev: PS/2 mouse device common for all mice
[ 2.041048] bcm2835-cpufreq: min=700000 max=900000 cur=700000
[ 2.048472] bcm2835-cpufreq: switching to governor powersave
[ 2.055582] bcm2835-cpufreq: switching to governor powersave
[ 2.062790] sdhci: Secure Digital Host Controller Interface driver
[ 2.070462] sdhci: Copyright(c) Pierre Ossman
[ 2.076392] sdhci: Enable low-latency mode
[ 2.126047] mmc0: SDHCI controller on BCM2708_Arasan [platform] using platform's DMA
[ 2.136942] mmc0: BCM2708 SDHC host at 0x20300000 DMA 2 IRQ 77
[ 2.144413] sdhci-pltfm: SDHCI platform and OF driver helper
[ 2.151744] ledtrig-cpu: registered to indicate activity on CPUs
[ 2.161534] hidraw: raw HID events driver (C) Jiri Kosina
[ 2.176110] usbcore: registered new interface driver usbhid
[ 2.183272] usbhid: USB HID core driver
[ 2.193236] TCP: cubic registered
[ 2.200091] Initializing XFRM netlink socket
[ 2.207893] NET: Registered protocol family 17
[ 2.213989] Key type dns_resolver registered
[ 2.223140] Indeed it is in host mode hprt0 = 00021501
[ 2.234101] registered taskstats version 1
[ 2.247268] Waiting for root device /dev/mmcblk0p6...
[ 2.277310] mmc0: new high speed SDHC card at address 0002
[ 2.296265] mmcblk0: mmc0:0002 00000 7.32 GiB
[ 2.308827] mmcblk0: p1 p2 < p5 p6 > p3
[ 2.401956] EXT4-fs (mmcblk0p6): mounted filesystem with ordered data mode. Opts: (null)
[ 2.413226] VFS: Mounted root (ext4 filesystem) on device 179:6.
[ 2.431068] devtmpfs: mounted
[ 2.436223] Freeing unused kernel memory: 140K (c05bd000 - c05e0000)
[ 2.446238] usb 1-1: new high-speed USB device number 2 using dwc_otg
[ 2.454421] Indeed it is in host mode hprt0 = 00001101
[ 2.656481] usb 1-1: New USB device found, idVendor=0424, idProduct=9514
[ 2.666636] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 2.677890] hub 1-1:1.0: USB hub found
[ 2.683723] hub 1-1:1.0: 5 ports detected
[ 2.966344] usb 1-1.1: new high-speed USB device number 3 using dwc_otg
[ 3.086552] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00
[ 3.104980] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 3.131055] smsc95xx v1.0.4
[ 3.204285] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-bcm2708_usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:6e:e0:cd
[ 3.306290] usb 1-1.3: new high-speed USB device number 4 using dwc_otg
[ 3.437976] usb 1-1.3: New USB device found, idVendor=7392, idProduct=7811
[ 3.456195] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 3.480950] usb 1-1.3: Product: 802.11n WLAN Adapter
[ 3.495784] usb 1-1.3: Manufacturer: Realtek
[ 3.505600] usb 1-1.3: SerialNumber: 00e04c000001
[ 4.019073] udevd[156]: starting version 175
[ 5.086468] bcm2708_spi bcm2708_spi.0: master is unqueued, this is deprecated
[ 5.293068] bcm2708_spi bcm2708_spi.0: SPI Controller at 0x20204000 (irq 80)
[ 6.209321] bcm2708-i2s bcm2708-i2s.0: Failed to create debugfs directory
[ 7.814742] usbcore: registered new interface driver rtl8192cu
[ 11.360636] EXT4-fs (mmcblk0p6): re-mounted. Opts: (null)
[ 11.832753] EXT4-fs (mmcblk0p6): re-mounted. Opts: (null)
[ 12.786682] spi_config_register: device description: bus=0:cs=0:modalias=mcp2515:speed=10000000:gpioirq=25:pd=20:pds32-0=16000000:pdu32-4=0x2002:force_release
[ 12.805642] spi_config_match_cs: SPI0: check CS=0 to be 0
[ 12.812881] spi_config_match_cs: SPI0.0: Found a device with modinfo spidev
[ 12.822901] spi_config_register:spi0.0:mcp2515: found already registered device
[ 12.833153] spi_config_register:spi0.0:mcp2515: forcefully-releasing already registered device taints kernel
[ 12.848997] spi_config_register:spi0.0: registering modalias=mcp2515 with max_speed_hz=10000000 mode=0 and gpio/irq=25/195
[ 12.880940] spi_config_register:spi0.0:platform data:da2b3e20: 00 24 f4 00 02 20 00 00 00 00 00 00 00 00 00 00 .$... ..........
[ 12.896561] spi_config_register:spi0.0:platform data:da2b3e30: 00 00 00 00 ....
[ 12.939403] CAN device driver interface
[ 13.008351] mcp251x spi0.0: probed
[ 18.590491] FAT-fs (mmcblk0p5): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[ 21.338968] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[ 21.940758] mcp251x spi0.0 can0: bit-timing not yet defined
[ 21.940799] mcp251x spi0.0: unable to set initial baudrate!
[ 21.941209] mcp251x spi0.0 can0: bit-timing not yet defined
[ 21.941236] mcp251x spi0.0: unable to set initial baudrate!
[ 21.941288] mcp251x spi0.0 can0: bit-timing not yet defined
[ 21.941306] mcp251x spi0.0: unable to set initial baudrate!
[ 21.941351] mcp251x spi0.0 can0: bit-timing not yet defined
[ 21.941369] mcp251x spi0.0: unable to set initial baudrate!
[ 21.941414] mcp251x spi0.0 can0: bit-timing not yet defined
[ 21.941432] mcp251x spi0.0: unable to set initial baudrate!
[ 22.945054] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
[ 23.043474] mcp251x spi0.0 can0: bit-timing not yet defined
[ 23.043508] mcp251x spi0.0: unable to set initial baudrate!
[ 24.044719] mcp251x spi0.0 can0: bit-timing not yet defined
[ 24.044757] mcp251x spi0.0: unable to set initial baudrate!
[ 25.045936] mcp251x spi0.0 can0: bit-timing not yet defined
[ 25.046043] mcp251x spi0.0: unable to set initial baudrate!
[ 26.047229] mcp251x spi0.0 can0: bit-timing not yet defined
[ 26.047264] mcp251x spi0.0: unable to set initial baudrate!
[ 27.048440] mcp251x spi0.0 can0: bit-timing not yet defined
[ 27.048479] mcp251x spi0.0: unable to set initial baudrate!
[ 28.049674] mcp251x spi0.0 can0: bit-timing not yet defined
[ 28.049710] mcp251x spi0.0: unable to set initial baudrate!
[ 29.050899] mcp251x spi0.0 can0: bit-timing not yet defined
[ 29.050936] mcp251x spi0.0: unable to set initial baudrate!
[ 30.052143] mcp251x spi0.0 can0: bit-timing not yet defined
[ 30.052181] mcp251x spi0.0: unable to set initial baudrate!
[ 31.053386] mcp251x spi0.0 can0: bit-timing not yet defined
[ 31.053424] mcp251x spi0.0: unable to set initial baudrate!
[ 32.054648] mcp251x spi0.0 can0: bit-timing not yet defined
[ 32.054686] mcp251x spi0.0: unable to set initial baudrate!
[ 32.704411] bcm2835-cpufreq: switching to governor ondemand
[ 32.704444] bcm2835-cpufreq: switching to governor ondemand
[ 33.055892] mcp251x spi0.0 can0: bit-timing not yet defined
[ 33.055929] mcp251x spi0.0: unable to set initial baudrate!
[ 34.056260] mcp251x spi0.0 can0: bit-timing not yet defined
[ 34.056297] mcp251x spi0.0: unable to set initial baudrate!
[ 34.957990] Adding 102396k swap on /var/swap. Priority:-1 extents:1 across:102396k SSFS
[ 35.057495] mcp251x spi0.0 can0: bit-timing not yet defined
[ 35.057533] mcp251x spi0.0: unable to set initial baudrate!
[ 36.058764] mcp251x spi0.0 can0: bit-timing not yet defined
[ 36.058800] mcp251x spi0.0: unable to set initial baudrate!
[ 37.060011] mcp251x spi0.0 can0: bit-timing not yet defined
[ 37.060046] mcp251x spi0.0: unable to set initial baudrate!
[ 38.061253] mcp251x spi0.0 can0: bit-timing not yet defined
[ 38.061288] mcp251x spi0.0: unable to set initial baudrate!
[ 39.062494] mcp251x spi0.0 can0: bit-timing not yet defined
[ 39.062530] mcp251x spi0.0: unable to set initial baudrate!
[ 40.063736] mcp251x spi0.0 can0: bit-timing not yet defined
[ 40.063771] mcp251x spi0.0: unable to set initial baudrate!
[ 41.064976] mcp251x spi0.0 can0: bit-timing not yet defined
[ 41.065014] mcp251x spi0.0: unable to set initial baudrate!
[ 42.066258] mcp251x spi0.0 can0: bit-timing not yet defined
[ 42.066294] mcp251x spi0.0: unable to set initial baudrate!
[ 43.067497] mcp251x spi0.0 can0: bit-timing not yet defined
[ 43.067535] mcp251x spi0.0: unable to set initial baudrate!
[ 44.068742] mcp251x spi0.0 can0: bit-timing not yet defined
[ 44.068781] mcp251x spi0.0: unable to set initial baudrate!
[ 45.069985] mcp251x spi0.0 can0: bit-timing not yet defined
[ 45.070021] mcp251x spi0.0: unable to set initial baudrate!
[ 46.071244] mcp251x spi0.0 can0: bit-timing not yet defined
[ 46.071283] mcp251x spi0.0: unable to set initial baudrate!
[ 47.072498] mcp251x spi0.0 can0: bit-timing not yet defined
[ 47.072536] mcp251x spi0.0: unable to set initial baudrate!
[ 48.073759] mcp251x spi0.0 can0: bit-timing not yet defined
[ 48.073797] mcp251x spi0.0: unable to set initial baudrate!
[ 49.075024] mcp251x spi0.0 can0: bit-timing not yet defined
[ 49.075063] mcp251x spi0.0: unable to set initial baudrate!
[ 50.076277] mcp251x spi0.0 can0: bit-timing not yet defined
[ 50.076315] mcp251x spi0.0: unable to set initial baudrate!
[ 51.077533] mcp251x spi0.0 can0: bit-timing not yet defined
[ 51.077572] mcp251x spi0.0: unable to set initial baudrate!
[ 52.078792] mcp251x spi0.0 can0: bit-timing not yet defined
[ 52.078831] mcp251x spi0.0: unable to set initial baudrate!
[ 53.080058] mcp251x spi0.0 can0: bit-timing not yet defined
[ 53.080097] mcp251x spi0.0: unable to set initial baudrate!
[ 54.081316] mcp251x spi0.0 can0: bit-timing not yet defined
[ 54.081355] mcp251x spi0.0: unable to set initial baudrate!
[ 55.082571] mcp251x spi0.0 can0: bit-timing not yet defined
[ 55.082610] mcp251x spi0.0: unable to set initial baudrate!
[ 56.083826] mcp251x spi0.0 can0: bit-timing not yet defined
[ 56.083865] mcp251x spi0.0: unable to set initial baudrate!
[ 57.085082] mcp251x spi0.0 can0: bit-timing not yet defined
[ 57.085122] mcp251x spi0.0: unable to set initial baudrate!
[ 58.086347] mcp251x spi0.0 can0: bit-timing not yet defined
[ 58.086386] mcp251x spi0.0: unable to set initial baudrate!
[ 59.087603] mcp251x spi0.0 can0: bit-timing not yet defined
[ 59.087642] mcp251x spi0.0: unable to set initial baudrate!
[ 60.088862] mcp251x spi0.0 can0: bit-timing not yet defined
[ 60.088900] mcp251x spi0.0: unable to set initial baudrate!
[ 61.090138] mcp251x spi0.0 can0: bit-timing not yet defined
[ 61.090175] mcp251x spi0.0: unable to set initial baudrate!
[ 62.091395] mcp251x spi0.0 can0: bit-timing not yet defined
[ 62.091434] mcp251x spi0.0: unable to set initial baudrate!
[ 63.092648] mcp251x spi0.0 can0: bit-timing not yet defined
[ 63.092687] mcp251x spi0.0: unable to set initial baudrate!
[ 64.093904] mcp251x spi0.0 can0: bit-timing not yet defined
[ 64.093943] mcp251x spi0.0: unable to set initial baudrate!
[ 65.095162] mcp251x spi0.0 can0: bit-timing not yet defined
[ 65.095200] mcp251x spi0.0: unable to set initial baudrate!
[ 66.096408] mcp251x spi0.0 can0: bit-timing not yet defined
[ 66.096444] mcp251x spi0.0: unable to set initial baudrate!
[ 67.097655] mcp251x spi0.0 can0: bit-timing not yet defined
[ 67.097691] mcp251x spi0.0: unable to set initial baudrate!
[ 68.098917] mcp251x spi0.0 can0: bit-timing not yet defined
[ 68.098982] mcp251x spi0.0: unable to set initial baudrate!
[ 69.100185] mcp251x spi0.0 can0: bit-timing not yet defined
[ 69.100220] mcp251x spi0.0: unable to set initial baudrate!
[ 70.101419] mcp251x spi0.0 can0: bit-timing not yet defined
[ 70.101458] mcp251x spi0.0: unable to set initial baudrate!
[ 71.102675] mcp251x spi0.0 can0: bit-timing not yet defined
[ 71.102716] mcp251x spi0.0: unable to set initial baudrate!
[ 72.103935] mcp251x spi0.0 can0: bit-timing not yet defined
[ 72.103976] mcp251x spi0.0: unable to set initial baudrate!
[ 73.105193] mcp251x spi0.0 can0: bit-timing not yet defined
[ 73.105234] mcp251x spi0.0: unable to set initial baudrate!
[ 74.106453] mcp251x spi0.0 can0: bit-timing not yet defined
[ 74.106494] mcp251x spi0.0: unable to set initial baudrate!
[ 75.107715] mcp251x spi0.0 can0: bit-timing not yet defined
[ 75.107789] mcp251x spi0.0: unable to set initial baudrate!
[ 76.109010] mcp251x spi0.0 can0: bit-timing not yet defined
[ 76.109046] mcp251x spi0.0: unable to set initial baudrate!
[ 77.110245] mcp251x spi0.0 can0: bit-timing not yet defined
[ 77.110283] mcp251x spi0.0: unable to set initial baudrate!
[ 78.111486] mcp251x spi0.0 can0: bit-timing not yet defined
[ 78.111523] mcp251x spi0.0: unable to set initial baudrate!
[ 79.112723] mcp251x spi0.0 can0: bit-timing not yet defined
[ 79.112758] mcp251x spi0.0: unable to set initial baudrate!
[ 80.113966] mcp251x spi0.0 can0: bit-timing not yet defined
[ 80.114000] mcp251x spi0.0: unable to set initial baudrate!
[ 81.115211] mcp251x spi0.0 can0: bit-timing not yet defined
[ 81.115248] mcp251x spi0.0: unable to set initial baudrate!
[ 82.116465] mcp251x spi0.0 can0: bit-timing not yet defined
[ 82.116502] mcp251x spi0.0: unable to set initial baudrate!
[ 83.117779] mcp251x spi0.0 can0: bit-timing not yet defined
[ 83.117817] mcp251x spi0.0: unable to set initial baudrate!
[ 84.119029] mcp251x spi0.0 can0: bit-timing not yet defined
[ 84.119065] mcp251x spi0.0: unable to set initial baudrate!
[ 85.120286] mcp251x spi0.0 can0: bit-timing not yet defined
[ 85.120324] mcp251x spi0.0: unable to set initial baudrate!
[ 86.121539] mcp251x spi0.0 can0: bit-timing not yet defined
[ 86.121577] mcp251x spi0.0: unable to set initial baudrate!
[ 87.122790] mcp251x spi0.0 can0: bit-timing not yet defined
[ 87.122828] mcp251x spi0.0: unable to set initial baudrate!
[ 88.124040] mcp251x spi0.0 can0: bit-timing not yet defined
[ 88.124077] mcp251x spi0.0: unable to set initial baudrate!
[ 89.125291] mcp251x spi0.0 can0: bit-timing not yet defined
[ 89.125328] mcp251x spi0.0: unable to set initial baudrate!
[ 90.126536] mcp251x spi0.0 can0: bit-timing not yet defined
[ 90.126573] mcp251x spi0.0: unable to set initial baudrate!
[ 91.127782] mcp251x spi0.0 can0: bit-timing not yet defined
[ 91.127821] mcp251x spi0.0: unable to set initial baudrate!
[ 92.129038] mcp251x spi0.0 can0: bit-timing not yet defined
[ 92.129077] mcp251x spi0.0: unable to set initial baudrate!
[ 93.130294] mcp251x spi0.0 can0: bit-timing not yet defined
[ 93.130333] mcp251x spi0.0: unable to set initial baudrate!
[ 94.131578] mcp251x spi0.0 can0: bit-timing not yet defined
[ 94.131616] mcp251x spi0.0: unable to set initial baudrate!
[ 95.132835] mcp251x spi0.0 can0: bit-timing not yet defined
[ 95.132871] mcp251x spi0.0: unable to set initial baudrate!
[ 96.134086] mcp251x spi0.0 can0: bit-timing not yet defined
[ 96.134124] mcp251x spi0.0: unable to set initial baudrate!
[ 97.135334] mcp251x spi0.0 can0: bit-timing not yet defined
[ 97.135372] mcp251x spi0.0: unable to set initial baudrate!
[ 98.136590] mcp251x spi0.0 can0: bit-timing not yet defined
[ 98.136630] mcp251x spi0.0: unable to set initial baudrate!
[ 99.137840] mcp251x spi0.0 can0: bit-timing not yet defined
[ 99.137881] mcp251x spi0.0: unable to set initial baudrate!
[ 100.139100] mcp251x spi0.0 can0: bit-timing not yet defined
[ 100.139140] mcp251x spi0.0: unable to set initial baudrate!
[ 101.140357] mcp251x spi0.0 can0: bit-timing not yet defined
[ 101.140398] mcp251x spi0.0: unable to set initial baudrate!
[ 102.141624] mcp251x spi0.0 can0: bit-timing not yet defined
[ 102.141664] mcp251x spi0.0: unable to set initial baudrate!
[ 103.143018] mcp251x spi0.0 can0: bit-timing not yet defined
[ 103.143059] mcp251x spi0.0: unable to set initial baudrate!
[ 104.144273] mcp251x spi0.0 can0: bit-timing not yet defined
[ 104.144313] mcp251x spi0.0: unable to set initial baudrate!
[ 105.145524] mcp251x spi0.0 can0: bit-timing not yet defined
[ 105.145560] mcp251x spi0.0: unable to set initial baudrate!
[ 106.146773] mcp251x spi0.0 can0: bit-timing not yet defined
[ 106.146810] mcp251x spi0.0: unable to set initial baudrate!
[ 107.148028] mcp251x spi0.0 can0: bit-timing not yet defined
[ 107.148065] mcp251x spi0.0: unable to set initial baudrate!
[ 108.149282] mcp251x spi0.0 can0: bit-timing not yet defined
[ 108.149319] mcp251x spi0.0: unable to set initial baudrate!
[ 109.150521] mcp251x spi0.0 can0: bit-timing not yet defined
[ 109.150555] mcp251x spi0.0: unable to set initial baudrate!
[ 110.151758] mcp251x spi0.0 can0: bit-timing not yet defined
[ 110.151791] mcp251x spi0.0: unable to set initial baudrate!
[ 111.152990] mcp251x spi0.0 can0: bit-timing not yet defined
[ 111.153028] mcp251x spi0.0: unable to set initial baudrate!
[ 112.154224] mcp251x spi0.0 can0: bit-timing not yet defined
[ 112.154257] mcp251x spi0.0: unable to set initial baudrate!
[ 113.155589] mcp251x spi0.0 can0: bit-timing not yet defined
[ 113.155623] mcp251x spi0.0: unable to set initial baudrate!


-Ethan

msperl
Posts: 344
Joined: Thu Sep 20, 2012 3:40 pm

Re: CAN controller

Mon Feb 23, 2015 9:08 am

xxethanixx wrote:Hello All,
1.) Bit timing not defined - in dmesg (provided below)

2.) no bittiming in the dir: /sys/class/net/can0
-Ethan
Both of them are essentially one and the same interface - you have the interface up (but not configured).
It is similar to having a network interface up, but you have not configured the IP-address for it...

Thing left to do is:

Code: Select all

/sbin/ip link set can0 type can bitrate 500000
Then you have set up the bitrate at 500khz and the interface is fully ready and starts to show up with "ifconfig" and you should potentially see packet counters.

martin

xxethanixx
Posts: 4
Joined: Mon Feb 23, 2015 4:44 am

Re: CAN controller

Tue Feb 24, 2015 12:41 am

Thanks Martin!

I'm not sure what I did different, but I did the steps you provided an I can see this is now working semi-correctly. By that, I mean the bit timing is now set correctly, but I am still unable to send data to can0, and read it correctly. Below you can see some further details:

root@raspberrypi:~# cansend can0 7DF#0201050000000000


root@raspberrypi:~# candump -td -cae can0,0:0,#FFFFFFFF
(000.000000) can0 20000004 [8] 00 10 00 00 00 00 00 00 ERRORFRAME
controller-problem{rx-error-passive}


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)

Dmesg:

[ 962.671270] mcp251x spi0.0: CNF: 0x00 0xb5 0x01
[ 1335.058061] can: controller area network core (rev 20120528 abi 9)
[ 1335.058244] NET: Registered protocol family 29
[ 1335.080214] can: raw protocol (rev 20120528)


I'm not certain why it is throwing this error, maybe someone here can shed some light 8-)


Another off topic question - How would I bring down the can0 interface to change the bit timing? If I set it up with:

/sbin/ip link set can0 type can bitrate 500000
/sbin/ip link set can0 up

But want to change the bitrate to 250000, how would this be done without shutting down the pi? I have tried a few dozen different ways, but can't seem to get it right.

Thanks again!!

-Ethan

msperl
Posts: 344
Joined: Thu Sep 20, 2012 3:40 pm

Re: CAN controller

Tue Feb 24, 2015 5:52 am

Those errors would most likely be related to can bus speed mismatches, which means that the stuff bits are not inserted correct for the configured speed (after 4 identical bits on the physical bus one stuff bit of the opposite polarity needs to get sent) and also the checksum does not match.

As for switching speeds: there is a trick, but afair it is dependent on the driver. Essentially you have to bring the device down and up again, but there are pitfalls... (And it depends on what the driver you are using)

If it can be disruptive the easiest is:

Code: Select all

lsmod | grep mcp251 (probably returns mcp215x)
rmmod mcp251x (the module above)
modprobe mcp251x
ip ...
Martin

Return to “Interfacing (DSI, CSI, I2C, etc.)”