Issue with Linux driver for PCAN-USB X6 version 8.3

This forum covers PCAN-Linux and Linux development issues concerning our products
Post Reply
vineeth
Posts: 2
Joined: Thu 19. Jan 2017, 19:48

Issue with Linux driver for PCAN-USB X6 version 8.3

Post by vineeth » Fri 20. Jan 2017, 15:47

Hello ,

I have been trying to install Linux driver for PCAN-USB X6 on a UBUNTU 14.4 machine. I am using peak-linux-driver-8.3
As I understand that this is the version which supports PCAN-USB X6. I built the chardev variant of the driver and the device gets recognized in the system and I see the 6 channels as expected.

But I would like to use the SocketCAN interface and hence tried the following .

1. built the driver using " make –C driver NET=NETDEV_SUPPORT". This does compile the kernel module but the /lib folder is not compiled. This causes the "make install" to fail as some libs are missing. I built the libs from lib folder
and then installed the driver. But the following error pops up when the PCAN-USB X6 box is connected to the system

[18990.985358] usb 1-2: new full-speed USB device number 11 using ohci-pci
[18991.447127] usb 1-2: New USB device found, idVendor=0c72, idProduct=0014
[18991.447131] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[18991.447133] usb 1-2: Product: PCAN-USB X6
[18991.447134] usb 1-2: Manufacturer: PEAK-System Technik GmbH
[18991.486372] pcan: unable to find same usb if
[18991.486389] pcan: device_init() failure err -12
[18991.486396] pcan: probe of 1-2:1.0 failed with error -12

So my question is , does this driver support PCAN-USB X6 in NETDEV mode? IF yes , could you please guide me through the process.

2. I understand that for NETDEV support for PCAN-USB adaptors there is support in the mainline Linux kernel and there is no need for me to install this driver. In my PC the required modules need to be built and inserted

$cat /boot/config-4.2.0-27-generic | grep CAN

CONFIG_CAN=m
CONFIG_CAN_RAW=m
CONFIG_CAN_PEAK_USB=m

If I build and insert the above mentioned modules will PCAN-USB X6 be detected as a net device ? Could you please guide me through this ?


Thanks in Advance
Vineeth

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

Re: Issue with Linux driver for PCAN-USB X6 version 8.3

Post by S.Grosjean » Mon 23. Jan 2017, 11:58

Hello,

1/ That's true: when building the driver in "netdev" mode, the lib (as well as the test programs) are useless, so "make install" will fail to install them. The lib is an API that encapsulates the "chardev" interface (open, read, write, ioctl, close) calls. It is obviously useless when building the driver in "netdev" mode. Building and installing a "netdev" driver needs should be done from the "driver" sub-directory. To avoid any "error" during such installation, do a first "normal" (chardev) install, then go into the driver dir, rebuild it and make install it only.

2/ The given message is an error message. Do you have such a message when loading the chardev driver, please?

3/ The PCAN-USB X6 will be natively supported by the next distribution of Linux based system that includes Kernel 4.10.

Regards,

Stéphane
— Stéphane

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

Re: Issue with Linux driver for PCAN-USB X6 version 8.3

Post by S.Grosjean » Mon 23. Jan 2017, 15:19

Hello again,

As you want to run above the socket-can interface, please find attached a tarball which contains an out-of-tree version of the (future) mainline driver "peak_usb", which supports the PCAN-USB X6 as 6x can network interfaces.

To build this driver:

Code: Select all

$ tar -xzf peak_usb-2.3.0.tar.gz
$ cd peak_usb-2.3.0
$ make
This should normally create a new "peak_usb.ko" in the current directory. To run it:

1 - be sure to remove the current "peak_usb" module (if any)

Code: Select all

$ sudo rmmod peak_usb
2 - be sure to load the can-dev module (if it wasn't before)

Code: Select all

$ sudo modprobe can-dev
3 - Finally load this driver:

Code: Select all

$ sudo insmod peak_usb.ko
You should normally see the 6x can interfces with:

Code: Select all

$ ls /sys/class/net/
can0  can1  can2  can3  can4  can5
Of course, you HAVE TO remove the "pcan" driver module too...

Don't hesitate to give us any feedback; building this driver might generate errors with your Kernel...

Regards,

Stéphane
Attachments
peak_usb-2.3.0.tar.gz
Out-of-tree peak_usb driver handling PCAN-USB X6
(33.44 KiB) Downloaded 588 times
— Stéphane

vineeth
Posts: 2
Joined: Thu 19. Jan 2017, 19:48

Re: Issue with Linux driver for PCAN-USB X6 version 8.3

Post by vineeth » Mon 23. Jan 2017, 16:28

Hello Stéphane,

I will let you know after I try it out. Thanks a lot.

Regards
Vineeth

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

Re: Issue with Linux driver for PCAN-USB X6 version 8.3

Post by S.Grosjean » Tue 24. Jan 2017, 16:32

Hello,

We have modified pcan v8.3 in order to handle how ohci enumerates the USB devices. Could you please send us an e-mail to linux@peak-system.com (subject, say "OHCI vs. pcan 8.3 beta") so that we will be able t send you back a beta version of pcan.

Thanks for helping in improving pcan!

Regards,

Stéphane
— Stéphane

Post Reply