Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation fails for CAN-HAT on RPI3 #35

Closed
terilenard opened this issue Mar 10, 2022 · 9 comments
Closed

Installation fails for CAN-HAT on RPI3 #35

terilenard opened this issue Mar 10, 2022 · 9 comments

Comments

@terilenard
Copy link

Configuration:

  • RaspberryPi 3
  • Kernel: 4.19.118-v8+
  • RaspberryPi OS

While running seeed-linux-dtoverlays/modules/CAN-HAT/install.sh the following error bellow. I tried the installation also on the latest kernel for the RaspberryPi OS. Still, the installation fails.

Error:
------------------------------
Deleting module version: completely from the DKMS 
Done.                                                                                                                                                                                                                Creating symlink /var/lib/dkms/mcp25xxfd/0.1/source -> /usr/src/mcp25xxfd-0.1

DKMS: add completed.                                                                                                                 
Error! Your kernel headers for kernel 4.19.36+ cannot be found.
                                                                      
Please install the linux-headers-4.19.36+ package,                                                                                   
or use the --kernelsourcedir option to tell DKMS where it's located                                                                  
Error! Your kernel headers for kernel 4.19.36-v7+ cannot be found.                                                                   
Please install the linux-headers-4.19.36-v7+ package,                                                                                
or use the --kernelsourcedir option to tell DKMS where it's located                                                    
Error! Your kernel headers for kernel 4.19.36-v7l+ cannot be found.                                                                  
Please install the linux-headers-4.19.36-v7l+ package,                                                                               
or use the --kernelsourcedir option to tell DKMS where it's located                                                                  
------------------------------------------------------                                                                               
Please reboot your raspberry pi to apply all settings                                                                                
Enjoy!
------------------------------------------------------  

@terilenard
Copy link
Author

Update: I tried again the install script after updating the RPi using rpi-update.
Kernel: 5.15.26-v8+
Content of /lib/modules/

pi@raspberry:~/seeed-linux-dtoverlays/modules/CAN-HAT $ ls /lib/modules/
4.19.36+  4.19.36-v7+  5.10.103-v8+  5.15.26+  5.15.26-v7+  5.15.26-v7l+  5.15.26-v8+

Install.sh output:

Error! Your kernel headers for kernel 5.15.26+ cannot be found.
Please install the linux-headers-5.15.26+ package, or use the --kernelsourcedir option to tell DKMS where it's located
Error! Your kernel headers for kernel 5.15.26-v7+ cannot be found.
Please install the linux-headers-5.15.26-v7+ package, or use the --kernelsourcedir option to tell DKMS where it's located
Error! Your kernel headers for kernel 5.15.26-v7l+ cannot be found.
Please install the linux-headers-5.15.26-v7l+ package,
or use the --kernelsourcedir option to tell DKMS where it's located

@terilenard
Copy link
Author

The solution I found so far:

  1. Use a armfh RaspberryPi OS, not arm64. The image I have installed has the kernel version 5.10.92-v7+.
  2. After you flash the sd card, and run install.sh, the installation will fail, but will install the latest version of the kernel headers, which at this point for me is 5.10.103-v7+.
  3. After, I have created the following symlinks to link the sources to the currently running kernel:
ln -s /usr/src/linux-headers-5.10.103+  /lib/modules/5.10.92+/build

ln -s /usr/src/linux-headers-5.10.103-v7+  /lib/modules/5.10.92-v7+/build

ln -s /usr/src/linux-headers-5.10.103-v7l+  /lib/modules/5.10.92-v7l+/build

After doing this, I have re-run install.sh and I had to modify the /boot/config.txt as such:

  1. Added: dtoverlay=seeed-can-fd-hat-v2
  2. Commented: dtoverlay=2xMCP2518FD-spi0

@bigbearishappy
Copy link
Member

bigbearishappy commented Mar 14, 2022

Cool. Thank you for your contribution of solving this problem.
Closing the issue, if you have any problem, you can reopen it.

@terilenard
Copy link
Author

@bigbearishappy Can we get a fix in the script so it's not necessary to do all those steps?

@bigbearishappy
Copy link
Member

@bigbearishappy Can we get a fix in the script so it's not necessary to do all those steps?

OK, I will fix this and let you know.

@terilenard
Copy link
Author

Any news on the script?

@bigbearishappy
Copy link
Member

Working on it now~

@bigbearishappy
Copy link
Member

@terilenard Just fixed it. See more detail in this commit

@bigbearishappy
Copy link
Member

@terilenard
If you are work with the latest kernel. It's no need to install the CAN-HAT driver manually.
We have alread merge the code into the mainline of raspberrypi kernle.Here is the LINK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants