PEAK-Linux Driver on Raspberry Pi

This forum covers PCAN-Linux and Linux development issues concerning our products
M.Maidhof
Support
Support
Posts: 1320
Joined: Wed 22. Sep 2010, 14:00

Re: PEAK-Linux Driver on Raspberry Pi

Post by M.Maidhof » Tue 25. Jun 2013, 15:22

Hi,

looks ok. Please send the full output of your make process. Check also dmesg for relevant outputs. Please update your PI to the latest version: sudo apt-get update, sudo apt-get upgrade.

regards

Michael

mohamed mahmoud
Posts: 4
Joined: Tue 25. Jun 2013, 14:21

Re: PEAK-Linux Driver on Raspberry Pi

Post by mohamed mahmoud » Wed 26. Jun 2013, 13:17

Hello,

I updated PI to the latest version, and the problem still exists. Here's the build output:

Code: Select all

make[1]: Entering directory `/root/Downloads/peak-linux-driver-7.8/driver'
make[1]: *** No rule to make target `depend'.  Stop.
make[1]: Leaving directory `/root/Downloads/peak-linux-driver-7.8/driver'
make[1]: Entering directory `/root/Downloads/peak-linux-driver-7.8/driver'
***
*** Host machine kernel version=3.6.11+
*** Driver kernel version=3.6.11
*** Path to kernel sources=/lib/modules/3.6.11+/build
*** use KBUILD=yes
***
make -C /lib/modules/3.6.11+/build SUBDIRS=/root/Downloads/peak-linux-driver-7.8/driver        EXTRA_CFLAGS="-I/root/Downloads/peak-linux-driver-7.8/driver        -DNO_DEBUG -DMODVERSIONS -DNO -DUSB_SUPPORT -DNO -DNO_PCIEC_SUPPORT -DNO -DNO -DNO -DNO -DNO_RT " V=0 modules
make[2]: Entering directory `/usr/src/linux-headers-3.6.11+'

  WARNING: Symbol version dump /usr/src/linux-headers-3.6.11+/Module.symvers
           is missing; modules will have no dependencies and modversions.

  CC [M]  /root/Downloads/peak-linux-driver-7.8/driver/src/pcan_main.o
  CC [M]  /root/Downloads/peak-linux-driver-7.8/driver/src/pcan_fops.o
  CC [M]  /root/Downloads/peak-linux-driver-7.8/driver/src/pcan_fifo.o
  CC [M]  /root/Downloads/peak-linux-driver-7.8/driver/src/pcan_filter.o
  CC [M]  /root/Downloads/peak-linux-driver-7.8/driver/src/pcan_parse.o
  CC [M]  /root/Downloads/peak-linux-driver-7.8/driver/src/pcan_sja1000.o
  CC [M]  /root/Downloads/peak-linux-driver-7.8/driver/src/pcan_common.o
  CC [M]  /root/Downloads/peak-linux-driver-7.8/driver/src/pcan_usb_core.o
  CC [M]  /root/Downloads/peak-linux-driver-7.8/driver/src/pcan_usb.o
  CC [M]  /root/Downloads/peak-linux-driver-7.8/driver/src/pcan_usbpro.o
  CC [M]  /root/Downloads/peak-linux-driver-7.8/driver/src/pcan_timing.o
  LD [M]  /root/Downloads/peak-linux-driver-7.8/driver/pcan.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /root/Downloads/peak-linux-driver-7.8/driver/pcan.mod.o
  LD [M]  /root/Downloads/peak-linux-driver-7.8/driver/pcan.ko
make[2]: Leaving directory `/usr/src/linux-headers-3.6.11+'
make[1]: Leaving directory `/root/Downloads/peak-linux-driver-7.8/driver'
make[1]: Entering directory `/root/Downloads/peak-linux-driver-7.8/lib'
# ln -sf ../driver/pcan.h pcan.h
cc src/libpcan.c -fPIC -shared -O2 -Wall -Wl,-soname,libpcan.so.0 -lc -I. -I../driver -DNO_RT -o libpcan.so.0.6
ln -sf libpcan.so.0.6 libpcan.so
make[1]: Leaving directory `/root/Downloads/peak-linux-driver-7.8/lib'
make[1]: Entering directory `/root/Downloads/peak-linux-driver-7.8/test'
cc src/receivetest.c src/common.c -I. -I../lib -I../driver -L../lib -L/lib -L/usr/lib -L/usr/local/lib -o receivetest   -lpcan -DNO_RT
cc src/transmitest.cpp src/common.c src/parser.cpp -I. -I../lib -I../driver -L../lib -L/lib -L/usr/lib -L/usr/local/lib -o transmitest   -lpcan -lstdc++ -DNO_RT
cc src/bitratetest.c src/common.c -I. -I../lib -I../driver -L../lib -L/lib -L/usr/lib -L/usr/local/lib -o bitratetest   -lpcan -DNO_RT
cc src/filtertest.cpp src/common.c -I. -I../lib -I../driver -L../lib -L/lib -L/usr/lib -L/usr/local/lib -o filtertest   -lpcan -lstdc++ -DNO_RT
cc src/pcan-settings.c -I. -I../lib -I../driver -L../lib -L/lib -L/usr/lib -L/usr/local/lib -o pcan-settings   -lpopt -g
make[1]: Leaving directory `/root/Downloads/peak-linux-driver-7.8/test'
Thanks,

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

Re: PEAK-Linux Driver on Raspberry Pi

Post by M.Maidhof » Thu 27. Jun 2013, 11:21

Hi,

so here is the output from my Pi:

Code: Select all

mm@raspberrypi ~/peak-linux-driver-7.8/driver $ uname -r
3.6.11+
mm@raspberrypi ~/peak-linux-driver-7.8/driver $ make clean
rm -f src/*o src/*~ src/.*cmd *o *ko *~ .*cmd  pcan.mod.c
mm@raspberrypi ~/peak-linux-driver-7.8/driver $ make NET=NO PCI=NO PCC=NO ISA=NO DNG=NO PAR=NO
***
*** Host machine kernel version=3.6.11+
*** Driver kernel version=3.6.11
*** Path to kernel sources=/lib/modules/3.6.11+/build
*** use KBUILD=yes
***
make -C /lib/modules/3.6.11+/build SUBDIRS=/home/mm/peak-linux-driver-7.8/driver        EXTRA_CFLAGS="-I/home/mm/peak-linux-driver-7.8/driver        -DNO_DEBUG -DMODVERSIONS -DNO -DUSB_SUPPORT -DNO -DNO_PCIEC_SUPPORT -DNO -DNO -DNO -DNO -DNO_RT " V=0 modules
make[1]: Entering directory `/usr/src/linux-headers-3.6.11+'
  CC [M]  /home/mm/peak-linux-driver-7.8/driver/src/pcan_main.o
  CC [M]  /home/mm/peak-linux-driver-7.8/driver/src/pcan_fops.o
  CC [M]  /home/mm/peak-linux-driver-7.8/driver/src/pcan_fifo.o
  CC [M]  /home/mm/peak-linux-driver-7.8/driver/src/pcan_filter.o
  CC [M]  /home/mm/peak-linux-driver-7.8/driver/src/pcan_parse.o
  CC [M]  /home/mm/peak-linux-driver-7.8/driver/src/pcan_sja1000.o
  CC [M]  /home/mm/peak-linux-driver-7.8/driver/src/pcan_common.o
  CC [M]  /home/mm/peak-linux-driver-7.8/driver/src/pcan_usb_core.o
  CC [M]  /home/mm/peak-linux-driver-7.8/driver/src/pcan_usb.o
  CC [M]  /home/mm/peak-linux-driver-7.8/driver/src/pcan_usbpro.o
  CC [M]  /home/mm/peak-linux-driver-7.8/driver/src/pcan_timing.o
  LD [M]  /home/mm/peak-linux-driver-7.8/driver/pcan.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /home/mm/peak-linux-driver-7.8/driver/pcan.mod.o
  LD [M]  /home/mm/peak-linux-driver-7.8/driver/pcan.ko
