PCAN-USB: build as netdev for kernel 3.13
-
- Posts: 6
- Joined: Mon 14. Nov 2016, 08:52
PCAN-USB: build as netdev for kernel 3.13
Hello!
I can not build 'netdev' driver for PCAN-USB device.
The build fails because of CAN_CTRLMODE_FD is not defined in Linux/include/uapi/linux/can/netlink.h. Also I found that a lot of other CAN definitions are lacks in this file.
What is the problem? Can it be "patched"?
'chardev' device can be build without any problems. My full Linux version is:
Linux ubuntu 3.13.0-73-generic #116-Ubuntu SMP Fri Dec 4 15:31:30 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
I can not build 'netdev' driver for PCAN-USB device.
The build fails because of CAN_CTRLMODE_FD is not defined in Linux/include/uapi/linux/can/netlink.h. Also I found that a lot of other CAN definitions are lacks in this file.
What is the problem? Can it be "patched"?
'chardev' device can be build without any problems. My full Linux version is:
Linux ubuntu 3.13.0-73-generic #116-Ubuntu SMP Fri Dec 4 15:31:30 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
- S.Grosjean
- Software Development
- Posts: 357
- Joined: Wed 4. Jul 2012, 17:02
Re: PCAN-USB: build as netdev for kernel 3.13
Hi,
3.13 is an "old" version, in which there were no support for CAN-FD...
If you plan to use the socket-can interface, why don't you use the mainline driver instead? The PCAN-USB is fully supported by the Kernel in this version, so you don't need to build nor install the pcan (peak-linux-driver-x.y) driver.
Plug your PCAN-USB, then type:
You should see something like:
Regards,
Stéphane
3.13 is an "old" version, in which there were no support for CAN-FD...
If you plan to use the socket-can interface, why don't you use the mainline driver instead? The PCAN-USB is fully supported by the Kernel in this version, so you don't need to build nor install the pcan (peak-linux-driver-x.y) driver.
Plug your PCAN-USB, then type:
Code: Select all
$ ip -s -d link show type can
Code: Select all
39: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN mode DEFAULT group default qlen 10
link/can promiscuity 0
can state STOPPED restart-ms 0
pcan_usb: tseg1 1..16 tseg2 1..8 sjw 1..4 brp 1..64 brp-inc 1
clock 8000000
re-started bus-errors arbit-lost error-warn error-pass bus-off
0 0 0 0 0 0
RX: bytes packets errors dropped overrun mcast
0 0 0 0 0 0
TX: bytes packets errors dropped carrier collsns
0 0 0 0 0 0
Stéphane
— Stéphane
-
- Posts: 6
- Joined: Mon 14. Nov 2016, 08:52
Re: PCAN-USB: build as netdev for kernel 3.13
Hi, Stephane,
Thank you for your response. I tried your solution, it does not work, sorry:
>ip -s link show type can
Error: either "dev" is duplicate, or "can" is a garbage.
Probably, something more to be done.
Alex
Thank you for your response. I tried your solution, it does not work, sorry:
>ip -s link show type can
Error: either "dev" is duplicate, or "can" is a garbage.
Probably, something more to be done.
Alex
- S.Grosjean
- Software Development
- Posts: 357
- Joined: Wed 4. Jul 2012, 17:02
Re: PCAN-USB: build as netdev for kernel 3.13
Hello,
No, it looks like you're running an old version of "iproute2" package.
So, first, let's retry with:
instead.
Regards,
Stéphane
No, it looks like you're running an old version of "iproute2" package.
So, first, let's retry with:
Code: Select all
$ ifconfig -a
Regards,
Stéphane
— Stéphane
-
- Posts: 6
- Joined: Mon 14. Nov 2016, 08:52
Re: PCAN-USB: build as netdev for kernel 3.13
Hi,
I have checked. No "can" interface in "ifconfig -a" output.
Does it mean, that socket CAN interface is not supported?
Alex.
I have checked. No "can" interface in "ifconfig -a" output.
Does it mean, that socket CAN interface is not supported?
Alex.
- S.Grosjean
- Software Development
- Posts: 357
- Joined: Wed 4. Jul 2012, 17:02
Re: PCAN-USB: build as netdev for kernel 3.13
Hi,
Hem, strange. let's start from scratch with trying to load the module by hand:
If nothing (no error) displayed, do (be sure that the PCAN-USB is connected to the USB socket!):
Regards,
Stéphane
Hem, strange. let's start from scratch with trying to load the module by hand:
Code: Select all
$ sudo modprobe peak_usb
Code: Select all
$ dmesg | grep peak_usb
Stéphane
— Stéphane
-
- Posts: 6
- Joined: Mon 14. Nov 2016, 08:52
Re: PCAN-USB: build as netdev for kernel 3.13
Hi,
Thank you, Stephane! Now I see 'can0' netdev interface.
I still have an errors ("RTNETLINK answers: Invalid argument") but suppose, its an application problem.
Thank you a lot.
Alex
Thank you, Stephane! Now I see 'can0' netdev interface.
I still have an errors ("RTNETLINK answers: Invalid argument") but suppose, its an application problem.
Thank you a lot.
Alex
-
- Posts: 6
- Joined: Mon 14. Nov 2016, 08:52
Re: PCAN-USB: build as netdev for kernel 3.13
Hi, Stephane
Sorry for troubling you again.
Now I see can0 interface at 'ifconfig -a' output:
So it exist now.
I also checked 'ip -details -statistics link show can0' output:
As I understood, can0 interface is still unconfigured, so programs cant use it. What shall I do to make it active?
Best Regards
Alex
Sorry for troubling you again.
Now I see can0 interface at 'ifconfig -a' output:
Code: Select all
can0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
NOARP MTU:16 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:10
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
I also checked 'ip -details -statistics link show can0' output:
Code: Select all
3: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN mode DEFAULT group default qlen 10
link/can promiscuity 0
can state STOPPED restart-ms 0
bitrate 0 sample-point 0.000
tq 0 prop-seg 0 phase-seg1 0 phase-seg2 0 sjw 0
pcan_usb: tseg1 1..16 tseg2 1..8 sjw 1..4 brp 1..64 brp-inc 1
clock 8000000
re-started bus-errors arbit-lost error-warn error-pass bus-off
0 0 0 0 0 0
RX: bytes packets errors dropped overrun mcast
0 0 0 0 0 0
TX: bytes packets errors dropped carrier collsns
0 0 0 0 0 0
Best Regards
Alex
Last edited by M.Gerber on Wed 16. Nov 2016, 10:02, edited 1 time in total.
Reason: Inserted [code] tags for better readability.
Reason: Inserted [code] tags for better readability.
Re: PCAN-USB: build as netdev for kernel 3.13
Hi,
now you have to configure the device with "ip link set", see SocketCAN documentation:
https://www.kernel.org/doc/Documentatio ... ng/can.txt
or see info in our Linux driver manual on page 33.
regards
Michael
now you have to configure the device with "ip link set", see SocketCAN documentation:
https://www.kernel.org/doc/Documentatio ... ng/can.txt
or see info in our Linux driver manual on page 33.
regards
Michael
-
- Posts: 6
- Joined: Mon 14. Nov 2016, 08:52
Re: PCAN-USB: build as netdev for kernel 3.13
Michael, Thank you a lot!
Alex
Alex