2-Channel CAN-BUS(FD) Shield installation failure PI 4

Hi all,



I got a 2-Channel CAN-BUS(FD) Shield. Sadly the installation doesn’t work on my PI 4 with the actual Raspbian image. Please find the log down below.

Has anybody successfully installed this shield? Which image did you use?



Thanks in advance



Shaun



Error! echo

Your kernel headers for kernel 4.19.75+ cannot be found at

/lib/modules/4.19.75+/build or /lib/modules/4.19.75+/source.

Error! echo

Your kernel headers for kernel 4.19.75-v7+ cannot be found at

/lib/modules/4.19.75-v7+/build or /lib/modules/4.19.75-v7+/source.

Error! echo

Your kernel headers for kernel 4.19.75-v7l+ cannot be found at

/lib/modules/4.19.75-v7l+/build or /lib/modules/4.19.75-v7l+/source.

Error! echo

Your kernel headers for kernel 4.19.75-v8+ cannot be found at

/lib/modules/4.19.75-v8+/build or /lib/modules/4.19.75-v8+/source.

Hi Shawn,



I am using the CAN-BUS shield V2.0 on an arduino and I was able to get the software to load using the code found below.



<LINK_TEXT text=“https://github.com/AppSaloon/ecu-can-bu … cu-sim.ino”>https://github.com/AppSaloon/ecu-can-bus-simulator/blob/master/Seeedlib-ecu-sim/Seeedlib-ecu-sim.ino</LINK_TEXT>.



Note: If you get an INIT error should change the MCP_CAN CAN() value to 9 instead of 10.



Let me know how that works out for you




</s>const int SPI_CS_PIN = 9; MCP_CAN CAN(SPI_CS_PIN); // Set CS to pin 9<e>

Same here with a RPi4

Did anyone find a solution?

I am having the same issue, tried so many things. I have built from many different sources I have found on the web with no success.

I was told by seeed that it would work with PI 4.

Wondering if anyone else has found a solution?

Hi there

I was successful when I use the latest raspberry’s OS :smiley:

Latest one as per https://www.raspberrypi.org/downloads/raspbian/ is:



Raspbian Buster with desktop

Image with desktop based on Debian Buster

Version: September 2019

Release date: 2019-09-26

Kernel version: 4.19



which is the one I’m using and which I did update/upgrade - so assumably it’s the latest one.



Which one did you use ?

The hint from tomright here seems to work on a RPi3, still no luck on RPI4 though.



<URL url="https://forum7.seeedstudio.com/t/2-channel-can-bus-fd-shield-for-rpi3b-setup-installation-guide-update/7043/1 text=“viewtopic.php?f=23&t=32488”>https://forum7.seeedstudio.com/t/2-channel-can-bus-fd-shield-for-rpi3b-setup-installation-guide-update/7043/1


0. Go through failing Seeed procedure

  1. navigate to ~/pi-hats/CAN-HAT
  2. make
  3. make install
  4. sudo modprobe mcp25xxfd-can
  5. reboot
  6. dmesg | grep spi



    should give you:



    [ 5.399392] mcp25xxfd spi0.0: MCP2517 successfully initialized.

    [ 5.438864] mcp25xxfd spi1.0: MCP2517 successfully initialized.

Got it working on RPI4:


  1. install Raspbian Buster (2019-09-26)
  2. do NOT upgrade / update packages during installation or afterwards
  3. git clone https://github.com/seeed-Studio/pi-hats
  4. cd pi-hats/CAN-HAT
  5. sudo ./install.sh



    During installation you’ll get:

</s>run-parts: executing /etc/kernel/header_postinst.d/dkms 4.19.75-v8+ ./install.sh: line 35: get_kernel_version: command not found !!! Your kernel version is Not found *** coressponding *** kernel headers with apt-get. This may occur if you have ran 'rpi-update'. Choose *** y *** will revert the kernel to version 4.19.75+ then continue. Choose *** N *** will exit without this driver support, by default. Would you like to proceed? (y/N) <e>

  1. Answer with yes: y


  2. Installation will fail with

[code]DKMS: build completed.
Error! echo
Your kernel headers for kernel 4.19.75-v8+ cannot be found at
/lib/modules/4.19.75-v8+/build or /lib/modules/4.19.75-v8+/source.

