PEAK-Linux Driver on Raspberry Pi

This forum covers PCAN-Linux and Linux development issues concerning our products
Hans.Peter
Posts: 5
Joined: Mon 2. Sep 2013, 13:00

Re: PEAK-Linux Driver on Raspberry Pi

Post by Hans.Peter » Mon 2. Sep 2013, 13:11

Yes, i've the same problem like Chris. Installed today latest raspbian with all updates and 3.6.11+ kernel-headers from github.com

My output:

Code: Select all

root@raspberrypi:~/peak-linux-driver-7.9/driver# make clean
rm -f src/*o src/*~ src/.*cmd *o *ko *~ .*cmd  pcan.mod.c
root@raspberrypi:~/peak-linux-driver-7.9/driver# make NET=NO PCI=NO PAR=NO ISA=NO PCC=NO DNG=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=/root/peak-linux-driver-7.9/driver EXTRA_CFLAGS="-I/root/peak-linux-driver-7.9/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]  /root/peak-linux-driver-7.9/driver/src/pcan_main.o
  CC [M]  /root/peak-linux-driver-7.9/driver/src/pcan_fops.o
  CC [M]  /root/peak-linux-driver-7.9/driver/src/pcan_fifo.o
  CC [M]  /root/peak-linux-driver-7.9/driver/src/pcan_filter.o
  CC [M]  /root/peak-linux-driver-7.9/driver/src/pcan_parse.o
  CC [M]  /root/peak-linux-driver-7.9/driver/src/pcan_sja1000.o
  CC [M]  /root/peak-linux-driver-7.9/driver/src/pcan_common.o
  CC [M]  /root/peak-linux-driver-7.9/driver/src/pcan_usb_core.o
  CC [M]  /root/peak-linux-driver-7.9/driver/src/pcan_usb.o
  CC [M]  /root/peak-linux-driver-7.9/driver/src/pcan_usbpro.o
  CC [M]  /root/peak-linux-driver-7.9/driver/src/pcan_timing.o
  LD [M]  /root/peak-linux-driver-7.9/driver/pcan.o
  Building modules, stage 2.
  MODPOST 1 modules
WARNING: "malloc_sizes" [/root/peak-linux-driver-7.9/driver/pcan.ko] undefined!
  CC      /root/peak-linux-driver-7.9/driver/pcan.mod.o
  LD [M]  /root/peak-linux-driver-7.9/driver/pcan.ko
make[1]: Leaving directory `/usr/src/linux-headers-3.6.11+'
root@raspberrypi:~/peak-linux-driver-7.9/driver# insmod ./pcan.ko
Error: could not insert module ./pcan.ko: Invalid module format
O.k. here i tried the 7.9 driver. But with 7.8 i've the same module insert problem. Only difference with 7.8: No "malloc_sizes" warning.

regards Hans
Last edited by Hans.Peter on Mon 2. Sep 2013, 14:19, edited 1 time in total.

User avatar
S.Grosjean
Software Development
Software Development
Posts: 302
Joined: Wed 4. Jul 2012, 17:02

Re: PEAK-Linux Driver on Raspberry Pi

Post by S.Grosjean » Mon 2. Sep 2013, 13:40

Hi,

Is it possible to copy-paste the output of dmesg, when the module insertion failed, please? When a module failed to load, we get a bit more information from the Kernel logs.

$ dmesg | tail -n 20

should do the trick.

Thanks and regards,

Stéphane
— Stéphane

Hans.Peter
Posts: 5
Joined: Mon 2. Sep 2013, 13:00

Re: PEAK-Linux Driver on Raspberry Pi

Post by Hans.Peter » Mon 2. Sep 2013, 13:49

Code: Select all

root@raspberrypi:~/peak-linux-driver-7.9/driver# insmod ./pcan.ko
Error: could not insert module ./pcan.ko: Invalid module format
root@raspberrypi:~/peak-linux-driver-7.9/driver# dmesg | tail -n 20
[    2.912780] usb 1-1.1: new high-speed USB device number 3 using dwc_otg
[    3.043170] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00
[    3.052150] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    3.070010] smsc95xx v1.0.4
[    3.137111] smsc95xx 1-1.1:1.0: eth0: register 'smsc95xx' at usb-bcm2708_usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:66:47:f8
[    3.252966] usb 1-1.2: new full-speed USB device number 4 using dwc_otg
[    3.387932] usb 1-1.2: New USB device found, idVendor=0c72, idProduct=000c
[    3.405554] usb 1-1.2: New USB device strings: Mfr=0, Product=3, SerialNumber=0
[    3.424684] usb 1-1.2: Product: VER1:PEAK
[    3.424684] VER2:02.8.01
[    3.424684] DAT :06.05.2004
[    3.424684] TIME:09:35:37
[    3.424684]                              ...
[    3.821050] udevd[154]: starting version 175
[    5.030449] Registered led device: led0
[    8.493673] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[    8.913535] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[   17.768328] smsc95xx 1-1.1:1.0: eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1
[   21.248368] Adding 102396k swap on /var/swap.  Priority:-1 extents:2 across:507900k SS
[   54.855233] pcan: disagrees about version of symbol module_layout
Here the output of installing the kernel headers. Maybe it's usefull too. Please attend to the grep error that will occur.

Code: Select all

root@raspberrypi:~# dpkg -i linux-headers-3.6.11+_3.6.11+-2_armhf.deb
Vormals nicht ausgewähltes Paket linux-headers-3.6.11+ wird gewählt.
(Lese Datenbank ... 65628 Dateien und Verzeichnisse sind derzeit installiert.)
Entpacken von linux-headers-3.6.11+ (aus linux-headers-3.6.11+_3.6.11+-2_armhf.deb) ...
linux-headers-3.6.11+ (3.6.11+-2) wird eingerichtet ...
--2013-09-02 14:49:18--  https://github.com/raspberrypi/firmware/raw/master/extra/Module.symvers
Auflösen des Hostnamen »github.com (github.com)«... 192.30.252.129
Verbindungsaufbau zu github.com (github.com)|192.30.252.129|:443... verbunden.
HTTP-Anforderung gesendet, warte auf Antwort... 302 Found
Platz: https://raw.github.com/raspberrypi/firmware/master/extra/Module.symvers[folge]
--2013-09-02 14:49:24--  https://raw.github.com/raspberrypi/firmware/master/extra/Module.symvers
Auflösen des Hostnamen »raw.github.com (raw.github.com)«... 185.31.16.133
Verbindungsaufbau zu raw.github.com (raw.github.com)|185.31.16.133|:443... verbunden.
HTTP-Anforderung gesendet, warte auf Antwort... 200 OK
Länge: 450335 (440K) [text/plain]
In »»/usr/src/linux-headers-3.6.11+/Module.symvers«« speichern.

100%[==========================================================================================================================>] 450.335     2,53M/s   in 0,2s

»Last-modified«-Kopfzeile fehlt -- Zeitstempel abgeschaltet.
2013-09-02 14:49:31 (2,53 MB/s) - »»/usr/src/linux-headers-3.6.11+/Module.symvers«« gespeichert [450335/450335]

make: Entering directory `/usr/src/linux-headers-3.6.11+'
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf --silentoldconfig Kconfig
#
# configuration written to .config
#
make: Leaving directory `/usr/src/linux-headers-3.6.11+'
make: Entering directory `/usr/src/linux-headers-3.6.11+'
  WRAP    arch/arm/include/generated/asm/auxvec.h
  WRAP    arch/arm/include/generated/asm/bitsperlong.h
  WRAP    arch/arm/include/generated/asm/cputime.h
  WRAP    arch/arm/include/generated/asm/emergency-restart.h
  WRAP    arch/arm/include/generated/asm/errno.h
  WRAP    arch/arm/include/generated/asm/ioctl.h
  WRAP    arch/arm/include/generated/asm/irq_regs.h
  WRAP    arch/arm/include/generated/asm/kdebug.h
  WRAP    arch/arm/include/generated/asm/local.h
  WRAP    arch/arm/include/generated/asm/local64.h
  WRAP    arch/arm/include/generated/asm/percpu.h
  WRAP    arch/arm/include/generated/asm/poll.h
  WRAP    arch/arm/include/generated/asm/resource.h
  WRAP    arch/arm/include/generated/asm/sections.h
  WRAP    arch/arm/include/generated/asm/siginfo.h
  WRAP    arch/arm/include/generated/asm/sizes.h
  CHK     include/linux/version.h
  UPD     include/linux/version.h
  CHK     include/generated/utsrelease.h
  UPD     include/generated/utsrelease.h
  Generating include/generated/mach-types.h
  CC      kernel/bounds.s
  GEN     include/generated/bounds.h
  CC      arch/arm/kernel/asm-offsets.s
  GEN     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
grep: scripts/../arch/x86/syscalls/syscall_32.tbl: Datei oder Verzeichnis nicht gefunden
  HOSTCC  scripts/genksyms/genksyms.o
  HOSTCC  scripts/genksyms/lex.lex.o
  HOSTCC  scripts/genksyms/parse.tab.o
  HOSTLD  scripts/genksyms/genksyms
  CC      scripts/mod/empty.o
  HOSTCC  scripts/mod/mk_elfconfig
  MKELF   scripts/mod/elfconfig.h
  HOSTCC  scripts/mod/file2alias.o
  HOSTCC  scripts/mod/modpost.o
  HOSTCC  scripts/mod/sumversion.o
  HOSTLD  scripts/mod/modpost
  HOSTCC  scripts/kallsyms
  HOSTCC  scripts/pnmtologo
  HOSTCC  scripts/conmakehash
  HOSTCC  scripts/bin2c
make: Leaving directory `/usr/src/linux-headers-3.6.11+'
root@raspberrypi:~#
regards Hans

User avatar
S.Grosjean
Software Development
Software Development
Posts: 302
Joined: Wed 4. Jul 2012, 17:02

Re: PEAK-Linux Driver on Raspberry Pi

Post by S.Grosjean » Mon 2. Sep 2013, 15:04

Hi,

"pcan: disagrees about version of symbol module_layout" tells that there is a problem between the Kernel you're running and the headers you are using to build pcan.

Could you upload the "pcan.ko" please?

Regards,

Stéphane
— Stéphane

Hans.Peter
Posts: 5
Joined: Mon 2. Sep 2013, 13:00

Re: PEAK-Linux Driver on Raspberry Pi

Post by Hans.Peter » Mon 2. Sep 2013, 15:12

Here my pcan.ko
Attachments
pcan.zip
(27.97 KiB) Downloaded 558 times

User avatar
S.Grosjean
Software Development
Software Development
Posts: 302
Joined: Wed 4. Jul 2012, 17:02

Re: PEAK-Linux Driver on Raspberry Pi

Post by S.Grosjean » Mon 2. Sep 2013, 15:56

Hi,

I need now the following 2 files please:

1 - type

$ zcat /proc/config.gz > /tmp/running.config

then upload resulting "/tmp/running.config".

2 - upload "/usr/src/linux-headers-3.6.11+/.config" too

Regards,

Stéphane
— Stéphane

Hans.Peter
Posts: 5
Joined: Mon 2. Sep 2013, 13:00

Re: PEAK-Linux Driver on Raspberry Pi

Post by Hans.Peter » Mon 2. Sep 2013, 16:04

Here the kernel config files
Attachments
config.tar.gz
(38.99 KiB) Downloaded 699 times

User avatar
S.Grosjean
Software Development
Software Development
Posts: 302
Joined: Wed 4. Jul 2012, 17:02

Re: PEAK-Linux Driver on Raspberry Pi

Post by S.Grosjean » Mon 2. Sep 2013, 16:36

Hi,

It looks like you didn't do the "make install" command after you built "pcan.ko".

You may have a look to this post (http://www.peak-system.com/forum/viewto ... t=10#p2015) for a successfull install.

First try to with 7.8 (no malloc_sizes undefined symbol odd warning)

Best regards,

Stéphane
— Stéphane

Hans.Peter
Posts: 5
Joined: Mon 2. Sep 2013, 13:00

Re: PEAK-Linux Driver on Raspberry Pi

Post by Hans.Peter » Mon 2. Sep 2013, 17:04

S.Grosjean wrote: It looks like you didn't do the "make install" command after you built "pcan.ko".
No i don't. But if i execute 'make install' the pcan.ko module will be installed to '/lib/modules/3.6.11/misc/'
As 'uname -r' shows me '3.6.11+' i think '/lib/modules/3.6.11+/misc/' should be correkt. I've created
misc dir manually and copied the module in the directory and still get

Code: Select all

root@raspberrypi:~/peak-linux-driver-7.8/driver# insmod pcan.ko
Error: could not insert module pcan.ko: Invalid module format

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

Re: PEAK-Linux Driver on Raspberry Pi

Post by ckeydel » Tue 3. Sep 2013, 00:00

I solved it for me now by switching from the Rasperry Pi foundation kernel to the one from Raspbian themselves. This has the added bonus of this kernel having socketcan enabled. I strongly believe that the kernel headers mentioned in the instructions don't match anymore with the kernel that is currently included in the Raspberry Pi foundation's latest "Wheezy" image.

I did a lot of things so I don't know if the following is complete, but it should take one pretty far. First, one should install the 'dkms' package, kernel image and headers:

Code: Select all

sudo apt-get install dkms linux-image-3.6-trunk-rpi linux-headers-3.6-trunk-all
This takes a while. Then, add the following lines to /boot/config.txt in order to boot with the new kernel:

Code: Select all

kernel=vmlinuz-3.6-trunk-rpi
initramfs initrd.img-3.6-trunk-rpi followkernel
Then reboot, and rebuild the driver as mentioned in the instructions. Optionally, build it with netdev support.

Post Reply