This forum covers PCAN-Linux and Linux development issues concerning our products
-
Maker7
- Posts: 8
- Joined: Tue 2. Apr 2019, 13:15
Post
by Maker7 » Tue 2. Apr 2019, 13:30
Hello everyone,
I tried to install the driver for PCAN-USB model IPEH-002021 on raspberry pi B3+ with raspbian. I use SW just downloaded from Peak. When running make I get the following:
Code: Select all
pi@raspberrypi:~/Downloads/PCAN_Basic_Linux-4.2.2/pcanbasic $ make
Makefile:43: Making lib PCANBasic WITHOUT FD support (PCAN driver <8.0)
*** Making lib PCANBasic WITHOUT FD support (PCAN driver <8.0)
***
***
*** target=libpcanbasic.so
*** version=2.0.4
***
*** g++ version=6.3.0
***
g++ src/libpcanbasic_legacy.cpp -fPIC -shared -O2 -Wall -Wl,-soname,libpcanbasic.so.2 -lc -I. -I../driver -DNO_RT -o libpcanbasic.so.2.0.4
src/libpcanbasic_legacy.cpp:54:18: fatal error: pcan.h: No such file or directory
#include <pcan.h>
^
compilation terminated.
Makefile_legacy.mk:109: recipe for target 'libpcanbasic.so.2.0.4' failed
make: *** [libpcanbasic.so.2.0.4] Error 1
Any help would be appreciated.
Last edited by
M.Gerber on Tue 2. Apr 2019, 14:18, edited 1 time in total.
Reason: Inserted code tag for improved readability.
-
M.Maidhof
- Support

- Posts: 1753
- Joined: Wed 22. Sep 2010, 14:00
Post
by M.Maidhof » Tue 2. Apr 2019, 14:25
Hi,
please install peak-linux-driver (chardev) first. Please see readme.txt of PCANBasic API for more details.
regards
Michael
-
Maker7
- Posts: 8
- Joined: Tue 2. Apr 2019, 13:15
Post
by Maker7 » Wed 3. Apr 2019, 07:40
Hi
I'd like to use socketcan and netdev not chardev because I need to imeplement CANopen. I have kernel 4.14.79, but ther is no peak_usb module. I understand I should rebuild kernel to enable socketcan. I can't find your specific documentation that describes how to enable socketcan on raspbian and conect it with PCAN-USB. I checked every pdf downloaded with your API and also the docs on your CD. No mentioning of socketcan.
-
M.Maidhof
- Support

- Posts: 1753
- Joined: Wed 22. Sep 2010, 14:00
Post
by M.Maidhof » Wed 3. Apr 2019, 18:00
Hi,
but PCANBasic API will only work with the chardev driver! If you like to use SocketCAN, don´t use PCANBasic API and compile the driver with the NET=NETDEV_SUPPORT option.
regards
Michael
-
Maker7
- Posts: 8
- Joined: Tue 2. Apr 2019, 13:15
Post
by Maker7 » Fri 5. Apr 2019, 10:19
Michael thank you.
I am studying now how to do this. Raspbian in version 4.14 does not recognize PCAN-USB. After reading through many posts I concluded that I will need to reconfigure and recompile the kernel. It will take a while for me as I have never done it before.
-
Maker7
- Posts: 8
- Joined: Tue 2. Apr 2019, 13:15
Post
by Maker7 » Fri 5. Apr 2019, 18:06
Thank you Michael. I followed your link, but I got stuck with this (in the attachment).
-
M.Maidhof
- Support

