Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 3763

Troubleshooting • CAN (mcp2515) doesn't work on RPi 5

$
0
0
Hi,

I want to log data on a CAN bus with my RPi5, so I connected a mcp2515 by following this guideline: viewtopic.php?t=141052
Unfortunately, it doesn't work, but I just can't see any error ?!?

Here my setup:

Code:

uname -aLinux RPi5 6.6.51+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.6.51-1+rpt3 (2024-10-08) aarch64 GNU/Linux
Added lines in /boot/firmware/config.txt

Code:

dtoverlay=mcp2515-can0,oscillator=8000000,interrupt=12dtoverlay=spi-bcm2835-overlay

Code:

pi@RPi5:~$ ls /sys/bus/spi/devices/spi0.0driver  driver_override  modalias  net  of_node  power  statistics  subsystem  supplier:platform:1f000d0000.gpio  ueventpi@RPi5:~$ ls /sys/bus/spi/devices/spi0.0/net/can0pi@RPi5:~$ ls /sys/bus/spi/devices/spi0.0/net/can0/addr_assign_type  carrier_changes     dev_port           ifalias    name_assign_type      phys_port_name  speed       tx_queue_lenaddress           carrier_down_count  dormant            ifindex    napi_defer_hard_irqs  phys_switch_id  statistics  typeaddr_len          carrier_up_count    duplex             iflink     netdev_group          power           subsystem   ueventbroadcast         device              flags              link_mode  operstate             proto_down      testingcarrier           dev_id              gro_flush_timeout  mtu        phys_port_id          queues          threaded

Code:

pi@RPi5:~$ ip -details -statistics link show can03: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP mode DEFAULT group default qlen 10    link/can  promiscuity 0  allmulti 0 minmtu 0 maxmtu 0     can <LOOPBACK> state ERROR-ACTIVE restart-ms 0           bitrate 125000 sample-point 0.875          tq 500 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1 brp 4          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         numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 tso_max_size 65536 tso_max_segs 65535 gro_max_size 65536 parentbus spi parentdev spi0.0     RX:  bytes packets errors dropped  missed   mcast                        3       1      0       0       0       0     TX:  bytes packets errors dropped carrier collsns                        0       0      0       0       0       0 

Code:

pi@RPi5:~$ ifconfig can0can0: flags=193<UP,RUNNING,NOARP>  mtu 16        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 10  (UNSPEC)        RX packets 1  bytes 3 (3.0 B)        RX errors 0  dropped 0  overruns 0  frame 0        TX packets 0  bytes 0 (0.0 B)        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
Anybody any idea, what might go wrong?
Thanx in advance

Statistics: Posted by michadl27 — Sat Feb 08, 2025 11:08 pm



Viewing all articles
Browse latest Browse all 3763

Trending Articles