Page 1 of 2

PeakCAN linux driver version 7.15.2

Posted: Mon 22. Feb 2016, 01:45
by gmlim
Hi

I have previously used PeakCAN linux driver version 7.4 on Redhat and now I would like to upgrade to version 7.15.2, but after installing and trying cat /proc/pcan with the PCAN-USB Pro FD device plug into my computer it showed the error message: No such file or directory

I have tried:
sudo make uninstall
sudo rmmod pcan

make clean
make NET=NO_NETDEV_SUPPORT
sudo make install
cat proc/pcan

Below are some pictures showing the build messages
1) make uninstall.png
1) make uninstall.png (78.06 KiB) Viewed 13687 times
2) rmmod pcan.png
2) rmmod pcan.png (83.51 KiB) Viewed 13687 times
3.1) make clean make NET=NO_NETDEV_SUPPORT.png
3.1) make clean make NET=NO_NETDEV_SUPPORT.png (212.42 KiB) Viewed 13687 times
3.2) make clean make NET=NO_NETDEV_SUPPORT.png
3.2) make clean make NET=NO_NETDEV_SUPPORT.png (220.39 KiB) Viewed 13687 times
4) sudo make install.png
4) sudo make install.png (208.73 KiB) Viewed 13687 times
5) cat proc pcan.png
5) cat proc pcan.png (39.14 KiB) Viewed 13687 times

Re: PeakCAN linux driver version 7.15.2

Posted: Mon 22. Feb 2016, 14:51
by S.Grosjean
Hi,

Nothing is displayed by "cat /proc/pcan" because, according to your logs, pcan v7.15.2 failed to build.
On our side, we have successfully built v7.15.2 against 2.6.32.70 LTE version of the Kernel.

So, there is something wrong in the headers of your Kernel that prevents pcan to be built.

Could you first retry to build 7.4, please? We would be sure that you are able to build it with your current config...

Regards,

Stéphane

Re: PeakCAN linux driver version 7.15.2

Posted: Tue 1. Mar 2016, 02:45
by gmlim
Hi

I have tried to build 7.4 but it is also unsuccessful

Below are some pictures showing the build messages
1) make_clean1.png
1) make_clean1.png (95.82 KiB) Viewed 13666 times
2.1) make_NET=NO1.png
2.1) make_NET=NO1.png (215.66 KiB) Viewed 13666 times
2.2) make_NET=NO2.png
2.2) make_NET=NO2.png (219.47 KiB) Viewed 13666 times
3) make_install1.png
3) make_install1.png (200.43 KiB) Viewed 13666 times
4) cat_procpcan1.png
4) cat_procpcan1.png (195.7 KiB) Viewed 13666 times
Regards
gmlim

Re: PeakCAN linux driver version 7.15.2

Posted: Tue 1. Mar 2016, 11:11
by S.Grosjean
Hi,

The fact that 7.4 does not compile only shows that you've got a problem in your (kernel) headers. And this problem is the same that prevents from 7.15.2 to be built.

As a workaround, I may suggest to do a symlink to your current gcc includes, something like that:

Code: Select all

$ cd /lib/modules/$(uname -r)/build/include
$ sudo ln -s $(gcc -print-file-name=include)/stdarg.h
Then, back into peak driver dir, rebuild the driver:

Code: Select all

$ cd /usr/local/swdev/peak-linux-driver-7.x
$ make NET=NO
PS: please try to copy-paste your logs from the screen in text format, rather than enclosing screen-shots pictures, thx!

Regards,

Stéphane

Re: PeakCAN linux driver version 7.15.2

Posted: Wed 2. Mar 2016, 00:56
by gmlim
Hi Stéphane

Thank you for the workaround I am now able to build 7.15.2 successfully!

In future I will copy and paste in text form instead of pic.

Just curious if I my original version is 7.4 and when I want to upgrade to 7.15.2, what are the proper steps to be done to prevent the problem of (kernel) headers from appearing?

(for 7.4 there is no option to make uninstall)

Regards
gmlim

Re: PeakCAN linux driver version 7.15.2

Posted: Wed 2. Mar 2016, 09:36
by S.Grosjean
Hi,

Ok, nice to hear that.