Please reboot your raspberry pi to apply all settings
Enjoy!

[/code]

  1. make
  2. make install
  3. sudo modprobe mcp25xxfd-can
  4. sudo reboot



    should get you up and running:

</s><i> </i>pi@raspberrypi:~ $ dmesg | grep spi [ 3.712135] mcp25xxfd spi0.0: MCP2517 successfully initialized. [ 3.747263] mcp25xxfd spi1.0: MCP2517 successfully initialized.<e>

Hello

I buy new one Raspi 4 and 2-Channe Can Bus shield from seeed.

I cant install shield . it gives error.
I setup last Raspbian version 2020.05.20
I didnt update or upgrade.

enable spi via sudo raspi-config and check
pi@raspberrypi:~/pi-hats/CAN-HAT $ lsmod | grep spi
spidev 20480 0
spi_bcm2835 20480 0
pi@raspberrypi:~/pi-hats/CAN-HAT $
and i checked sudo nano /boot/config.txt
i saw dtparam=spi=on

git clone https://github.com/seeed-Studio/pi-hats
cd pi-hats/CAN-HAT
sudo ./install.sh
and error:

Creating symlink /var/lib/dkms/mcp2517fd/0.1/source ->
/usr/src/mcp2517fd-0.1

DKMS: add completed.
Error! echo
Your kernel headers for kernel 4.19.118+ cannot be found at
/lib/modules/4.19.118+/build or /lib/modules/4.19.118+/source.
Error! echo
Your kernel headers for kernel 4.19.118-v7+ cannot be found at
/lib/modules/4.19.118-v7+/build or /lib/modules/4.19.118-v7+/source.
Error! echo
Your kernel headers for kernel 4.19.118-v7l+ cannot be found at
/lib/modules/4.19.118-v7l+/build or /lib/modules/4.19.118-v7l+/source.

Please reboot your raspberry pi to apply all settings
Enjoy!

pi@raspberrypi:~/pi-hats/CAN-HAT $ make
make -C /lib/modules/4.19.118-v7l+/build M=/home/pi/pi-hats/CAN-HAT modules
make[1]: *** /lib/modules/4.19.118-v7l+/build: Böyle bir dosya ya da dizin yok. Durdu.
make: *** [Makefile:21: all] Error 2
pi@raspberrypi:~/pi-hats/CAN-HAT $ make install
sudo cp mcp25xxfd-can.ko /lib/modules/4.19.118-v7l+/kernel/drivers/net/can/spi/
cp: ‘mcp25xxfd-can.ko’ durumlanamadı: Böyle bir dosya ya da dizin yok
make: *** [Makefile:27: install] Error 1
pi@raspberrypi:~/pi-hats/CAN-HAT $ sudo modprobe mcp25xxfd-can
modprobe: FATAL: Module mcp25xxfd-can not found in directory /lib/modules/4.19.118-v7l+

1 Like

Hi Kahraman

I got the same error as you asked above.
Have you solved it ?

Thanks

Sorry, I have migrated the latest source code to here, but I haven’t had time to update the documentation, we will update it as soon as possible.

till date 17 Oct 2020, the same issues are being experienced here despite installing using the so-called updated DTC overlays release. Very disappointed. Has anyone requested for refund. I simply want my money back and forget about it, about seeed.

https://wiki.seeedstudio.com/2-Channel-CAN-BUS-FD-Shield-for-Raspberry-Pi/ @siowlim_chow We updated and made all the documents public early on.

Hi Shaun, I got the same error when using the 64-bit version of Raspbian. It’s only beta and it seems the kernel headers are not included as source. And I wasn’t able to get the right version.

In the end I installed the 32-bit version of Raspbian. There the kernel headers were included and the drivers could be compiled. And they work fine. I will give it a try again if the 64-bit Raspbian is not beta any longer.

Many thanks, I have got it resolved. However, the 12V power supply was broken, and ever since the Raspbi 4 can not boot. Removing the FDCAN hat and powered through USB-C, the Raspi 4 works.

I have checked the power of FDCAN hat, pin 1 = 0V, pin 2 = 5V. The pins of the 3.3V linear power produce 3.3V, with input 5.0V, ( presumably ).

What could go wrong, please?

Does it not work ? @siowlim_chow