problem building peak linux driver

This forum covers PCAN-Linux and Linux development issues concerning our products
Locked
olivier_subatech
Posts: 4
Joined: Tue 14. Nov 2023, 11:59

problem building peak linux driver

Post by olivier_subatech » Tue 14. Nov 2023, 13:51

Hi there,
I can't manage to build the peak linux driver.
Can you please help me on this one ?
below, the output of the make command :

Code: Select all

make[1]: Entering directory '/home/lemaire/code/pcan/peak-linux-driver-8.16.0/driver'
***
*** Making pcan driver in chardev mode
***
*** Host OS Release=Fedora Linux v38
*** Host machine kernel version=6.5.10-200.fc38.x86_64
*** Driver kernel version=6.5.10-200.fc38.x86_64 (6.5.10)
*** Path to kernel sources=/lib/modules/6.5.10-200.fc38.x86_64/build
*** use KBUILD=yes
*** use DKMS=
*** gcc version=13
***
make -C /lib/modules/6.5.10-200.fc38.x86_64/build  EXTRA_CFLAGS="-I/home/lemaire/code/pcan/peak-linux-driver-8.16.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/lemaire/code/pcan/peak-linux-driver-8.16.0/driver
make[2]: Entering directory '/usr/src/kernels/6.5.10-200.fc38.x86_64'
  CC [M]  /home/lemaire/code/pcan/peak-linux-driver-8.16.0/driver/src/pcan_main.o
In file included from ./include/linux/kobject.h:20,
                 from ./include/linux/module.h:21,
                 from /home/lemaire/code/pcan/peak-linux-driver-8.16.0/driver/src/pcan_common.h:48,
                 from /home/lemaire/code/pcan/peak-linux-driver-8.16.0/driver/src/pcan_main.c:36:
/home/lemaire/code/pcan/peak-linux-driver-8.16.0/driver/src/pcan_main.c:3506:22: error: initialization of ‘ssize_t (*)(const struct class *, const struct class_attribute *, char *)’ {aka ‘long int (*)(const struct class *, const struct class_attribute *, char *)’} from incompatible pointer type ‘ssize_t (*)(struct class *, struct class_attribute *, char *)’ {aka ‘long int (*)(struct class *, struct class_attribute *, char *)’} [-Werror=incompatible-pointer-types]
 3506 | static CLASS_ATTR_RO(version);
      |                      ^~~~~~~
./include/linux/sysfs.h:117:19: note: in definition of macro ‘__ATTR_RO’
  117 |         .show   = _name##_show,                                         \
      |                   ^~~~~
/home/lemaire/code/pcan/peak-linux-driver-8.16.0/driver/src/pcan_main.c:3506:8: note: in expansion of macro ‘CLASS_ATTR_RO’
 3506 | static CLASS_ATTR_RO(version);
      |        ^~~~~~~~~~~~~
/home/lemaire/code/pcan/peak-linux-driver-8.16.0/driver/src/pcan_main.c:3506:22: note: (near initialization for ‘class_attr_version.show’)
 3506 | static CLASS_ATTR_RO(version);
      |                      ^~~~~~~
./include/linux/sysfs.h:117:19: note: in definition of macro ‘__ATTR_RO’
  117 |         .show   = _name##_show,                                         \
      |                   ^~~~~
/home/lemaire/code/pcan/peak-linux-driver-8.16.0/driver/src/pcan_main.c:3506:8: note: in expansion of macro ‘CLASS_ATTR_RO’
 3506 | static CLASS_ATTR_RO(version);
      |        ^~~~~~~~~~~~~
/home/lemaire/code/pcan/peak-linux-driver-8.16.0/driver/src/pcan_main.c:3507:22: error: initialization of ‘ssize_t (*)(const struct class *, const struct class_attribute *, char *)’ {aka ‘long int (*)(const struct class *, const struct class_attribute *, char *)’} from incompatible pointer type ‘ssize_t (*)(struct class *, struct class_attribute *, char *)’ {aka ‘long int (*)(struct class *, struct class_attribute *, char *)’} [-Werror=incompatible-pointer-types]
 3507 | static CLASS_ATTR_RO(clk_ref);
      |                      ^~~~~~~
