Linux Update and lost peak_usb driver

This forum covers PCAN-Linux and Linux development issues concerning our products
milhead
Posts: 2
Joined: Fri 4. Jun 2021, 00:27

Linux Update and lost peak_usb driver

Post by milhead » Fri 4. Jun 2021, 00:41

Hi Forum;

In the past whenever I plug in my PCAN/USB adapter I've normally
$ uname -a
Linux goliath 5.4.0-73-generic #82-Ubuntu SMP Wed Apr 14 17:39:42 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Code: Select all

-----------------End of dmesg output-----------------
[1907399.129682] usb 2-1.5.3: new full-speed USB device number 9 using ehci-pci
[1907399.238671] usb 2-1.5.3: New USB device found, idVendor=0c72, idProduct=000c, bcdDevice=53.ff
[1907399.238675] usb 2-1.5.3: New USB device strings: Mfr=10, Product=4, SerialNumber=0
[1907399.238676] usb 2-1.5.3: Product: PCAN-USB
[1907399.238678] usb 2-1.5.3: Manufacturer: PEAK-System Technik GmbH
[1907399.239663] peak_usb 2-1.5.3:1.0: PEAK-System PCAN-USB adapter hwrev 83 serial FFFFFFFF (1 channel)
[1907399.240161] peak_usb 2-1.5.3:1.0 can0: attached to PCAN-USB channel 0 (device 255)
.. At this point all  my  link command all work and I can setup can0
But I updated Linux on one of my workstations and when I plug in the adapter
$ uname -a
Linux trailtechu3 5.8.0-53-generic #60~20.04.1-Ubuntu SMP Thu May 6 09:52:46 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Code: Select all

[1734620.180141] usb 3-1.4.4.1: new full-speed USB device number 20 using xhci_hcd
[1734620.297590] usb 3-1.4.4.1: New USB device found, idVendor=0c72, idProduct=000c, bcdDevice=54.ff
[1734620.297595] usb 3-1.4.4.1: New USB device strings: Mfr=10, Product=4, SerialNumber=0
[1734620.297597] usb 3-1.4.4.1: Product: PCAN-USB
[1734620.297600] usb 3-1.4.4.1: Manufacturer: PEAK-System Technik GmbH
At this point none of the link commands recognize can0.. It looks to me that there is an automatic step missing (the peak_usb) commands above.

Any ideas would be appriciated!

M.Heidemann
Sales & Support
Sales & Support
Posts: 673
Joined: Fri 20. Sep 2019, 13:31

Re: Linux Update and lost peak_usb driver

Post by M.Heidemann » Fri 4. Jun 2021, 09:00

Hello,

Is this issue replicable after a reboot?

Furthermore, what's your output for:

Code: Select all

ip link ls
and

Code: Select all

lsusb
?

Please report back to us regarding this.

Best Regards

Marvin

milhead
Posts: 2
Joined: Fri 4. Jun 2021, 00:27

Re: Linux Update and lost peak_usb driver

Post by milhead » Fri 4. Jun 2021, 16:40

Code: Select all

$ sudo ip link ls
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eno1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000
    link/ether 24:be:05:e2:4e:65 brd ff:ff:ff:ff:ff:ff
    altname enp0s25
3: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 24:be:05:e2:4e:64 brd ff:ff:ff:ff:ff:ff

Code: Select all

$ lsusb
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 005: ID 0bda:8153 Realtek Semiconductor Corp. RTL8153 Gigabit Ethernet Adapter
Bus 004 Device 004: ID 2109:0812 VIA Labs, Inc. VL812 Hub
Bus 004 Device 003: ID 2109:0812 VIA Labs, Inc. VL812 Hub
Bus 004 Device 002: ID 2109:0812 VIA Labs, Inc. VL812 Hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 016: ID 045e:07a5 Microsoft Corp. Wireless Receiver 1461C
Bus 003 Device 020: ID 0c72:000c PEAK System PCAN-USB
Bus 003 Device 009: ID 2109:2812 VIA Labs, Inc. VL812 Hub
Bus 003 Device 007: ID 0cd5:0004 LabJack Corporation 
Bus 003 Device 006: ID 2109:2812 VIA Labs, Inc. VL812 Hub
Bus 003 Device 005: ID 10c4:ea60 Silicon Labs CP210x UART Bridge
Bus 003 Device 004: ID 10c4:ea60 Silicon Labs CP210x UART Bridge
Bus 003 Device 002: ID 2109:2812 VIA Labs, Inc. VL812 Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 004: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