- Posts: 1753
- Joined: Wed 22. Sep 2010, 14:00
Post
by M.Maidhof » Mon 8. Apr 2019, 09:56
Hi,
can´t see an attachment...
Michael
-
Maker7
- Posts: 8
- Joined: Tue 2. Apr 2019, 13:15
Post
by Maker7 » Mon 8. Apr 2019, 12:06
Hi Michael,
sorry, here is the command and the error:
Code: Select all
pi@raspberrypi:/usr/src/Peak/peak-linux-driver-8.7.0 $ make -C driver NET=NETDEV_SUPPORT
make: Entering directory '/usr/src/Peak/peak-linux-driver-8.7.0/driver'
***
*** Host machine kernel version=4.14.98-v7+
*** Driver kernel version=4.14.98-v7+ (4.14.98)
*** Path to kernel sources=/lib/modules/4.14.98-v7+/build
*** use KBUILD=yes
*** cc version=6.3.0
***
make -C /lib/modules/4.14.98-v7+/build SUBDIRS=/usr/src/Peak/peak-linux-driver-8.7.0/driver EXTRA_CFLAGS="-I/usr/src/Peak/peak-linux-driver-8.7.0/driver -DNO_DEBUG -DMODVERSIONS -DPARPORT_SUBSYSTEM -DUSB_SUPPORT -DPCI_SUPPORT -DPCIEC_SUPPORT -DISA_SUPPORT -DDONGLE_SUPPORT -DPCCARD_SUPPORT -DNETDEV_SUPPORT -DNO_RT -Wno-date-time" V=0 modules
make[1]: Entering directory '/home/pi/linux-5d63a4595d32a8505590d5fea5c4ec1ca79fd49d'
CC [M] /usr/src/Peak/peak-linux-driver-8.7.0/driver/src/pcan_main.o
CC [M] /usr/src/Peak/peak-linux-driver-8.7.0/driver/src/pcan_fops.o
CC [M] /usr/src/Peak/peak-linux-driver-8.7.0/driver/src/pcan_fifo.o
CC [M] /usr/src/Peak/peak-linux-driver-8.7.0/driver/src/pcan_filter.o
CC [M] /usr/src/Peak/peak-linux-driver-8.7.0/driver/src/pcan_parse.o
CC [M] /usr/src/Peak/peak-linux-driver-8.7.0/driver/src/pcan_sja1000.o
CC [M] /usr/src/Peak/peak-linux-driver-8.7.0/driver/src/pcan_common.o
CC [M] /usr/src/Peak/peak-linux-driver-8.7.0/driver/src/pcan_timing.o
CC [M] /usr/src/Peak/peak-linux-driver-8.7.0/driver/src/pcanfd_core.o
CC [M] /usr/src/Peak/peak-linux-driver-8.7.0/driver/src/pcanfd_ucan.o
CC [M] /usr/src/Peak/peak-linux-driver-8.7.0/driver/src/pcan_usb_core.o
CC [M] /usr/src/Peak/peak-linux-driver-8.7.0/driver/src/pcan_usb.o
CC [M] /usr/src/Peak/peak-linux-driver-8.7.0/driver/src/pcan_usbpro.o
CC [M] /usr/src/Peak/peak-linux-driver-8.7.0/driver/src/pcanfd_usb.o
CC [M] /usr/src/Peak/peak-linux-driver-8.7.0/driver/src/pcan_pci.o
/usr/src/Peak/peak-linux-driver-8.7.0/driver/src/pcan_pci.c: In function ‘pcan_pci_enable_msi’:
/usr/src/Peak/peak-linux-driver-8.7.0/driver/src/pcan_pci.c:272:2: error: implicit declaration of function ‘pci_alloc_irq_vectors_affinity’ [-Werror=implicit-function-declaration]
pci_alloc_irq_vectors_affinity(a, b, c, PCI_IRQ_MSI, NULL)
^
/usr/src/Peak/peak-linux-driver-8.7.0/driver/src/pcan_pci.c:369:18: note: in expansion of macro ‘pcan_pci_enable_msi_range’
pa->msi_count = pcan_pci_enable_msi_range(pa->dev, 1, msi_max);
^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/Peak/peak-linux-driver-8.7.0/driver/src/pcan_pci.c:272:42: error: ‘PCI_IRQ_MSI’ undeclared (first use in this function)
pci_alloc_irq_vectors_affinity(a, b, c, PCI_IRQ_MSI, NULL)
^
/usr/src/Peak/peak-linux-driver-8.7.0/driver/src/pcan_pci.c:369:18: note: in expansion of macro ‘pcan_pci_enable_msi_range’
pa->msi_count = pcan_pci_enable_msi_range(pa->dev, 1, msi_max);
^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/Peak/peak-linux-driver-8.7.0/driver/src/pcan_pci.c:272:42: note: each undeclared identifier is reported only once for each function it appears in
pci_alloc_irq_vectors_affinity(a, b, c, PCI_IRQ_MSI, NULL)
^
/usr/src/Peak/peak-linux-driver-8.7.0/driver/src/pcan_pci.c:369:18: note: in expansion of macro ‘pcan_pci_enable_msi_range’
pa->msi_count = pcan_pci_enable_msi_range(pa->dev, 1, msi_max);
^~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
scripts/Makefile.build:326: recipe for target '/usr/src/Peak/peak-linux-driver-8.7.0/driver/src/pcan_pci.o' failed
make[2]: *** [/usr/src/Peak/peak-linux-driver-8.7.0/driver/src/pcan_pci.o] Error 1
Makefile:1535: recipe for target '_module_/usr/src/Peak/peak-linux-driver-8.7.0/driver' failed
make[1]: *** [_module_/usr/src/Peak/peak-linux-driver-8.7.0/driver] Error 2
make[1]: Leaving directory '/home/pi/linux-5d63a4595d32a8505590d5fea5c4ec1ca79fd49d'
Makefile:466: recipe for target 'all' failed
make: *** [all] Error 2
make: Leaving directory '/usr/src/Peak/peak-linux-driver-8.7.0/driver'
pi@raspberrypi:/usr/src/Peak/peak-linux-driver-8.7.0 $
Last edited by
K.Wagner on Mon 8. Apr 2019, 12:08, edited 1 time in total.
Reason: Format applied for better reading
-
Maker7
- Posts: 8
- Joined: Tue 2. Apr 2019, 13:15
Post
by Maker7 » Mon 8. Apr 2019, 12:25
Hi Michael,
I changed the command from:
to:
Code: Select all
make -C driver NET=NETDEV_SUPPORT PCI=NO PCIEC=NO PCC=NO DNG=NO PAR=NO ISA=NO
and it passed.
Then I entered:
and I got this error:
Code: Select all
pi@raspberrypi:/usr/src/Peak/peak-linux-driver-8.7.0 $ sudo make install
make[1]: Entering directory '/usr/src/Peak/peak-linux-driver-8.7.0/driver'
Info: Copied 45-pcan.rules to /etc/udev/rules.d.
Info: mainline drivers removed and blacklisted in
/etc/modprobe.d/blacklist-peak.conf
make[1]: Leaving directory '/usr/src/Peak/peak-linux-driver-8.7.0/driver'
make[1]: Entering directory '/usr/src/Peak/peak-linux-driver-8.7.0/lib'
mkdir -p /usr/lib
cp -d lib/* /usr/lib
cp: cannot stat 'lib/*': No such file or directory
Makefile:191: recipe for target 'install' failed
make[1]: *** [install] Error 1
make[1]: Leaving directory '/usr/src/Peak/peak-linux-driver-8.7.0/lib'
Makefile:92: recipe for target 'install' failed
make: *** [install] Error 2
pi@raspberrypi:/usr/src/Peak/peak-linux-driver-8.7.0 $
Please advice.
Last edited by
K.Wagner on Mon 8. Apr 2019, 13:15, edited 1 time in total.
Reason: Format applied for better reading