Page 1 of 1

MCP2517 CANFD an CM3

Posted: Sun Dec 23, 2018 2:07 pm
by maggusxy
Hi guys,

I'm working on a quite custom design with Raspberry CM3.
However I need a MCP2517FD which is connected via SPI. Now i started first tests with the EvaluationBoard and followed this guide here:

In generel this seems to work .... but... when using this git repository I'm actually replacing the kernel and device tree with the files from that git repository. And after some tests I found out, when using this special kernel from that Git you can use MCP2517FD then, but you don't have any support for USB or cameras anymore.

However I need also a working USB port and both camera ports.
I tried now to replace just the device-tree blob which is used before (to support USB and dual-camera) but together with that kernel from that git - but in this case the whole kernel doesn't start up at all.

So is there absolutely no other chance to get that MCP2517FD running without using an unknown kernel?

Thanks a lot

Re: MCP2517 CANFD an CM3

Posted: Tue Dec 25, 2018 10:27 pm
by maggusxy

here a solution how I managed:

I setup a virtual ubuntu machine on my computer, then downloaded the official linux and tools repo like described here: ...

After this I found the source-code of the MCP2517FD driver - everything is described here how to change the Kconfig, the makefile and what's the content of the mcp2517fd.c

After I did the "make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bcm2709_defconfig" command, I opened the .config file with the gedit and set the mcp2517fd to "m".

Then I started compiling kernel, dtbs and modules.
After this I did a modules_install to a folder located in my home-directory.

After this just copy the modules folder to rpi into /lib/modules/4.... etc...
You can double check that in drivers/net/can/spi there is a filed named mcp2517fd.ko
After this copy the kernel to the device.

The approbriate device-tree overlay file I used the one provided by github ... CP2517/bin

Then the mcp2517fd should work as dtoverlay

Re: MCP2517 CANFD an CM3

Posted: Thu Apr 11, 2019 9:37 am
by vojjta

to this topic i found kernel patches for mcp2517fd

Driver ... 17fd.patch

kconfig and makefile ... rnel.patch

Devicetree (bottom of the page)

Is possible put it all into main Rasbian kernel? Same as is mcp2515...?

Thank you

Re: MCP2517 CANFD an CM3

Posted: Mon Apr 15, 2019 5:24 am
by bertr2d2

official patches are found on M.Sperls git. For precompiled images have a look at .

Please give feedback. The developer needs it for integration into the Kernel.



Re: MCP2517 CANFD an CM3

Posted: Wed Apr 17, 2019 7:25 am
by vojjta

i tried version mcp25xxfd-V6.11

Code: Select all

pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.14.98ms7-v7+ #75 SMP Sat Feb 16 22:22:33 UTC 2019 armv7l GNU/Linux

I have got two mcp2517fd with receivers on breadboard (not any kit or shield) connected to RBPi 3 b +
CANBUS is connected between tham so i can receive canfd messages on one from other. Also i have 120ohm resistor parallel to canbus

Code: Select all

pi@raspberrypi:~ $ dmesg | grep spi                                           
[    4.241270] mcp25xxfd spi0.1: MCP2517 successfully initialized.
[    4.302446] mcp25xxfd spi0.0: MCP2517 successfully initialized.


Code: Select all

pi@raspberrypi:~ $ cat /boot/config.txt | tail -n16



I am setting both can interfaces from example shown here ... ng/can.txt

Code: Select all

sudo ip link set can0 up type can bitrate 500000 sample-point 0.75 dbitrate 4000000 dsample-point 0.8 fd on

But with this version of kernel, RBPI freezes after 15-60min when i am generating canfd messages on both cans using cangen

Code: Select all

cangen -f can- -v can0 -g 20

If RBPi is doing nothing everthing seems fine... Unfortunately i could not find eny error in system logs

Originally i used but RBPi did not freezed

Re: MCP2517 CANFD an CM3

Posted: Wed Jun 05, 2019 11:14 am
by vojjta

Any news about it?


Re: MCP2517 CANFD an CM3

Posted: Wed Jun 05, 2019 4:27 pm
by bertr2d2

please use the actual driver and report errors back to Martin Sperl. Here is the source and precompiled modules for the actual Raspbian Kernel: ... 5xxfd-V8.2