I followed a few tutorials on how to use CAN on Raspberry and most of them suggested I should add these lines to /boot/config.txt :
dtparam=spi=on
dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25
dtoverlay=spi-bcm2835-overlay
I made the CAN controller on breadboard with MCP2515 and I'm pretty sure it is connected properly, including the INT pin from the MCP to GPIO25 on Raspberry.
The schematic is here : http://3.bp.blogspot.com/-6iBPCZobUy4/UFB4djlVbwI/AAAAAAAAAj8/Fem4E_5u_bw/s1600/Design1+-+ARM+-+minimal+-+Schematic.png
However, this command always fails :
ip link set can0 up type can bitrate 500000
saying : cannot find device can0.
I tried adding it manually:
modprobe can
ip link add can0 type can
but when I try to bring the interface up again, the command hangs and I have to reboot the Pi in order to use it, because most of other unrelated commands hang as well.
Finally, my questions are :
Does the ip link commnad rely on proper can hardware in order to succeed ?
What should I check in order to trace this problem ?