Page 2 of 16

Re: PEAK-Linux Driver on Raspberry Pi

Posted: Thu 13. Dec 2012, 10:37
by nagilode
Thanks that was the relevant hint. What I did to get it working was:


1. Extract the kernel config

Code: Select all

cd <kerneldir>
zcat /proc/config.gz > .config
2. Completely compile kernel (Takes a while if really on raspberry)

Code: Select all

make
3. Compile peak driver version 7.7

Code: Select all

cd <pcandir>
make KERNEL_LOCATION=<kerneldir> PCI=NO_PCI_SUPPORT
4. Load module

Code: Select all

insmod ./driver/pcan.ko
5. Check it

Code: Select all

lsmod 
>Module Size Used by
>pcan 55776 0

Code: Select all

dmesg  | tail
>[522289.664950] pcan: Release_20120726_n (le)
>[522289.664980] pcan: driver config [mod] [isa] [dng] [usb] [net]
>[522289.667153] usbcore: registered new interface driver pcan
>[522289.667220] pcan: major 251.


Thanks a lot for the help. I'll report further if the dongle has arrived.

Re: PEAK-Linux Driver on Raspberry Pi

Posted: Thu 13. Dec 2012, 10:54
by M.Maidhof
Hi,

thanks for the info. Yes, please report about your experience with your Raspberry PI board and PCAN-USB. This will also be helpfull for other users of that hardware.

BTW: you compiled our driver for Netdev, so you can´t use the chardev tools like cat /dev/pcanXX or receivetest than. Maybe you should use the chardev interface as a first test, so simply compile the driver with the NET=NO option and load it again.

best regards

Michael

Re: PEAK-Linux Driver on Raspberry Pi

Posted: Wed 3. Apr 2013, 19:16
by M.Maidhof
Hi,

here you will find a step by step instruction on how to install our linux driver on a Raspberry PI with the latest raspbian wheezy with kernel 3.6.11+:

check your kernel version:

mm@raspberrypi ~ $ uname -r
3.6.11+

get the linux headers for 3.6.11+ from here:
wget http://www.niksula.hut.fi/~mhiienka/Rpi ... _armhf.deb

install the headers:
sudo dpkg -i linux-headers-3.6.11+_3.6.11+-2_armhf.deb

get the latest peak-linux driver 7.8 from here:
wget http://www.peak-system.com/fileadmin/me ... 7.8.tar.gz

unpack it:
tar -xzf peak-linux-driver-7.8.tar.gz

build the driver:
cd peak-linux-driver-7.8/
make clean
make NET=NO PCI=NO PAR=NO ISA=NO PCC=NO DNG=NO
sudo make install
cd driver
sudo insmod pcan.ko

check that the driver is loaded:

mm@raspberrypi ~/peak-linux-driver-7.8/driver $ cat /proc/pcan
*------------- PEAK-System CAN interfaces (http://www.peak-system.com) -------------
*------------- Release_20130131_n (7.8.0) Apr 1 2013 10:58:08 --------------
*------------------------------- [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

with cat /dev/pcan32 you will receive data (500k)
with echo "m s 0x11 2 0x22 0x33"> /dev/pcan32 you can transmit data with your Raspberry PI.

regards

Michael

Re: PEAK-Linux Driver on Raspberry Pi

Posted: Wed 19. Jun 2013, 19:51
by raspiBoard
Hello,

I'm using a peak-usb can device on a raspberry pi with the last kernel version (3.6.11). I've followed your step by step tutorial and works like a charm. Now, I'm trying to use NETDEV driver utility.

I compiled the driver using those lines

make NET=NETDEV_SUPPORT PCI=NO PAR=NO ISA=NO PCC=NO DNG=NO
sudo make install
cd driver
sudo insmod pcan.ko

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-, so I assume that the driver is not loaded correctly.

The chardev driver works OK but i can't get netdev driver working.

Do you know if netdev driver should work on a raspberry pi? Or maybe I'm doing something wrong?

Thank you in advance,

Regards,
Toni

Re: PEAK-Linux Driver on Raspberry Pi

Posted: Thu 20. Jun 2013, 09:32
by M.Maidhof
Hi,

the SocketCAN option is not enabled in the the kernel config of the Raspberry PI, so you have to call make menuconfig and enable the SocketCAN option, recompile the kernel and load it again. Then you should be able to use the NetDev Interface with your Raspberry Pi and the PCAN-USB.

You will find all needed information on how to recompile the kernel for the Raspberry Pi on the web, please note that the kernel compilation on the Pi will take some hours.

regards

Michael

Re: PEAK-Linux Driver on Raspberry Pi

Posted: Tue 25. Jun 2013, 13:41
by emilio.munoz
Dear Sir,

Recently we have adquired a raspberrypi device as well as a PCAN-USB and I am trying to install the drivers. Since I don't know much about Raspbian or even any Linux related stuff is a getting a bit hard to install the drivers.

I followed the instructions that you wrote and everything went fine until I got to write the following ones:

make NET=NO PCI=NO PAR=NO ISA=NO PCC=NO DNG=NO
sudo make install

where some errors appeared and I could not do anything else.

PLease, could you tell me what I should do in order to be able to install the drivers?

Thanks for your help and I do apologize any inconvenience.

Re: PEAK-Linux Driver on Raspberry Pi

Posted: Tue 25. Jun 2013, 14:06
by M.Maidhof
Hi,

please send us details about the error messages

best regards

Michael

BTW: without any knowledge of Linux, it will be a hard way for you to work with the Raspberry PI and our drivers...

Re: PEAK-Linux Driver on Raspberry Pi

Posted: Tue 25. Jun 2013, 14:30
by mohamed mahmoud
Hello,

I followed the step by step instructions to build the driver. pcan.ko is generated but when i tried:

insmod pcan.ko

it says:

Error: could not insert module pcan.ko: Invalid module format

given that the kernel version is 3.6.11+ and i downloaded the same packages in the step by step instructions.

Please, could you help me solve this problem?

Thanks,

Re: PEAK-Linux Driver on Raspberry Pi

Posted: Tue 25. Jun 2013, 14:46
by M.Maidhof
please send the output of uname -r

Michael

Re: PEAK-Linux Driver on Raspberry Pi

Posted: Tue 25. Jun 2013, 15:04
by mohamed mahmoud
Hello,

the output of uname -r is :

3.6.11+

Thanks,