HowTo install the peak-linux-driver on a RPI Raspbian image
HowTo install the peak-linux-driver on a RPI Raspbian image
Hi,
we often get asked about how to install the drivers for our PCAN-USB devices on a Raspberry PI. Here a small guide which I have tested on my RPI 4 with the 2019-07-10-raspbian-buster.img:
- download the latest raspbian image and install it on a sd card using Win32DiskImager or any other tool
- boot your RPI, and setup all necessary settings (language, network etc.)
- now update your PI to the latest version and reboot once:
- sudo apt get update
- sudo apt get upgrade
- reboot
- install the kernel headers: sudo apt-get install raspberrypi-kernel-headers
- install libpopt-dev: sudo apt-get install libpopt-dev
Now download the peak-linux driver-8.9 (or newer) from our linux website and put it into the /home/pi directory:
- tar -xzf peak-linux-driver-8.9.0.tar.gz
- cd peak-linux-driver-8.9.0
- make clean
- make PCC=NO PCI=NO ISA=NO DNG=NO
- sudo make install
- sudo modprobe pcan
- cat /proc/pcan should now show all connected PCAN-USB devices.
- you can now use all chardev tools and libs to work with the PCAN-USB devices
If you want to use the SocketCAN driver, simply uninstall the driver again, and compile it with the following option:
- sudo make uninstall
- make clean
- make PCC=NO PCI=NO ISA=NO DNG=NO NET=NETDEV_SUPPORT
- sudo make install
- sudo modprobe pcan
- cat /proc/pcan should now show all connected PCAN-USB as canX devices.
- you can now install the can-utils and setup the devices with sudo ip link set can0 up type can bitrate 500000 and use the can-utils tools like "candump can0" to trace the connected CAN bus.
regards
Michael
we often get asked about how to install the drivers for our PCAN-USB devices on a Raspberry PI. Here a small guide which I have tested on my RPI 4 with the 2019-07-10-raspbian-buster.img:
- download the latest raspbian image and install it on a sd card using Win32DiskImager or any other tool
- boot your RPI, and setup all necessary settings (language, network etc.)
- now update your PI to the latest version and reboot once:
- sudo apt get update
- sudo apt get upgrade
- reboot
- install the kernel headers: sudo apt-get install raspberrypi-kernel-headers
- install libpopt-dev: sudo apt-get install libpopt-dev
Now download the peak-linux driver-8.9 (or newer) from our linux website and put it into the /home/pi directory:
- tar -xzf peak-linux-driver-8.9.0.tar.gz
- cd peak-linux-driver-8.9.0
- make clean
- make PCC=NO PCI=NO ISA=NO DNG=NO
- sudo make install
- sudo modprobe pcan
- cat /proc/pcan should now show all connected PCAN-USB devices.
- you can now use all chardev tools and libs to work with the PCAN-USB devices
If you want to use the SocketCAN driver, simply uninstall the driver again, and compile it with the following option:
- sudo make uninstall
- make clean
- make PCC=NO PCI=NO ISA=NO DNG=NO NET=NETDEV_SUPPORT
- sudo make install
- sudo modprobe pcan
- cat /proc/pcan should now show all connected PCAN-USB as canX devices.
- you can now install the can-utils and setup the devices with sudo ip link set can0 up type can bitrate 500000 and use the can-utils tools like "candump can0" to trace the connected CAN bus.
regards
Michael
Re: HowTo install the peak-linux-driver on a RPI Raspbian im
Hi,
Thank you for the detailed instructions.
I am trying to install the peak can driver on my raspberry pi, I followed the instructions but met a problem when executing the make command. the following error occurred.
It seems that fixdep couldn't be found in the installed kernel header. I can find a fixdep.c in the script/basic folder though.
Could you please let me know how to fix this?
Thank you in advance for your help.
Thank you for the detailed instructions.
I am trying to install the peak can driver on my raspberry pi, I followed the instructions but met a problem when executing the make command. the following error occurred.
Code: Select all
make PCC=NO PCI=NO ISA=NO DNG=NO
make[1]: Entering directory '/home/pi/peak-linux-driver-8.9.0/driver'
***
*** Making pcan driver in chardev mode
***
*** Host machine kernel version=4.9.76-rt60-v7+
*** Driver kernel version=4.9.76-rt60-v7+ (4.9.76)
*** Path to kernel sources=/usr/src/linux-headers-4.9.76-rt60-v7+
*** use KBUILD=yes
*** gcc version=6.3.0
***
make -C /usr/src/linux-headers-4.9.76-rt60-v7+ EXTRA_CFLAGS="-I/home/pi/peak-linux-driver-8.9.0/driver -DNO_DEBUG -DMODVERSIONS -DPARPORT_SUBSYSTEM -DUSB_SUPPORT -DNO -DNO_PCIEC_SUPPORT -DNO -DNO -DNO -DNO_NETDEV_SUPPORT -DNO_RT -Wno-date-time" V=0 modules SUBDIRS=/home/pi/peak-linux-driver-8.9.0/driver
make[2]: Entering directory '/usr/src/linux-headers-4.9.76-rt60-v7+'
CC [M] /home/pi/peak-linux-driver-8.9.0/driver/src/pcan_main.o
/bin/sh: 1: scripts/basic/fixdep: not found
scripts/Makefile.build:293: recipe for target '/home/pi/peak-linux-driver-8.9.0/driver/src/pcan_main.o' failed
make[3]: *** [/home/pi/peak-linux-driver-8.9.0/driver/src/pcan_main.o] Error 127
Makefile:1497: recipe for target '_module_/home/pi/peak-linux-driver-8.9.0/driver' failed
make[2]: *** [_module_/home/pi/peak-linux-driver-8.9.0/driver] Error 2
make[2]: Leaving directory '/usr/src/linux-headers-4.9.76-rt60-v7+'
Makefile:474: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/pi/peak-linux-driver-8.9.0/driver'
Makefile:91: recipe for target 'all' failed
make: *** [all] Error 2
Could you please let me know how to fix this?
Thank you in advance for your help.
Last edited by M.Gerber on Mon 16. Sep 2019, 11:24, edited 1 time in total.
Reason: Inserted [code] tags for improved readability
Reason: Inserted [code] tags for improved readability
- S.Grosjean
- Software Development
- Posts: 357
- Joined: Wed 4. Jul 2012, 17:02
Re: HowTo install the peak-linux-driver on a RPI Raspbian im
Hi,
Either your linux-headers package is wrong or it has not been correctly installed. Try to purge then reinstall it.
Regards,
Either your linux-headers package is wrong or it has not been correctly installed. Try to purge then reinstall it.
Regards,
— Stéphane
Re: HowTo install the peak-linux-driver on a RPI Raspbian im
@Ichen: it looks like you didn't use the Raspbian image: 2019-07-10-raspbian-buster.img
with this image you will have a kernel 4.19 and my guide was made for this image only!
regards
Michael
with this image you will have a kernel 4.19 and my guide was made for this image only!
regards
Michael
Re: HowTo install the peak-linux-driver on a RPI Raspbian im
Good morning,
I have a problem with installing the drivers on my Raspbian Buster (Linux version 4.19.88-v7+). Last week I could follow your instructions and everything was fine - I could connect to my PCAN-USB. Suddenly - I don't know what happened in between - I couldn't connect anymore to the PCAN-USB. For this reason I tried to reinstall everything again. Now I still get errors while follow your instructions:
I hope you can tell me what I am doing wrong....
Best regards,
Bernd
I have a problem with installing the drivers on my Raspbian Buster (Linux version 4.19.88-v7+). Last week I could follow your instructions and everything was fine - I could connect to my PCAN-USB. Suddenly - I don't know what happened in between - I couldn't connect anymore to the PCAN-USB. For this reason I tried to reinstall everything again. Now I still get errors while follow your instructions:
EDIT: I also reinstalled the kernel headers and libpopt-dev. Without success...pi@RPi-Logger:~/peak-linux-driver-8.9.3 $ make clean
make[1]: Verzeichnis „/home/pi/peak-linux-driver-8.9.3/driver“ wird betreten
Makefile:104: *** "Unable to automatically find the Kernel headers. These are mandatory to build the pcan driver. Please set the KERNEL_LOCATION variable to the root directory of your own built Kernel.". Schluss.
make[1]: Verzeichnis „/home/pi/peak-linux-driver-8.9.3/driver“ wird verlassen
make: *** [Makefile:106: clean] Fehler 2