I get the same thing after a reboot.

M.Heidemann
Sales & Support
Sales & Support
Posts: 673
Joined: Fri 20. Sep 2019, 13:31

Re: Linux Update and lost peak_usb driver

Post by M.Heidemann » Mon 7. Jun 2021, 09:09

Hello,

Apparently you kernel does not provide the necessary drivers,
are you in any way deviating from the mainline-kernel in terms of modules?

In your case you might wanna try to build and install the PCAN-Linux driver Package as NetDev:

http://www.peak-system.com/fileadmin/me ... 2.0.tar.gz

Download the driver, extract the tarball, change into the peak-linux... driver folder:

Code: Select all

make NET=NETDEV_SUPPORT

Code: Select all

sudo make install

Code: Select all

sudo modprobe pcan
Afterwards check if the driver is installed using:

Code: Select all

cat /dev/pcan/
If you see your device listed everythin installed properly, you should now be able to get the device up using "ip link set ...", etc.

Please report back to us, if that resolved your issue.

Best Regards

Marvin

miller.lowe
Posts: 2
Joined: Fri 4. Jun 2021, 23:46

Re: Linux Update and lost peak_usb driver

Post by miller.lowe » Mon 7. Jun 2021, 19:26

Hi,

I've not made any changes to the default Ubuntu-Mate and am running the same version on both a working and non-working machine. Both machines are dual processor multi-core HP Z280 workstations.

Code: Select all

miller@trailtechu3:~/src/peak-linux-driver-8.12.0
$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.2 LTS
Release:	20.04
Codename:	focal
But I have always let the update services run, I see two different kernel versions on two machines. The first works and the second does not.

Working Machine:

Code: Select all

$ uname -a
Linux goliath 5.4.0-74-generic #83-Ubuntu SMP Sat May 8 02:35:39 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Non-Working Machine:

Code: Select all

$ uname -a
Linux trailtechu3 5.8.0-53-generic #60~20.04.1-Ubuntu SMP Thu May 6 09:52:46 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
I don't know how the two machines wound up ad different versions.

The pcan driver downloaded and build fine I had to install;

Code: Select all

sudo apt install linux-headers
sudo apt install libpopt-dev
After I built the code the make install appears to pass

Code: Select all

$ sudo make install
make[1]: Entering directory '/home/miller/src/peak-linux-driver-8.12.0/driver'
Info: Left current 'pcan'-entry in /etc/modprobe.d/pcan.conf untouched.
mkdir -p /usr/local/bin
cp -f udev/pcan_usb_minor_check.bash /usr/local/bin
chmod 744 /usr/local/bin/pcan_usb_minor_check.bash
cp -f udev/45-pcan.rules /etc/udev/rules.d
Info: Copied 45-pcan.rules to /etc/udev/rules.d.
cp -f udev/blacklist-peak.conf /etc/modprobe.d
chmod 644 /etc/modprobe.d/blacklist-peak.conf
Info: mainline drivers removed and blacklisted in
      /etc/modprobe.d/blacklist-peak.conf