You shouldn't encounter such a problem in the future: there is no obvious reason why your <stdarg.h> is not found when compiling the Kernel. Maybe it's a mix between your (very) old Kernel version and a more recent version of gcc...

You're right: the "uninstall" target has been added later in the "pcan" history. With more recent versions, the right way to install a new version of "pcan" as if it was from scratch is:

Code: Select all

$ sudo make -C peak-linux-driver-x.y.z uninstall
$ rm -rf peak-linux-driver-x.y.z
Then continue with installing the new package...

Note: FYI, we just delivered a fresh new beta version of pcan which includes lots of new features to play with...

Regards,

Stéphane

Re: PeakCAN linux driver version 7.15.2

Posted: Tue 8. Mar 2016, 04:03
by gmlim
Hi

I would also be installing PeakCAN linux driver version 7.15.2 on Ubuntu 10.04 but encounter problem when I execute make NET=NO

This time round the error doesn't seems to be due to missing stdarg.h file thus the workaround to do a symlink to current gcc includes does not work;
$ cd /lib/modules/$(uname -r)/build/include
$ sudo ln -s $(gcc -print-file-name=include)/stdarg.h


Below is the build message:

Code: Select all

lohyh@lohyh:/usr/local/SW_DEV/peakcan/peak-linux-driver-7.15.2$ make NET=NO
make[1]: Entering directory `/usr/local/SW_DEV/peakcan/peak-linux-driver-7.15.2/driver'
make[1]: *** No rule to make target `depend'.  Stop.
make[1]: Leaving directory `/usr/local/SW_DEV/peakcan/peak-linux-driver-7.15.2/driver'
make[1]: Entering directory `/usr/local/SW_DEV/peakcan/peak-linux-driver-7.15.2/driver'
***
*** Host machine kernel version=2.6.32-33-generic
*** Driver kernel version=2.6.32-33-generic
*** Path to kernel sources=/lib/modules/2.6.32-33-generic/build
*** use KBUILD=yes
*** cc version=4.4.3
***
make -C /lib/modules/2.6.32-33-generic/build SUBDIRS=/usr/local/SW_DEV/peakcan/peak-linux-driver-7.15.2/driver        EXTRA_CFLAGS="-I/usr/local/SW_DEV/peakcan/peak-linux-driver-7.15.2/driver        -DNO_DEBUG -DMODVERSIONS -DPARPORT_SUBSYSTEM -DUSB_SUPPORT -DPCI_SUPPORT -DPCIEC_SUPPORT -DISA_SUPPORT -DDONGLE_SUPPORT -DPCCARD_SUPPORT -DNO -DNO_RT " V=0 modules
make[2]: Entering directory `/lib/modules/2.6.32-33-generic/build'
make[2]: *** No rule to make target `modules'.  Stop.
make[2]: Leaving directory `/lib/modules/2.6.32-33-generic/build'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/local/SW_DEV/peakcan/peak-linux-driver-7.15.2/driver'
make[1]: Entering directory `/usr/local/SW_DEV/peakcan/peak-linux-driver-7.15.2/lib'
cc src/libpcan.c -DNO_RT -I. -I../driver -fPIC -shared -O2 -Wall  -Wl,-soname,libpcan.so.0 -lc  -o libpcan.so.0.6
ln -sf libpcan.so.0.6 libpcan.so
make[1]: Leaving directory `/usr/local/SW_DEV/peakcan/peak-linux-driver-7.15.2/lib'
make[1]: Entering directory `/usr/local/SW_DEV/peakcan/peak-linux-driver-7.15.2/test'
cc -DNO_RT -g -I. -I../lib -I../driver  src/receivetest.c src/common.c  -lpcan -L../lib -L/lib -L/usr/lib -L/usr/local/lib -o receivetest
cc -DNO_RT -g -I. -I../lib -I../driver  src/transmitest.cpp src/common.c src/parser.cpp  -lpcan -L../lib -L/lib -L/usr/lib -L/usr/local/lib -lstdc++ -o transmitest
cc -DNO_RT -g -I. -I../lib -I../driver  src/bitratetest.c src/common.c  -lpcan -L../lib -L/lib -L/usr/lib -L/usr/local/lib -o bitratetest
cc -DNO_RT -g -I. -I../lib -I../driver  src/filtertest.cpp src/common.c  -lpcan -L../lib -L/lib -L/usr/lib -L/usr/local/lib -lstdc++ -o filtertest
cc -DNO_RT -g -I. -I../lib -I../driver  src/pcan-settings.c  -lpcan -L../lib -L/lib -L/usr/lib -L/usr/local/lib -lpopt -g -o pcan-settings
make[1]: Leaving directory `/usr/local/SW_DEV/peakcan/peak-linux-driver-7.15.2/test'
lohyh@lohyh:/usr/local/SW_DEV/peakcan/peak-linux-driver-7.15.2$

Re: PeakCAN linux driver version 7.15.2

Posted: Tue 8. Mar 2016, 09:47
by S.Grosjean
Hi,

The goal of the given workaround was to fix the issue with your other configuration. This workaround does normally not need to be installed each time! (except if the issue was actually the same).

First of all, be sure to have installed the right linux headers package:

Code: Select all

sudo apt-get install linux-headers
Moreover, please, give me the result of:

Code: Select all

$ ls -l /lib/modules/`uname -r`
and

Code: Select all

$ ls -l /lib/modules/`uname -r`/build/
Thx,

Stéphane

Re: PeakCAN linux driver version 7.15.2

Posted: Wed 9. Mar 2016, 02:06
by gmlim
Hi

Below are the results

Code: Select all

lohyh@lohyh:~$ ls -l /lib/modules/2.6.32-33-generic/
total 3836
drwxr-xr-x  3 root root   4096 2015-03-31 10:03 build
drwxr-xr-x  2 root root   4096 2011-07-19 20:09 initrd
drwxr-xr-x 10 root root   4096 2014-07-15 09:36 kernel
drwxr-xr-x  2 root root   4096 2016-02-19 12:26 misc
-rw-r--r--  1 root root 616454 2016-03-08 08:52 modules.alias
-rw-r--r--  1 root root 594096 2016-03-08 08:52 modules.alias.bin
-rw-r--r--  1 root root   5084 2011-07-08 10:39 modules.builtin
-rw-r--r--  1 root root   6363 2016-03-08 08:52 modules.builtin.bin
-rw-r--r--  1 root root     69 2016-03-08 08:52 modules.ccwmap
-rw-r--r--  1 root root 270678 2016-03-08 08:52 modules.dep
-rw-r--r--  1 root root 399005 2016-03-08 08:52 modules.dep.bin
-rw-r--r--  1 root root   1405 2016-03-08 08:52 modules.ieee1394map
-rw-r--r--  1 root root    218 2016-03-08 08:52 modules.inputmap
-rw-r--r--  1 root root  24886 2016-03-08 08:52 modules.isapnpmap
-rw-r--r--  1 root root     74 2016-03-08 08:52 modules.ofmap
-rw-r--r--  1 root root 104668 2011-07-08 10:39 modules.order
-rw-r--r--  1 root root 407961 2016-03-08 08:52 modules.pcimap
-rw-r--r--  1 root root   1597 2016-03-08 08:52 modules.seriomap
-rw-r--r--  1 root root 222671 2016-03-08 08:52 modules.symbols
-rw-r--r--  1 root root 288617 2016-03-08 08:52 modules.symbols.bin
-rw-r--r--  1 root root 918040 2016-03-08 08:52 modules.usbmap

lohyh@lohyh:~$ ls -l /lib/modules/2.6.32-33-generic/build/
total 4
drwxr-xr-x 2 root root 4096 2016-03-02 08:28 include

Re: PeakCAN linux driver version 7.15.2

Posted: Mon 14. Mar 2016, 10:52
by S.Grosjean
Hi,

Code: Select all

lohyh@lohyh:~$ ls -l /lib/modules/2.6.32-33-generic/build/
total 4
drwxr-xr-x 2 root root 4096 2016-03-02 08:28 include
If what you have pasted above is really the content of the "build" directory of your Ubuntu 10.04 system, then your "Kernel" tree is missing of almost everything to be able to build any out-of-tree Linux driver! For example, it should contain (at least) the Makefile!

On the host running Ubuntu 10.04, can you please give me the result of:

Code: Select all

$ dpkg --get-selections "linux*"
Regards,

Stéphane