make[1]: Leaving directory `/usr/src/linux-headers-3.6.11+'
mm@raspberrypi ~/peak-linux-driver-7.8/driver $ sudo insmod pcan.ko
mm@raspberrypi ~/peak-linux-driver-7.8/driver $ cat /proc/pcan

*------------- PEAK-System CAN interfaces (www.peak-system.com) -------------
*------------- Release_20130131_n (7.8.0) Jun 27 2013 11:07:58 --------------
*------------------------------- [mod] [usb] --------------------------------
*--------------------- 1 interfaces @ major 248 found -----------------------
*n -type- ndev --base-- irq --btr- --read-- --write- --irqs-- -errors- status
32    usb -NA- ffffffff 255 0x001c 00000000 00000000 00000000 00000000 0x0000

mm@raspberrypi ~/peak-linux-driver-7.8/driver $
please do the same steps on your system. Please do those steps in the \driver directory only.

regards

Michael

mohamed mahmoud
Posts: 4
Joined: Tue 25. Jun 2013, 14:21

Re: PEAK-Linux Driver on Raspberry Pi

Post by mohamed mahmoud » Thu 27. Jun 2013, 12:14

Hello,

I solved the problem. the file Module.symvers was messing in the kernel-headers. i downloaded it from github then i placed it in /usr/src/linux-headers-3.6.11+, then i re-built the driver and it worked this time. now , i can load the module.

Here's the link where i downloaded Module.symvers:
https://github.com/raspberrypi/firmware ... le.symvers

Thanks,

emilio.munoz
Posts: 3
Joined: Tue 25. Jun 2013, 13:32

Re: PEAK-Linux Driver on Raspberry Pi

Post by emilio.munoz » Mon 15. Jul 2013, 11:34

Hi,

Finally I could install the driver. The problem in my case was that at the utsrelease.h located in the folder of the linux-headers was written "3.6.11", so I have to add the "+"

Anyway, now I am having a different problem, because I compiled the kernel and now when I try to install the driver it appers the following error: "can't find /include/linux/version.h"

The thing is that now my kernel version is different, because when I write uname -r I get "3.6.11-cutdown+". I guess this is the problem, but I don't know how to solve it.

thanks for your attention.

Emilio

User avatar
U.Wilhelm
Sales & Support
Sales & Support
Posts: 1216
Joined: Fri 10. Sep 2010, 19:34

Re: PEAK-Linux Driver on Raspberry Pi

Post by U.Wilhelm » Tue 16. Jul 2013, 10:58

Have you checked that you have a symbolic link to your header file directory?
See PDF Docu, page 14, section 5.2.1:
Up from kernel version 2.6.x the completely configured
kernel sources for your target system have to be installed. If
it is a standard installation the sources are located under
“/usr/src/linux“ in which this normally is a link e.g. to
“/usr/src/linux-2.6.6“. For every kernel smaller or equal than
2.4.x only the “kernel-headers“ have to be installed. (It's not
wrong to install the complete sources of the target system.)
The kernel-headers are installed if the invocation of “cat
/lib/modules/'uname -r'/build/include/linux/modversions.h“
is ending without an error. (“'uname -r'“ is a placeholder for
the result of the invocation “uname -r“.)
--------------------------------
PEAK-System Technik
Technical Support Team
support@peak-system.com
-------------------------------

emilio.munoz
Posts: 3
Joined: Tue 25. Jun 2013, 13:32

Re: PEAK-Linux Driver on Raspberry Pi

Post by emilio.munoz » Wed 17. Jul 2013, 16:42

Yes....that was the problem!! Thanks! Now it works!.

The only thing is that when I try to install a NETDEV driver utility and I compile your driver with

make NET=NETDEV_SUPPORT PCI=NO PAR=NO ISA=NO PCC=NO DNG=NO

what I get with cat /proc/pcan command is:

│*n -type- ndev --base-- irq --btr- --read-- --write- --irqs-- -errors- status
│32 usb -NA- ffffffff 255 0x001c 00000000 00000000 00000000 00000000 0x0000

The ndev column should be can0 instead of -NA-. I know that the SocketCAN option is not enabled in the kernel config of the Raspberry PI, but I tried to compile the kernel following some instructions: (http://elinux.org/RPi_CANBus) but it is still not working with the can0 at ndev.

I don't know what I can be doing wrong

User avatar
U.Wilhelm
Sales & Support
Sales & Support
Posts: 1216
Joined: Fri 10. Sep 2010, 19:34

Re: PEAK-Linux Driver on Raspberry Pi

Post by U.Wilhelm » Wed 17. Jul 2013, 17:15

You have compiled the CharDev Driver
│*n -type- ndev --base-- irq --btr- --read-- --write- --irqs-- -errors- status
│32 usb -NA- ffffffff 255 0x001c 00000000 00000000 00000000 00000000 0x0000

have you removed the CharDev driver before you try to install the NetDev?
--------------------------------
PEAK-System Technik
Technical Support Team
support@peak-system.com
-------------------------------

ckeydel
Posts: 26
Joined: Thu 4. Nov 2010, 16:06

Re: PEAK-Linux Driver on Raspberry Pi

Post by ckeydel » Thu 29. Aug 2013, 12:59

Hi Michael,

I am trying the same thing right now but can't get the kernel module to load. I have a brand new RPi, the latest standard wheezy from the Raspberry Pi foundation, completely updated system and I followed the instructions to the letter. Here is the output of my build:

Code: Select all

pi@raspberrypi ~/install/peak-linux-driver-7.8/driver $ uname -r
3.6.11+
pi@raspberrypi ~/install/peak-linux-driver-7.8/driver $ make clean
rm -f src/*o src/*~ src/.*cmd *o *ko *~ .*cmd  pcan.mod.c
pi@raspberrypi ~/install/peak-linux-driver-7.8/driver $ make NET=NO PCI=NO PCC=NO ISA=NO DNG=NO PAR=NO
***
*** Host machine kernel version=3.6.11+
*** Driver kernel version=3.6.11
*** Path to kernel sources=/lib/modules/3.6.11+/build
*** use KBUILD=yes
***
make -C /lib/modules/3.6.11+/build SUBDIRS=/home/pi/install/peak-linux-driver-7.8/driver        EXTRA_CFLAGS="-I/home/pi/install/peak-linux-driver-7.8/driver        -DNO_DEBUG -DMODVERSIONS -DNO -DUSB_SUPPORT -DNO -DNO_PCIEC_SUPPORT -DNO -DNO -DNO -DNO -DNO_RT " V=0 modules
make[1]: Entering directory `/usr/src/linux-headers-3.6.11+'
  CC [M]  /home/pi/install/peak-linux-driver-7.8/driver/src/pcan_main.o
  CC [M]  /home/pi/install/peak-linux-driver-7.8/driver/src/pcan_fops.o
  CC [M]  /home/pi/install/peak-linux-driver-7.8/driver/src/pcan_fifo.o
  CC [M]  /home/pi/install/peak-linux-driver-7.8/driver/src/pcan_filter.o
  CC [M]  /home/pi/install/peak-linux-driver-7.8/driver/src/pcan_parse.o
  CC [M]  /home/pi/install/peak-linux-driver-7.8/driver/src/pcan_sja1000.o
  CC [M]  /home/pi/install/peak-linux-driver-7.8/driver/src/pcan_common.o
  CC [M]  /home/pi/install/peak-linux-driver-7.8/driver/src/pcan_usb_core.o
  CC [M]  /home/pi/install/peak-linux-driver-7.8/driver/src/pcan_usb.o
  CC [M]  /home/pi/install/peak-linux-driver-7.8/driver/src/pcan_usbpro.o
  CC [M]  /home/pi/install/peak-linux-driver-7.8/driver/src/pcan_timing.o
  LD [M]  /home/pi/install/peak-linux-driver-7.8/driver/pcan.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /home/pi/install/peak-linux-driver-7.8/driver/pcan.mod.o
  LD [M]  /home/pi/install/peak-linux-driver-7.8/driver/pcan.ko
make[1]: Leaving directory `/usr/src/linux-headers-3.6.11+'
pi@raspberrypi ~/install/peak-linux-driver-7.8/driver $ sudo insmod pcan.ko
Error: could not insert module pcan.ko: Invalid module format
It looks exactly like yours, except I can't load the module. Any ideas?

Cheers,
Chris

User avatar
U.Wilhelm
Sales & Support
Sales & Support
Posts: 1216
Joined: Fri 10. Sep 2010, 19:34

Re: PEAK-Linux Driver on Raspberry Pi

Post by U.Wilhelm » Fri 30. Aug 2013, 08:52

Hi Chris,
i do not see any differnt between the way you did it and how Michael show how to do it.
Have you any news? Solution?
--------------------------------
PEAK-System Technik
Technical Support Team
support@peak-system.com
-------------------------------

Post Reply