udevadm control --reload-rules
- manually installing pcan under /lib/modules/5.8.0-53-generic/misc...
- Building dependencies...
make[1]: Leaving directory '/home/miller/src/peak-linux-driver-8.12.0/driver'
make[1]: Entering directory '/home/miller/src/peak-linux-driver-8.12.0/lib'
mkdir -p /usr/lib
cp -d lib/* /usr/lib
if [ -d lib32 ]; then \
	mkdir -p /usr/lib32; \
	cp -d lib32/* /usr/lib32; \
fi
mkdir -p /usr/include
chmod 644 libpcan.h libpcanfd.h
cp libpcan.h libpcanfd.h /usr/include
/sbin/ldconfig
make[1]: Leaving directory '/home/miller/src/peak-linux-driver-8.12.0/lib'
make[1]: Entering directory '/home/miller/src/peak-linux-driver-8.12.0/test'
cp receivetest transmitest bitratetest filtertest pcanfdtst pcan-settings receivetest_posix transmitest_posix /usr/local/bin
make[1]: Leaving directory '/home/miller/src/peak-linux-driver-8.12.0/test'
make[1]: Entering directory '/home/miller/src/peak-linux-driver-8.12.0/libpcanbasic'
make[2]: Entering directory '/home/miller/src/peak-linux-driver-8.12.0/libpcanbasic/pcanbasic'
cp libpcanbasic.so.4.4.2 /usr/lib/libpcanbasic.so.4.4.2
ln -sf /usr/lib/libpcanbasic.so.4.4.2 /usr/lib/libpcanbasic.so.4
ln -sf /usr/lib/libpcanbasic.so.4.4.2 /usr/lib/libpcanbasic.so.0
ln -sf /usr/lib/libpcanbasic.so.4 /usr/lib/libpcanbasic.so
cp PCANBasic.h /usr/include/PCANBasic.h
chmod 644 /usr/include/PCANBasic.h
/sbin/ldconfig
make[2]: Leaving directory '/home/miller/src/peak-linux-driver-8.12.0/libpcanbasic/pcanbasic'
make[2]: Entering directory '/home/miller/src/peak-linux-driver-8.12.0/libpcanbasic/pcaninfo'
cp pcaninfo.1.2.0 /usr/local/bin/pcaninfo
chmod 755 /usr/local/bin/pcaninfo
make[2]: Leaving directory '/home/miller/src/peak-linux-driver-8.12.0/libpcanbasic/pcaninfo'
make[2]: Entering directory '/home/miller/src/peak-linux-driver-8.12.0/libpcanbasic/examples'
make[3]: Entering directory '/home/miller/src/peak-linux-driver-8.12.0/libpcanbasic/examples/python'
make[3]: Nothing to be done for 'install'.
make[3]: Leaving directory '/home/miller/src/peak-linux-driver-8.12.0/libpcanbasic/examples/python'
make[3]: Entering directory '/home/miller/src/peak-linux-driver-8.12.0/libpcanbasic/examples/c++'
#cp pcanwrite pcanread pcaneventread pcaneventwrite /usr/local/bin
make[3]: Leaving directory '/home/miller/src/peak-linux-driver-8.12.0/libpcanbasic/examples/c++'
make[2]: Leaving directory '/home/miller/src/peak-linux-driver-8.12.0/libpcanbasic/examples'
make[1]: Leaving directory '/home/miller/src/peak-linux-driver-8.12.0/libpcanbasic'
But then the modprobe message fails....

Code: Select all

$ sudo modprobe pcan
modprobe: ERROR: could not insert 'pcan': Unknown symbol in module, or unknown parameter (see dmesg)
modprobe: ERROR: ../libkmod/libkmod-module.c:990 command_do() Error running install command 'modprobe --ignore-install pcan' for module pcan: retcode 1
modprobe: ERROR: could not insert 'pcan': Invalid argument
The end of the dmesg doesn't give me any clues, but I'm not really a kernel/driver guy.

Code: Select all

$ dmesg
... Clipped above this...
[59396.602767] kauditd_printk_skb: 23 callbacks suppressed
[59396.602771] audit: type=1400 audit(1622876416.237:35): apparmor="DENIED" operation="capable" profile="/usr/sbin/cups-browsed" pid=4586 comm="cups-browsed" capability=23  capname="sys_nice"
[70720.384766] perf: interrupt took too long (2557 > 2500), lowering kernel.perf_event_max_sample_rate to 78000
[83154.195648] SGI XFS with ACLs, security attributes, realtime, quota, no debug enabled
[83154.271684] Btrfs loaded, crc32c=crc32c-intel
[95412.197157] perf: interrupt took too long (3239 > 3196), lowering kernel.perf_event_max_sample_rate to 61750
[123394.492241] perf: interrupt took too long (4151 > 4048), lowering kernel.perf_event_max_sample_rate to 48000
[145796.333884] audit: type=1400 audit(1622962817.035:36): apparmor="DENIED" operation="capable" profile="/usr/sbin/cups-browsed" pid=16029 comm="cups-browsed" capability=23  capname="sys_nice"
[158313.335023] perf: interrupt took too long (5219 > 5188), lowering kernel.perf_event_max_sample_rate to 38250
[214254.632035] perf: interrupt took too long (6530 > 6523), lowering kernel.perf_event_max_sample_rate to 30500
[232197.284274] audit: type=1400 audit(1623049219.010:37): apparmor="DENIED" operation="capable" profile="/usr/sbin/cups-browsed" pid=22007 comm="cups-browsed" capability=23  capname="sys_nice"
[267553.266576] can: controller area network core (rev 20170425 abi 9)
[267553.266647] NET: Registered protocol family 29
[267553.270190] can: raw protocol (rev 20170425)
[268010.091526] pcan: module verification failed: signature and/or required key missing - tainting kernel
[268010.091689] pcan: Unknown symbol alloc_canfd_skb (err -2)
[268010.091784] pcan: Unknown symbol open_candev (err -2)
[268010.091868] pcan: Unknown symbol alloc_can_skb (err -2)
[268010.091903] pcan: Unknown symbol unregister_candev (err -2)
[268010.091950] pcan: Unknown symbol can_change_mtu (err -2)
[268010.092006] pcan: Unknown symbol alloc_candev_mqs (err -2)
[268010.092110] pcan: Unknown symbol close_candev (err -2)
[268010.092169] pcan: Unknown symbol can_bus_off (err -2)
[268010.092271] pcan: Unknown symbol register_candev (err -2)

The non-working computer does have an ISOtp driver installed.

If I thought reinstalling Linux would correct the issue I'd do it but am concerned that some later kernel update will just do it again. I'd prefer to get the pcan driver to work without reinstalling. We run this code and PCAN USB devices on probably 20 machines in my division.. If they all start failing after recommended updates I'm going to have a support storm on my hands.

If you have any more suggestions I'll try them.

Miller

M.Heidemann
Sales & Support
Sales & Support
Posts: 673
Joined: Fri 20. Sep 2019, 13:31

Re: Linux Update and lost peak_usb driver

Post by M.Heidemann » Tue 8. Jun 2021, 09:44

Hello,

Please share the output for your make command with us.

Can you elaborate on the iso-tp driver installed on the non working machine?

Best Regards

Marvin

miller.lowe
Posts: 2
Joined: Fri 4. Jun 2021, 23:46

Re: Linux Update and lost peak_usb driver

Post by miller.lowe » Tue 8. Jun 2021, 19:55

Here is the output of the make

Code: Select all

$ make clean all
make[1]: Entering directory '/home/miller/src/peak-linux-driver-8.12.0/driver'
rm -f src/*o src/*~ src/.*cmd *o *ko *~ .*cmd  pcan.mod.c Module.symvers modules.order .cache.mk
make[1]: Leaving directory '/home/miller/src/peak-linux-driver-8.12.0/driver'
make[1]: Entering directory '/home/miller/src/peak-linux-driver-8.12.0/lib'
rm -f src/*~
rm -rf obj lib obj32 lib32
make[1]: Leaving directory '/home/miller/src/peak-linux-driver-8.12.0/lib'
make[1]: Entering directory '/home/miller/src/peak-linux-driver-8.12.0/test'
rm -f src/*~ src/*.o *~ receivetest transmitest bitratetest filtertest pcanfdtst pcan-settings receivetest_posix transmitest_posix
make[1]: Leaving directory '/home/miller/src/peak-linux-driver-8.12.0/test'
make[1]: Entering directory '/home/miller/src/peak-linux-driver-8.12.0/libpcanbasic'
make[2]: Entering directory '/home/miller/src/peak-linux-driver-8.12.0/libpcanbasic/pcanbasic'
rm -f src/*~ out/*.o *~ *.so.* *.so
make[2]: Leaving directory '/home/miller/src/peak-linux-driver-8.12.0/libpcanbasic/pcanbasic'
make[2]: Entering directory '/home/miller/src/peak-linux-driver-8.12.0/libpcanbasic/pcaninfo'
rm -f src/*~ src/*.o ../pcanbasic/src/*~ ../pcanbasic/src/*.o *~ *.so.* *.so pcaninfo.1.2.0 pcaninfo
make[2]: Leaving directory '/home/miller/src/peak-linux-driver-8.12.0/libpcanbasic/pcaninfo'
make[2]: Entering directory '/home/miller/src/peak-linux-driver-8.12.0/libpcanbasic/examples'
make[3]: Entering directory '/home/miller/src/peak-linux-driver-8.12.0/libpcanbasic/examples/python'
rm -f *.pyc
make[3]: Leaving directory '/home/miller/src/peak-linux-driver-8.12.0/libpcanbasic/examples/python'
make[3]: Entering directory '/home/miller/src/peak-linux-driver-8.12.0/libpcanbasic/examples/c++'
rm -f src/*~ src/*.o *~ pcanwrite pcanread pcaneventread pcaneventwrite
make[3]: Leaving directory '/home/miller/src/peak-linux-driver-8.12.0/libpcanbasic/examples/c++'
make[2]: Leaving directory '/home/miller/src/peak-linux-driver-8.12.0/libpcanbasic/examples'
make[1]: Leaving directory '/home/miller/src/peak-linux-driver-8.12.0/libpcanbasic'
make[1]: Entering directory '/home/miller/src/peak-linux-driver-8.12.0/driver'
***
*** Making pcan driver in chardev mode
***
*** Host OS Release=Ubuntu v20.04
*** Host machine kernel version=5.8.0-53-generic
*** Driver kernel version=5.8.0-53-generic (5.8.0)
*** Path to kernel sources=/usr/src/linux-headers-5.8.0-53-generic
*** use KBUILD=yes
*** use DKMS=no
*** gcc version=9
***
make -C /usr/src/linux-headers-5.8.0-53-generic  EXTRA_CFLAGS="-I/home/miller/src/peak-linux-driver-8.12.0/driver -DNO_DEBUG -DMODVERSIONS -DNO_PARPORT_SUBSYSTEM -DUSB_SUPPORT -DPCI_SUPPORT -DPCIEC_SUPPORT -DISA_SUPPORT -DNO_DONGLE_SUPPORT -DNO_PCCARD_SUPPORT -DNO_NETDEV_SUPPORT -DNO_RT   -Wno-date-time" V=0 modules M=/home/miller/src/peak-linux-driver-8.12.0/driver
make[2]: Entering directory '/usr/src/linux-headers-5.8.0-53-generic'
  CC [M]  /home/miller/src/peak-linux-driver-8.12.0/driver/src/pcan_main.o
  CC [M]  /home/miller/src/peak-linux-driver-8.12.0/driver/src/pcan_fops.o
  CC [M]  /home/miller/src/peak-linux-driver-8.12.0/driver/src/pcan_fifo.o
  CC [M]  /home/miller/src/peak-linux-driver-8.12.0/driver/src/pcan_filter.o
  CC [M]  /home/miller/src/peak-linux-driver-8.12.0/driver/src/pcan_parse.o
  CC [M]  /home/miller/src/peak-linux-driver-8.12.0/driver/src/pcan_sja1000.o
  CC [M]  /home/miller/src/peak-linux-driver-8.12.0/driver/src/pcan_common.o
  CC [M]  /home/miller/src/peak-linux-driver-8.12.0/driver/src/pcan_timing.o
  CC [M]  /home/miller/src/peak-linux-driver-8.12.0/driver/src/pcanfd_core.o
  CC [M]  /home/miller/src/peak-linux-driver-8.12.0/driver/src/pcanfd_ucan.o
  CC [M]  /home/miller/src/peak-linux-driver-8.12.0/driver/src/pcan_usb_core.o
  CC [M]  /home/miller/src/peak-linux-driver-8.12.0/driver/src/pcan_usb.o
  CC [M]  /home/miller/src/peak-linux-driver-8.12.0/driver/src/pcan_usbpro.o
  CC [M]  /home/miller/src/peak-linux-driver-8.12.0/driver/src/pcanfd_usb.o
  CC [M]  /home/miller/src/peak-linux-driver-8.12.0/driver/src/pcan_pci.o
  CC [M]  /home/miller/src/peak-linux-driver-8.12.0/driver/src/pcanfd_pci.o
  CC [M]  /home/miller/src/peak-linux-driver-8.12.0/driver/src/pcan_pci_spi.o
  CC [M]  /home/miller/src/peak-linux-driver-8.12.0/driver/src/pcan_pciec.o
  CC [M]  /home/miller/src/peak-linux-driver-8.12.0/driver/src/pcan_isa.o
  LD [M]  /home/miller/src/peak-linux-driver-8.12.0/driver/pcan.o
  MODPOST /home/miller/src/peak-linux-driver-8.12.0/driver/Module.symvers
  CC [M]  /home/miller/src/peak-linux-driver-8.12.0/driver/pcan.mod.o
  LD [M]  /home/miller/src/peak-linux-driver-8.12.0/driver/pcan.ko
make[2]: Leaving directory '/usr/src/linux-headers-5.8.0-53-generic'
make[1]: Leaving directory '/home/miller/src/peak-linux-driver-8.12.0/driver'
make[1]: Entering directory '/home/miller/src/peak-linux-driver-8.12.0/lib'
***
*** Making pcan libraries
***
*** gcc version: 9
***
gcc -DNO_RT -I. -I../driver -fPIC -Wall -Wcast-align -Wredundant-decls  -DPCANFD_OLD_STYLE_API -c src/libpcan.c -o obj/libpcan.o
gcc -shared -Wl,-soname,libpcan.so -o lib/libpcan.so.6 obj/libpcan.o 
cd lib/; ln -sf libpcan.so.6 libpcan.so
gcc -DNO_RT -I. -I../driver -fPIC -Wall -Wcast-align -Wredundant-decls  -DPCANFD_OLD_STYLE_API -c src/libpcanfd.c -o obj/libpcanfd.o
gcc -shared -Wl,-soname,libpcanfd.so -o lib/libpcanfd.so.8 obj/libpcanfd.o 
cd lib/; ln -sf libpcanfd.so.8 libpcanfd.so
ar rcs lib/libpcanfd.a obj/libpcanfd.o

Info: only 64-bit version of libpcan can be built. 32-bit version of libpcan can't because the 32-bit version of libc seems not being installed...

make[1]: Leaving directory '/home/miller/src/peak-linux-driver-8.12.0/lib'
make[1]: Entering directory '/home/miller/src/peak-linux-driver-8.12.0/test'
***
*** Making example and test programs
***
*** gcc version: 9
***
gcc -DNO_RT -I. -I../lib -I../driver  -g src/receivetest.c src/common.c -lpcanfd  -L../lib/lib -Wl,-rpath ../lib/lib -o receivetest
g++ -DNO_RT -I. -I../lib -I../driver  -g src/transmitest.cpp src/common.c src/parser.cpp -lstdc++ -lpcanfd  -L../lib/lib -Wl,-rpath ../lib/lib -o transmitest
gcc -DNO_RT -I. -I../lib -I../driver  -g src/bitratetest.c src/common.c -lpcanfd  -L../lib/lib -Wl,-rpath ../lib/lib -o bitratetest
g++ -DNO_RT -I. -I../lib -I../driver  -g src/filtertest.cpp src/common.c -lstdc++ -lpcanfd  -L../lib/lib -Wl,-rpath ../lib/lib -o filtertest
gcc -DNO_RT -I. -I../lib -I../driver  -g src/pcanfdtst.c -lpcanfd  -L../lib/lib -Wl,-rpath ../lib/lib -lpthread -o pcanfdtst
gcc -DNO_RT -I. -I../lib -I../driver  -g src/pcan-settings.c -lpopt -lpcanfd  -L../lib/lib -Wl,-rpath ../lib/lib -g -o pcan-settings
gcc -DNO_RT -I. -I../lib -I../driver  -g src/receivetest_posix.c src/common.c -lpcanfd  -L../lib/lib -Wl,-rpath ../lib/lib -lpthread -o receivetest_posix
g++ -DNO_RT -I. -I../lib -I../driver  -g src/transmitest_posix.cpp src/common.c src/parser.cpp -lstdc++ -lpcanfd  -L../lib/lib -Wl,-rpath ../lib/lib -lpthread -o transmitest_posix
make[1]: Leaving directory '/home/miller/src/peak-linux-driver-8.12.0/test'
make[1]: Entering directory '/home/miller/src/peak-linux-driver-8.12.0/libpcanbasic'
make[2]: Entering directory '/home/miller/src/peak-linux-driver-8.12.0/libpcanbasic/pcanbasic'
***
*** Making PCANBasic library with FD support (PCAN driver >= 8.0)
***
*** target=libpcanbasic
*** version=4.4.2
*** PCAN_ROOT=/home/miller/src/peak-linux-driver-8.12.0
*** gcc version=9
***
mkdir -p out
gcc -fPIC -shared "-O2" -Wall -Wcast-align -Wcast-qual -Wimplicit  -Wpointer-arith -Wswitch -Wredundant-decls -Wreturn-type -Wunused -DNO_RT -I/home/miller/src/peak-linux-driver-8.12.0/driver -I/home/miller/src/peak-linux-driver-8.12.0/lib   -c src/libpcanbasic.c -o out/libpcanbasic.o
gcc -fPIC -shared "-O2" -Wall -Wcast-align -Wcast-qual -Wimplicit  -Wpointer-arith -Wswitch -Wredundant-decls -Wreturn-type -Wunused -DNO_RT -I/home/miller/src/peak-linux-driver-8.12.0/driver -I/home/miller/src/peak-linux-driver-8.12.0/lib   -c src/pcaninfo.c -o out/pcaninfo.o
gcc -fPIC -shared "-O2" -Wall -Wcast-align -Wcast-qual -Wimplicit  -Wpointer-arith -Wswitch -Wredundant-decls -Wreturn-type -Wunused -DNO_RT -I/home/miller/src/peak-linux-driver-8.12.0/driver -I/home/miller/src/peak-linux-driver-8.12.0/lib   -c src/pcanlog.c -o out/pcanlog.o
gcc -fPIC -shared "-O2" -Wall -Wcast-align -Wcast-qual -Wimplicit  -Wpointer-arith -Wswitch -Wredundant-decls -Wreturn-type -Wunused -DNO_RT -I/home/miller/src/peak-linux-driver-8.12.0/driver -I/home/miller/src/peak-linux-driver-8.12.0/lib   -c src/pcbcore.c -o out/pcbcore.o
gcc -fPIC -shared "-O2" -Wall -Wcast-align -Wcast-qual -Wimplicit  -Wpointer-arith -Wswitch -Wredundant-decls -Wreturn-type -Wunused -DNO_RT -I/home/miller/src/peak-linux-driver-8.12.0/driver -I/home/miller/src/peak-linux-driver-8.12.0/lib   -c src/pcblog.c -o out/pcblog.o
gcc -fPIC -shared "-O2" -Wall -Wcast-align -Wcast-qual -Wimplicit  -Wpointer-arith -Wswitch -Wredundant-decls -Wreturn-type -Wunused -DNO_RT -I/home/miller/src/peak-linux-driver-8.12.0/driver -I/home/miller/src/peak-linux-driver-8.12.0/lib   -c src/pcbtrace.c -o out/pcbtrace.o
gcc -fPIC -shared "-O2" -Wall -Wcast-align -Wcast-qual -Wimplicit  -Wpointer-arith -Wswitch -Wredundant-decls -Wreturn-type -Wunused -DNO_RT -I/home/miller/src/peak-linux-driver-8.12.0/driver -I/home/miller/src/peak-linux-driver-8.12.0/lib   -c /home/miller/src/peak-linux-driver-8.12.0/lib/src/libpcanfd.c -o out/libpcanfd.o
gcc -shared -Wl,-soname,libpcanbasic.so -o libpcanbasic.so.4.4.2 out/libpcanbasic.o out/pcaninfo.o out/pcanlog.o out/pcbcore.o out/pcblog.o out/pcbtrace.o out/libpcanfd.o -lm    
ln -sf libpcanbasic.so.4.4.2 libpcanbasic.so
make[2]: Leaving directory '/home/miller/src/peak-linux-driver-8.12.0/libpcanbasic/pcanbasic'
make[2]: Entering directory '/home/miller/src/peak-linux-driver-8.12.0/libpcanbasic/pcaninfo'
*** Making PCANINFO
***
*** target=pcaninfo
*** version=1.2.0
*** PCAN_ROOT=/home/miller/src/peak-linux-driver-8.12.0
*** gcc version=9
***
gcc src/main.c ../pcanbasic/src/pcanlog.c ../pcanbasic/src/pcblog.c ../pcanbasic/src/pcbtrace.c ../pcanbasic/src/pcbcore.c ../pcanbasic/src/pcaninfo.c /home/miller/src/peak-linux-driver-8.12.0/lib/src/libpcanfd.c -O2 -Wall -Wcast-align -Wcast-qual -Wimplicit  -Wpointer-arith -Wswitch -Wredundant-decls -Wreturn-type -Wunused -DNO_RT -I../pcanbasic/src -I/home/miller/src/peak-linux-driver-8.12.0/driver -I/home/miller/src/peak-linux-driver-8.12.0/lib  -lm -ldl  -o pcaninfo.1.2.0
ln -sf pcaninfo.1.2.0 pcaninfo
make[2]: Leaving directory '/home/miller/src/peak-linux-driver-8.12.0/libpcanbasic/pcaninfo'
make[2]: Entering directory '/home/miller/src/peak-linux-driver-8.12.0/libpcanbasic/examples'
make[3]: Entering directory '/home/miller/src/peak-linux-driver-8.12.0/libpcanbasic/examples/python'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/miller/src/peak-linux-driver-8.12.0/libpcanbasic/examples/python'
make[3]: Entering directory '/home/miller/src/peak-linux-driver-8.12.0/libpcanbasic/examples/c++'
***
*** Making PCANBasic C++ examples
***
*** target=pcanwrite pcanread pcaneventread pcaneventwrite
*** g++ version=9
*** PCANBASIC_ROOT=../../pcanbasic
***
g++ -I../../pcanbasic -I/home/miller/src/peak-linux-driver-8.12.0/driver -DNO_RT src/pcanwrite.cpp -L../../pcanbasic -Wl,-rpath ../../pcanbasic -lpcanbasic -o pcanwrite
g++ -I../../pcanbasic -I/home/miller/src/peak-linux-driver-8.12.0/driver -DNO_RT src/pcanread.cpp -L../../pcanbasic -Wl,-rpath ../../pcanbasic -lpcanbasic -o pcanread
g++ -I../../pcanbasic -I/home/miller/src/peak-linux-driver-8.12.0/driver -DNO_RT src/pcaneventread.cpp -L../../pcanbasic -Wl,-rpath ../../pcanbasic -lpcanbasic -o pcaneventread
g++ -I../../pcanbasic -I/home/miller/src/peak-linux-driver-8.12.0/driver -DNO_RT src/pcaneventwrite.cpp -L../../pcanbasic -Wl,-rpath ../../pcanbasic -lpcanbasic -o pcaneventwrite
make[3]: Leaving directory '/home/miller/src/peak-linux-driver-8.12.0/libpcanbasic/examples/c++'
make[2]: Leaving directory '/home/miller/src/peak-linux-driver-8.12.0/libpcanbasic/examples'
make[1]: Leaving directory '/home/miller/src/peak-linux-driver-8.12.0/libpcanbasic'
Apparently I lied about the can-isotp layer, it's not installed at the current time. The one I was using was https://github.com/hartkopp/can-isotp.git but lsmod does not show it.

Code: Select all

$ lsmod | egrep 'can|iso'
can_raw                20480  0
can                    20480  1 can_raw
nls_iso8859_1          16384  1
All in all I don't know why the computer has the higher kernel version than the others... Unless you have a better idea I'm going to reinstall Ubuntu-Mate 20.04 LTS and see if that corrects it. I've never had it not 'just work'

M.Heidemann
Sales & Support
Sales & Support
Posts: 673
Joined: Fri 20. Sep 2019, 13:31

Re: Linux Update and lost peak_usb driver

Post by M.Heidemann » Wed 9. Jun 2021, 10:41

Hello,

i clearly stated, that you will have to build the driver as NetDev in order to use SocketCAN.

Please execute:

Code: Select all

sudo make uninstall
from the driver directory and use
these commands:

Code: Select all

make clean

Code: Select all

make NET=NETDEV_SUPPORT

Code: Select all

sudo make install

Code: Select all

sudo modprobe pcan
Finally check if the driver is correctly installed:

Code: Select all

ip link ls
Please share the results with us.

Best Regards

Marvin

jonbakerfish
Posts: 4
Joined: Tue 7. Sep 2021, 12:34

Re: Linux Update and lost peak_usb driver

Post by jonbakerfish » Tue 7. Sep 2021, 12:40

Hi, I also encountered a similar issue with Ubuntu 20.04.

Before installing the peak-linux-driver-8.12.0, when I plugin the PCAN-USB Pro, the USB light will turn on. But the pcanview will output some errors:

No PCAN device found.
Is the pcan driver loaded ? (No such file or directory)


After installing the driver, the USB light will become turn off all the time and the pcanview still cannot recognize the PCAN-USB.

M.Heidemann
Sales & Support
Sales & Support
Posts: 673
Joined: Fri 20. Sep 2019, 13:31

Re: Linux Update and lost peak_usb driver

Post by M.Heidemann » Tue 7. Sep 2021, 13:07

Hello,

did you use:

Code: Select all

sudo modprobe pcan
to load the driver after installation?

Best Regards

Marvin

Post Reply