linux driver

CAN FD and LIN Interface for High-Speed USB 2.0
Post Reply
vadbut
Posts: 7
Joined: Thu 23. Feb 2017, 03:07

linux driver

Post by vadbut » Thu 23. Feb 2017, 03:15

Hi,

Can you please clarify the following:
1) I can't wrap my head around ndev vs chardev. What is the difference? If I want to write an application, then I need to use ndev?
2) The driver seems to be not working in my case. I use Ubuntu 14.04
>> sudo modprobe pcan
modprobe: FATAL: Module pcan not found.

also:
>> cat /proc/pcan
cat: /proc/pcan: No such file or directory

but the following shows the unit was detected:
cat /var/log/dmesg | grep -e can
[ 0.000000] Scanning 1 areas for low memory corruption
[ 0.561444] Scanning for low memory corruption every 60 seconds
[ 0.608984] rtc_cmos 00:02: RTC can wake from S4
[ 2.324526] peak_usb 1-1:1.0 can0: attached to PCAN-USB Pro FD channel 0 (device 4294967295)
[ 2.325153] peak_usb 1-1:1.0 can1: attached to PCAN-USB Pro FD channel 1 (device 4294967295)

Cheers

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

Re: linux driver

Post by M.Maidhof » Thu 23. Feb 2017, 11:27

Hi,

please have a look in our peak-linux-driver manual, there we will show the different possibilities of the chardev and netdev driver.

http://www.peak-system.com/fileadmin/me ... an_eng.pdf

When you like to work with the Netdev driver, there is no need to install our peak-linux-driver. Your used kernel version already has a Netdev driver available. See can0, can1 in dmesg.

To learn how to configure the Netdev devices to your needs, please have a look at the SocketCAN/Netdev manual on the following website:

https://www.kernel.org/doc/Documentatio ... ng/can.txt

regards

Michael

vadbut
Posts: 7
Joined: Thu 23. Feb 2017, 03:07

Re: linux driver

Post by vadbut » Thu 23. Feb 2017, 16:45

Michael, thanks for the reply - it was useful

With respect to netdev vs chardev: my question was more on what do you recommend? Which one is faster and more reliable? I'm developing a can<-->ethernet gateway which I need to be running reliably at least at 100Hz with minimum delays.

Cheers

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

Re: linux driver

Post by M.Maidhof » Thu 23. Feb 2017, 17:30

Hi,

well, there are not really big differences. IMHO the best solution will be to use the kernel SocketCAN driver. Then you don´t have to install an additional driver on your system with each kernel change.

best regards

Michael

vadbut
Posts: 7
Joined: Thu 23. Feb 2017, 03:07

Re: linux driver

Post by vadbut » Thu 23. Feb 2017, 18:13

Can you please direct me to simple examples on c++ for linux?
PCan seems to work ok using cansend and candump terminal commands, but the provided app examples in the "test" folder (that comes with the driver) don't seem to work. The error I get is due to the absence of pcan devices in /dev. Is it because I use the kernel driver?

vadbut
Posts: 7
Joined: Thu 23. Feb 2017, 03:07

Re: linux driver

Post by vadbut » Sun 26. Feb 2017, 06:42

As I mentioned in another thread - my UEFI Secure Boot was enabled which was blocking modprobe. Now pcan appears in the devices and I'm able to execute the examples.

Thanks

Post Reply