Page 1 of 2
Error testing CAN FD frames PEAK CAN USB X6 Device
Posted: Tue 20. Jun 2017, 12:21
by jibinkurian1246
I am facing problem with testing "PCAN-USB X6 device" for CAN FD Frames(Send/Receive)
I am trying to Send(can0) and Receive(can1) CAN FD frames through PCAN-USB X6 interfaces using socketCAN and can-utils.
I ahave error with receiving CAN FD frames at receiving interface(can1). Below are the steps I followed to enable CAN FD:
1. sudo ip link set can0 type can bitrate 125000
sudo ip link set can1 type can bitrate 125000
2. sudo ip link set can0 mtu 72
sudo ip link set can1 mtu 72
3. sudo ifconfig can0 up
sudo ifconfig can1 up
After the 3rd step green LED's start blinking for can0 and can1 interfaces normally.
For the standard CAN frame Send/Receive works fine as below:

- standard_can_1.png (8.49 KiB) Viewed 20178 times

- standard_can_2.png (10.02 KiB) Viewed 20178 times
But for the CAN FD frame which is send at can0 is not getting received in the can1 interface and the LED's start blinking Red indicating an error as shown below:

- can_fd_1.png (11.21 KiB) Viewed 20178 times

- can_fd_2.png (10.04 KiB) Viewed 20178 times
Same error occurs with Red LEDs blinking when I try to listen to specific interface using "candump can1" command instead.

- test1.png (11.2 KiB) Viewed 20178 times

- test2.png (6.87 KiB) Viewed 20178 times
Could you please help me to fix the error ? Do we need to set a different bit rate for CAN FD ?
any relevant information/suggestions/solution is highly appreciated.
Regards,
Jibin
Regards,
Jibin Kurian
Re: Error testing CAN FD frames PEAK CAN USB X6 Device
Posted: Wed 21. Jun 2017, 14:16
by S.Grosjean
Hello,
In order to setup CAN FD, you should first setup the interface with "fd on":
Code: Select all
$ ip link set canx up type can bitrate ... dbitrate ... fd on
Setting the "mtu" size is no more needed since implicit with "fd on".
Regards,
Stéphane
Re: Error testing CAN FD frames PEAK CAN USB X6 Device
Posted: Fri 23. Jun 2017, 10:57
by jibinkurian1246
Hi Stéphane,
I am getting the error " Can: Unknown option dbitrate" while executing the command. How do I fix it ?
My iproute2 version is " ip utility, iproute2-ss131122"

- sc.png (63.58 KiB) Viewed 20140 times
Re: Error testing CAN FD frames PEAK CAN USB X6 Device
Posted: Mon 26. Jun 2017, 12:08
by S.Grosjean
Hi,
It looks like your iproute2 is too old to handle CAN FD.
Code: Select all
$ ip -V
ip utility, iproute2-ss151103
$ ip link help can
Usage: ip link set DEVICE type can
[ bitrate BITRATE [ sample-point SAMPLE-POINT] ] |
[ tq TQ prop-seg PROP_SEG phase-seg1 PHASE-SEG1
phase-seg2 PHASE-SEG2 [ sjw SJW ] ]
[ dbitrate BITRATE [ dsample-point SAMPLE-POINT] ] |
[ dtq TQ dprop-seg PROP_SEG dphase-seg1 PHASE-SEG1
dphase-seg2 PHASE-SEG2 [ dsjw SJW ] ]
[ loopback { on | off } ]
[ listen-only { on | off } ]
[ triple-sampling { on | off } ]
[ one-shot { on | off } ]
[ berr-reporting { on | off } ]
[ fd { on | off } ]
[ fd-non-iso { on | off } ]
[ presume-ack { on | off } ]
[ restart-ms TIME-MS ]
[ restart ]
Where: BITRATE := { 1..1000000 }
SAMPLE-POINT := { 0.000..0.999 }
TQ := { NUMBER }
PROP-SEG := { 1..8 }
PHASE-SEG1 := { 1..8 }
PHASE-SEG2 := { 1..8 }
SJW := { 1..4 }
RESTART-MS := { 0 | NUMBER }
Please try to upgrade your local version:
Code: Select all
$ sudo apt-get --only-upgrade install iproute2
You can also choose the version you want, by downloading and building the source package by yourself, from
https://www.kernel.org/pub/linux/utils/net/iproute2/
Regards,
Stéphane
Re: Error testing CAN FD frames PEAK CAN USB X6 Device
Posted: Mon 3. Jul 2017, 17:23
by jibinkurian1246
Hi,
I have upgraded iproute2 to latest version and tried to test CAN FD interface using can-utils but getting the same error result as before with Red Led's blinking . I am Not been able to receive the CAN FD Message at the receiving interface ( can1).
I have enabled CAN FD using the following command:
sudo ip link set can0 up type can bitrate 125000 dbitrate 800000 fd on
sudo ip link set can1 up type can bitrate 125000 dbitrate 800000 fd on
And Tested by sending CAN FD message on can0 interface and receiving on can1 interface connected via physical can bus. following are the screen shots.

- test.png (88.86 KiB) Viewed 20068 times

- test1.png (16.35 KiB) Viewed 20068 times

- test2.png (12.22 KiB) Viewed 20068 times
How can I test the CAN FD enabled interfaces properly ?
Re: Error testing CAN FD frames PEAK CAN USB X6 Device
Posted: Tue 4. Jul 2017, 11:06
by S.Grosjean
Hi,
Do you run a Virtual Machine?
Please type:
What kind of driver are you using please? The linux-can (mainline) peak_usb driver or the pcan driver, downloaded from your website?
If pcan is the driver, please type:
If peak_usb is the driver, please type:
Regards,
Stéphane
Re: Error testing CAN FD frames PEAK CAN USB X6 Device
Posted: Tue 4. Jul 2017, 11:21
by jibinkurian1246
Hi StePhane,
I am Not using a Virtual machine as you can see below:

- test10.png (40.65 KiB) Viewed 20053 times
I am using pcan driver and the commands result in the folowing :

- test11.png (49.99 KiB) Viewed 20053 times

- test12.png (7.54 KiB) Viewed 20053 times
Just to remind you that I am using PCAN-USB X6 Device for testing CAN FD communication using Can-utils package
Regards,
Jibin
Re: Error testing CAN FD frames PEAK CAN USB X6 Device
Posted: Tue 4. Jul 2017, 11:54
by S.Grosjean
Hi,
Could you please download then install the last version of the pcan driver from:
http://www.peak-system.com/fileadmin/me ... 4.0.tar.gz
Regards,
Stéphane
Re: Error testing CAN FD frames PEAK CAN USB X6 Device
Posted: Tue 4. Jul 2017, 14:32
by jibinkurian1246
Hi StePhane,
I have installed the latest pcan driver as shown below:

- test1.png (47.99 KiB) Viewed 20044 times
unfortunately I face the same problem. I am able to test normal CAN frame using can-utils but with CAN FD frame error in transmission ocuurs with Red led Blinking.
Regards,
Jibin
Re: Error testing CAN FD frames PEAK CAN USB X6 Device
Posted: Tue 4. Jul 2017, 15:03
by S.Grosjean
Hi,
There is something wrong somewhere... Could you please do:
and
and
immediately after you have sent the CAN-FD frame (leading to blinked red led)?
Thanks to send us the output.
Stéphane