(Solved) can bus with mcp2515 on pi v3 - Raspberry Pi Forums


it took me weeks can bus working mcp2515 on pi v3. find many threads mentioning problem:

code: select all

cannot find device "can0"
in response

code: select all

sudo /sbin/ip link set can0 type can bitrate 500000
looking dmesg see:

code: select all

mcp251x spi0.0: cannot initialize mcp2515. wrong wiring? mcp251x spi0.0: probe failed, err=19 
happens when spi speed high mcp2515. on new pi boards default spi speed 10mhz. slow down changing overlay configuration.

code: select all

sudo vi /boot/config.txt
change lines to:

code: select all

dtparam=spi=on dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25,spimaxfrequency=500000 dtoverlay=spi0-hw-cs 
suggest starting slow, 500khz shown above. work way until mcp2515 fails respond.

reference, running:

code: select all

uname -a linux raspberrypi 4.9.35-v7+ #1014 smp fri jun 30 14:47:43 bst 2017 armv7l gnu/linux 



raspberrypi



Comments

  1. I am wroking on UP2 and I have the same error but your solution doesn't work for me ! Any ideas ??

    ReplyDelete

Post a Comment

Popular posts from this blog

ffmpeg h264_omx encoder - libomxcore.so missing. - Raspberry Pi Forums

Help with Missing Filename Error?

DNSServer.h ?