./include/linux/sysfs.h:117:19: note: in definition of macro ‘__ATTR_RO’
  117 |         .show   = _name##_show,                                         \
      |                   ^~~~~
/home/lemaire/code/pcan/peak-linux-driver-8.16.0/driver/src/pcan_main.c:3507:8: note: in expansion of macro ‘CLASS_ATTR_RO’
 3507 | static CLASS_ATTR_RO(clk_ref);
      |        ^~~~~~~~~~~~~
/home/lemaire/code/pcan/peak-linux-driver-8.16.0/driver/src/pcan_main.c:3507:22: note: (near initialization for ‘class_attr_clk_ref.show’)
 3507 | static CLASS_ATTR_RO(clk_ref);
      |                      ^~~~~~~
./include/linux/sysfs.h:117:19: note: in definition of macro ‘__ATTR_RO’
  117 |         .show   = _name##_show,                                         \
      |                   ^~~~~
/home/lemaire/code/pcan/peak-linux-driver-8.16.0/driver/src/pcan_main.c:3507:8: note: in expansion of macro ‘CLASS_ATTR_RO’
 3507 | static CLASS_ATTR_RO(clk_ref);
      |        ^~~~~~~~~~~~~
/home/lemaire/code/pcan/peak-linux-driver-8.16.0/driver/src/pcan_main.c: In function ‘init_module’:
/home/lemaire/code/pcan/peak-linux-driver-8.16.0/driver/src/pcan_main.c:4813:9: warning: ignoring return value of ‘class_register’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
 4813 |         class_register(&pcan_class);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[4]: *** [scripts/Makefile.build:243: /home/lemaire/code/pcan/peak-linux-driver-8.16.0/driver/src/pcan_main.o] Error 1
make[3]: *** [/usr/src/kernels/6.5.10-200.fc38.x86_64/Makefile:2046: /home/lemaire/code/pcan/peak-linux-driver-8.16.0/driver] Error 2
make[2]: *** [Makefile:246: __sub-make] Error 2
make[2]: Leaving directory '/usr/src/kernels/6.5.10-200.fc38.x86_64'
make[1]: *** [Makefile:523: all] Error 2
make[1]: Leaving directory '/home/lemaire/code/pcan/peak-linux-driver-8.16.0/driver'
make: *** [Makefile:84: all] Error 2

M.Maidhof
Support
Support
Posts: 1739
Joined: Wed 22. Sep 2010, 14:00

Re: problem building peak linux driver

Post by M.Maidhof » Tue 14. Nov 2023, 13:58

Hi,

please send an email to our support email address telling us the serial number of your PCAN hardware. You need a patch for using the peak-linux-driver-8.16 with such a recent kernel version 6.5.x.

regards

Michael

olivier_subatech
Posts: 4
Joined: Tue 14. Nov 2023, 11:59

Re: problem building peak linux driver

Post by olivier_subatech » Tue 14. Nov 2023, 14:05

Hi Michael,
Thank you very for your help.
Just a stupid question. Do I need to install the driver if I want to use the pcan ethernet gateway DR or I may be able to communicate with the gateway using simple Linux TCP socket ?
Many thanks for your help.
Regards,
Olivier
Last edited by olivier_subatech on Tue 14. Nov 2023, 14:10, edited 1 time in total.

M.Maidhof
Support
Support
Posts: 1739
Joined: Wed 22. Sep 2010, 14:00

Re: problem building peak linux driver

Post by M.Maidhof » Tue 14. Nov 2023, 14:10

Hi Olivier,

the PCAN-Ethernet Gateway is not supported by our peak-linux-driver. In that case you don't need that driver at all. You can use Linux sockets to communicate with the PCAN-Ethernet Gateway. See Developer Documentation for more details:

https://www.peak-system.com/produktcd/P ... on_eng.pdf

regards

Michael

olivier_subatech
Posts: 4
Joined: Tue 14. Nov 2023, 11:59