I hope you can tell me what I am doing wrong....
Best regards,
Bernd
-
- Sales & Support
- Posts: 1083
- Joined: Fri 20. Sep 2019, 13:31
Re: HowTo install the peak-linux-driver on a RPI Raspbian im
Hello Bernd,
How did you update to Kernel 4.19.88?
Using official sources (via apt-get upgrade) the latest kernel you can update to is 4.19.75.
Did you use rpi-update by any chance?
Best Regards
Marvin
How did you update to Kernel 4.19.88?
Using official sources (via apt-get upgrade) the latest kernel you can update to is 4.19.75.
Did you use rpi-update by any chance?
Best Regards
Marvin
---
Marvin Heidemann
PEAK-Support Team
Marvin Heidemann
PEAK-Support Team
Re: HowTo install the peak-linux-driver on a RPI Raspbian im
Hi Marvin,
thank you for your fast reply. Indeed I did an rpi-update - I can't remember for what reason. I think I tried it to get rid of another problem. Is there a chance to get back?
Best regards,
Bernd
thank you for your fast reply. Indeed I did an rpi-update - I can't remember for what reason. I think I tried it to get rid of another problem. Is there a chance to get back?

Best regards,
Bernd
-
- Sales & Support
- Posts: 1083
- Joined: Fri 20. Sep 2019, 13:31
Re: HowTo install the peak-linux-driver on a RPI Raspbian im
Hello Bernd,
Unfortunately, once rpi-update has done its work there are two options available:
You either get the kernel-headers for the kernel or you have to start from scratch again.
If possible, do not use rpi-update when using our devices/drivers, since it introduces issues like this.
Best Regards
Marvin
Unfortunately, once rpi-update has done its work there are two options available:
You either get the kernel-headers for the kernel or you have to start from scratch again.
If possible, do not use rpi-update when using our devices/drivers, since it introduces issues like this.
Best Regards
Marvin
---
Marvin Heidemann
PEAK-Support Team
Marvin Heidemann
PEAK-Support Team
Re: HowTo install the peak-linux-driver on a RPI Raspbian im
Hi Marvin,
big thx for your help. I did a rollback to 4.19.75 by rpi-update. The hint how to do this I found at this website:
https://www.elektronik-kompendium.de/si ... 006061.htm
So I was able to rollback with "sudo rpi-update d9321aceacfc6619b4238c6c764203b1122f2f9b"
It seems that everything is fine again...
Best regards,
Bernd
big thx for your help. I did a rollback to 4.19.75 by rpi-update. The hint how to do this I found at this website:
https://www.elektronik-kompendium.de/si ... 006061.htm
So I was able to rollback with "sudo rpi-update d9321aceacfc6619b4238c6c764203b1122f2f9b"
It seems that everything is fine again...

Best regards,
Bernd
-
- Posts: 1
- Joined: Tue 1. Sep 2020, 03:46
Re: HowTo install the peak-linux-driver on a RPI Raspbian image
Hello,
i dont know if anyone would answer this 2 years old thread
I am having same problem with @Bernd, but my kernel version is 4.19.75-v7l+
Regards,
Luthfan
i dont know if anyone would answer this 2 years old thread
I am having same problem with @Bernd, but my kernel version is 4.19.75-v7l+
Is it only works for exact same Peak driver version ?make[1]: Entering directory '/home/pi/peak-linux-driver-8.10.1/driver'
Makefile:117: *** "Unable to automatically find the Kernel headers. These are mandatory to build the pcan driver. Please set the KERNEL_LOCATION variable to the root directory of your own built Kernel.". Stop.
make[1]: Leaving directory '/home/pi/peak-linux-driver-8.10.1/driver'
make: *** [Makefile:87: clean] Error 2
Regards,
Luthfan