Can Bus and Raspberry Pi 4

The Raspberry Pi is a series of credit card-sized single-board computers developed in the United Kingdom by the Raspberry Pi Foundation to promote the teaching of basic computer science in schools and developing countries.

Post Reply
User avatar
/RaspberryPi
Corporate
Posts: 2449
Joined: Wed Jun 05, 2019 1:29 am

Can Bus and Raspberry Pi 4

Post by /RaspberryPi »


I’m new to Raspberry Pi and I’m interested in using a CAN FD shield to do some automotive things. I have a Raspberry Pi 4 and a Can Bus shield from Seeed. After following their instructions, ifconfig reports that everything looks good:

can0: flags=193 mtu 72 unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 65536 (UNSPEC) RX packets 0 bytes 0 (0.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 device interrupt 56

can1: flags=193 mtu 72 unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 65536 (UNSPEC) RX packets 0 bytes 0 (0.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

Unfortunately, as soon as I try to send some data using cansend or cangen, dmesg reports errors like this:

[ 8323.060421] mcp251xfd spi0.1 can0: CRC read error at address 0x0010 (length=4, data=00 f3 bb 40, CRC=0x75ac) retrying.

[ 8323.841982] mcp251xfd spi0.1 can0: CRC read error at address 0x0010 (length=4, data=04 f8 98 42, CRC=0xef3c) retrying.

[ 8324.574595] mcp251xfd spi0.1 can0: CRC read error at address 0x0010 (length=4, data=94 1d 58 44, CRC=0xa2ef) retrying.

[ 8325.792528] mcp251xfd spi0.1 can0: CRC read error at address 0x0010 (length=4, data=04 79 3f 47, CRC=0xb73f) retrying.

This kind of error was supposedly fixed by a kernel patch, but that patch is supposed to be in the current kernel. I’ve verified that by building and testing the kernel from the latest sources (which definitely include the patched code) and the results are the same.

Seeed support was unable to help, so I tried a second shield from Waveshare and the errors are the same.

So my question is whether anyone is using a Can Bus shield that works, and which one is it?
submitted by /u/mikeypi
[link] [comments]

Source: https://www.reddit.com/r/raspberry_pi/c ... erry_pi_4/
/RaspberryPi
Post Reply

Return to “Raspberry Pi Forum”