Error testing CAN FD frames PEAK CAN USB X6 Device

6-Channel CAN FD Interface for High-Speed USB 2.0
jibinkurian1246
Posts: 7
Joined: Tue 20. Jun 2017, 12:01

Error testing CAN FD frames PEAK CAN USB X6 Device

Post by jibinkurian1246 » Tue 20. Jun 2017, 12:21

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
standard_can_1.png (8.49 KiB) Viewed 4596 times
standard_can_2.png
standard_can_2.png (10.02 KiB) Viewed 4596 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
can_fd_1.png (11.21 KiB) Viewed 4596 times
can_fd_2.png
can_fd_2.png (10.04 KiB) Viewed 4596 times
Same error occurs with Red LEDs blinking when I try to listen to specific interface using "candump can1" command instead.
test1.png
test1.png (11.2 KiB) Viewed 4596 times
test2.png
test2.png (6.87 KiB) Viewed 4596 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

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

Re: Error testing CAN FD frames PEAK CAN USB X6 Device

Post by S.Grosjean » Wed 21. Jun 2017, 14:16

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
— Stéphane

jibinkurian1246
Posts: 7
Joined: Tue 20. Jun 2017, 12:01

Re: Error testing CAN FD frames PEAK CAN USB X6 Device

Post by jibinkurian1246 » Fri 23. Jun 2017, 10:57

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
sc.png (63.58 KiB) Viewed 4558 times

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

Re: Error testing CAN FD frames PEAK CAN USB X6 Device

Post by S.Grosjean » Mon 26. Jun 2017, 12:08

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
— Stéphane

jibinkurian1246
Posts: 7
Joined: Tue 20. Jun 2017, 12:01

Re: Error testing CAN FD frames PEAK CAN USB X6 Device

Post by jibinkurian1246 » Mon 3. Jul 2017, 17:23

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
test.png (88.86 KiB) Viewed 4486 times
test1.png
test1.png (16.36 KiB) Viewed 4486 times
test2.png
test2.png (12.22 KiB) Viewed 4486 times
How can I test the CAN FD enabled interfaces properly ?

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

Re: Error testing CAN FD frames PEAK CAN USB X6 Device

Post by S.Grosjean » Tue 4. Jul 2017, 11:06

Hi,

Do you run a Virtual Machine?

Please type:

Code: Select all

$ uname -a
$ lsusb -d 0c72:
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:

Code: Select all

$ cat /proc/pcan
If peak_usb is the driver, please type:

Code: Select all

$ dmesg | grep peak_usb
Regards,

Stéphane
— Stéphane

jibinkurian1246
Posts: 7
Joined: Tue 20. Jun 2017, 12:01

Re: Error testing CAN FD frames PEAK CAN USB X6 Device

Post by jibinkurian1246 » Tue 4. Jul 2017, 11:21

Hi StePhane,

I am Not using a Virtual machine as you can see below:
test10.png
test10.png (40.65 KiB) Viewed 4471 times
I am using pcan driver and the commands result in the folowing :
test11.png
test11.png (49.99 KiB) Viewed 4471 times
test12.png
test12.png (7.54 KiB) Viewed 4471 times
Just to remind you that I am using PCAN-USB X6 Device for testing CAN FD communication using Can-utils package

Regards,
Jibin

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

Re: Error testing CAN FD frames PEAK CAN USB X6 Device

Post by S.Grosjean » Tue 4. Jul 2017, 11:54

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
— Stéphane

jibinkurian1246
Posts: 7
Joined: Tue 20. Jun 2017, 12:01

Re: Error testing CAN FD frames PEAK CAN USB X6 Device

Post by jibinkurian1246 » Tue 4. Jul 2017, 14:32

Hi StePhane,

I have installed the latest pcan driver as shown below:

test1.png
test1.png (47.99 KiB) Viewed 4462 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

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

Re: Error testing CAN FD frames PEAK CAN USB X6 Device

Post by S.Grosjean » Tue 4. Jul 2017, 15:03

Hi,

There is something wrong somewhere... Could you please do:

Code: Select all

$ lspcan -T -t -i
and

Code: Select all

$ lspcan -T -t -s
and

Code: Select all

$ dmesg | grep pcan
immediately after you have sent the CAN-FD frame (leading to blinked red led)?

Thanks to send us the output.

Stéphane
— Stéphane

Post Reply