Re: problem building peak linux driver

Post by olivier_subatech » Tue 14. Nov 2023, 14:17

Thank you for your answer.

YoanEyeLights
Posts: 1
Joined: Fri 12. Jan 2024, 17:36

Re: problem building peak linux driver

Post by YoanEyeLights » Fri 12. Jan 2024, 17:41

M.Maidhof wrote:
Tue 14. Nov 2023, 13:58
Hi,

please send an email to our support email address telling us the serial number of your PCAN hardware. You need a patch for using the peak-linux-driver-8.16 with such a recent kernel version 6.5.x.

regards

Michael
Hi Michael, here we have the same issue, could you please share the patch to let us compile the peak-linux-driver-8.16.0 driver ?

We want to use the PCAN basic API with Python.

You'll find below some commands if it could help you to debug.

Code: Select all

make
make[1] : on entre dans le répertoire « /home/utilisateur/Téléchargements/peak-linux-driver-8.16.0/driver »
***
*** Making pcan driver in chardev mode
***
*** Host OS Release=Ubuntu v22.04
*** Host machine kernel version=6.5.0-14-generic
*** Driver kernel version=6.5.0-14-generic (6.5.0)
*** Path to kernel sources=/usr/src/linux-headers-6.5.0-14-generic
*** use KBUILD=yes
*** use DKMS=
*** gcc version=12
***
make -C /usr/src/linux-headers-6.5.0-14-generic  EXTRA_CFLAGS="-I/home/utilisateur/Téléchargements/peak-linux-driver-8.16.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/utilisateur/Téléchargements/peak-linux-driver-8.16.0/driver
make[2] : on entre dans le répertoire « /usr/src/linux-headers-6.5.0-14-generic »
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: x86_64-linux-gnu-gcc-12 (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0
  You are using:           gcc-12 (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0
  CC [M]  /home/utilisateur/Téléchargements/peak-linux-driver-8.16.0/driver/src/pcan_main.o
In file included from ./include/linux/kobject.h:20,
                 from ./include/linux/module.h:21,
                 from /home/utilisateur/Téléchargements/peak-linux-driver-8.16.0/driver/src/pcan_common.h:48,
                 from /home/utilisateur/Téléchargements/peak-linux-driver-8.16.0/driver/src/pcan_main.c:36:
/home/utilisateur/Téléchargements/peak-linux-driver-8.16.0/driver/src/pcan_main.c:3506:22: error: initialization of ‘ssize_t (*)(const struct class *, const struct class_attribute *, char *)’ {aka ‘long int (*)(const struct class *, const struct class_attribute *, char *)’} from incompatible pointer type ‘ssize_t (*)(struct class *, struct class_attribute *, char *)’ {aka ‘long int (*)(struct class *, struct class_attribute *, char *)’} [-Werror=incompatible-pointer-types]
 3506 | static CLASS_ATTR_RO(version);
      |                      ^~~~~~~
./include/linux/sysfs.h:117:19: note: in definition of macro ‘__ATTR_RO’
  117 |         .show   = _name##_show,                                         \
      |                   ^~~~~
/home/utilisateur/Téléchargements/peak-linux-driver-8.16.0/driver/src/pcan_main.c:3506:8: note: in expansion of macro ‘CLASS_ATTR_RO’
 3506 | static CLASS_ATTR_RO(version);
      |        ^~~~~~~~~~~~~
/home/utilisateur/Téléchargements/peak-linux-driver-8.16.0/driver/src/pcan_main.c:3506:22: note: (near initialization for ‘class_attr_version.show’)
 3506 | static CLASS_ATTR_RO(version);
      |                      ^~~~~~~
./include/linux/sysfs.h:117:19: note: in definition of macro ‘__ATTR_RO’
  117 |         .show   = _name##_show,                                         \
      |                   ^~~~~
/home/utilisateur/Téléchargements/peak-linux-driver-8.16.0/driver/src/pcan_main.c:3506:8: note: in expansion of macro ‘CLASS_ATTR_RO’
 3506 | static CLASS_ATTR_RO(version);
      |        ^~~~~~~~~~~~~
/home/utilisateur/Téléchargements/peak-linux-driver-8.16.0/driver/src/pcan_main.c:3507:22: error: initialization of ‘ssize_t (*)(const struct class *, const struct class_attribute *, char *)’ {aka ‘long int (*)(const struct class *, const struct class_attribute *, char *)’} from incompatible pointer type ‘ssize_t (*)(struct class *, struct class_attribute *, char *)’ {aka ‘long int (*)(struct class *, struct class_attribute *, char *)’} [-Werror=incompatible-pointer-types]
 3507 | static CLASS_ATTR_RO(clk_ref);
      |                      ^~~~~~~
./include/linux/sysfs.h:117:19: note: in definition of macro ‘__ATTR_RO’
  117 |         .show   = _name##_show,                                         \
      |                   ^~~~~
/home/utilisateur/Téléchargements/peak-linux-driver-8.16.0/driver/src/pcan_main.c:3507:8: note: in expansion of macro ‘CLASS_ATTR_RO’
 3507 | static CLASS_ATTR_RO(clk_ref);
      |        ^~~~~~~~~~~~~
/home/utilisateur/Téléchargements/peak-linux-driver-8.16.0/driver/src/pcan_main.c:3507:22: note: (near initialization for ‘class_attr_clk_ref.show’)
 3507 | static CLASS_ATTR_RO(clk_ref);
      |                      ^~~~~~~
./include/linux/sysfs.h:117:19: note: in definition of macro ‘__ATTR_RO’
  117 |         .show   = _name##_show,                                         \
      |                   ^~~~~
/home/utilisateur/Téléchargements/peak-linux-driver-8.16.0/driver/src/pcan_main.c:3507:8: note: in expansion of macro ‘CLASS_ATTR_RO’
 3507 | static CLASS_ATTR_RO(clk_ref);
      |        ^~~~~~~~~~~~~
/home/utilisateur/Téléchargements/peak-linux-driver-8.16.0/driver/src/pcan_main.c: In function ‘init_module’:
/home/utilisateur/Téléchargements/peak-linux-driver-8.16.0/driver/src/pcan_main.c:4813:9: warning: ignoring return value of ‘class_register’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
 4813 |         class_register(&pcan_class);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[4]: *** [scripts/Makefile.build:251 : /home/utilisateur/Téléchargements/peak-linux-driver-8.16.0/driver/src/pcan_main.o] Erreur 1
make[3]: *** [/usr/src/linux-headers-6.5.0-14-generic/Makefile:2037 : /home/utilisateur/Téléchargements/peak-linux-driver-8.16.0/driver] Erreur 2
make[2]: *** [Makefile:234 : __sub-make] Erreur 2
make[2] : on quitte le répertoire « /usr/src/linux-headers-6.5.0-14-generic »
make[1]: *** [Makefile:523 : all] Erreur 2
make[1] : on quitte le répertoire « /home/utilisateur/Téléchargements/peak-linux-driver-8.16.0/driver »
make: *** [Makefile:84 : all] Erreur 2

Code: Select all

uname -a
Linux utilisateur-Inspiron-14-5420 6.5.0-14-generic #14~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Nov 20 18:15:30 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

Code: Select all

uname -r
6.5.0-14-generic
Thanks in advance !

Yoan

F.Albers
Posts: 4
Joined: Mon 12. Mar 2018, 13:41

Re: problem building peak linux driver

Post by F.Albers » Mon 15. Jan 2024, 09:55

Hello,

I'm running into exactly the same issue as YoanEyeLights after updating to the 6.5 kernel.

Could you pelase send me the patch as well (or make it publicly available, since it will most likely affect more people after the update to the 6.5 kernel was recently released)?

Thanks in advance and best regards,
Franz

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

Re: problem building peak linux driver

Post by PEAK-Support » Fri 19. Jan 2024, 09:23

*** Update ***
The problem is fixed, and the driver is released and could be download from the Linux page.
! Topic closed !
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

Locked