PCAN-USD FD on Rasberry Pi (SOCKET CAN)

This forum covers PCAN-Linux and Linux development issues concerning our products
Locked
cmartin64x
Posts: 2
Joined: Fri 19. Apr 2024, 17:23

PCAN-USD FD on Rasberry Pi (SOCKET CAN)

Post by cmartin64x » Fri 19. Apr 2024, 17:34

Hi,

I tried the PCAN-USB FD with Windows software. I get great results when I grab the CAN FD messages.

I then tried the SOCKET CAN approach on the Rasberry Pi and logged the captured data using candump can0 command.

CAN FD messages 'seems' to be coming in, but when I try to analyse each CAN FD message Id's, they seem OFF.

This is the information I get from the device from the Rasberry Pi:

Code: Select all

pi@raspberrypi:~ $ sudo dmesg | grep peak
[   11.489868] peak_usb 1-1.2:1.0: PEAK-System PCAN-USB FD v6 fw v3.4.3 (1 channels)
[   11.498530] peak_usb 1-1.2:1.0 can0: attached to PCAN-USB FD channel 0 (device 4294967295)
[   11.498809] usbcore: registered new interface driver peak_usb
My setting to get the SOCKET CAN to capture data is the following:

# we need to get CAN setup
sudo ip link set can0 up type can bitrate 500000 dbitrate 2000000 fd on
sudo ifconfig can0 txqueuelen 65536

These are the same settings used when running the Windows app to capture data.

I get a large number of 205 CAN ID - which I don't see in the Windows version:

Code: Select all

(1713378957.367098) can0 205##50000000000000000000041FF030300FF0000000000000C5B0000000000000000
(1713378957.387038) can0 205##50000000000000000000041FF030300FF0000000000000D460000000000000000
(1713378957.407097) can0 205##50000000000000000000041FF030300FF0000000000000E610000000000000000
(1713378957.427102) can0 205##50000000000000000000041FF030300FF0000000000000F7C0000000000000000
(1713378957.446859) can0 205##50000000000000000000041FF030300FF00000000000000C70000000000000000
(1713378957.457159) can0 42C##50000000000000000000000000000000000000000000000F20000000000000000
(1713378957.467097) can0 205##50000000000000000000041FF030300FF00000000000001DA0000000000000000
(1713378957.487060) can0 205##50000000000000000000041FF030300FF00000000000002FD0000000000000000
While in the Windows capture, I get few like so:

Code: Select all

(008791.986000) can0 112##32800100000000000000000000000000000800080708000479000000000000000
(008792.597000) can0 103##32000000000000000000000202000000000000000000000360000000000000000
(008793.059000) can0 202##32000000200000000000000000000000000000000000000259000000000000000
(008793.515000) can0 263##32D8C0000000000000000000B0C10F0000000000000000025C000000000000000
(008793.973000) can0 483##32000000000000000000000000000000080000000000000AE2000000000000000
(008794.430000) can0 65A##32000000000000000000000200000000000000000000000A3A000000000000000
(008795.396000) can0 7A2##32000000000000000000003A2006413830D80000000000CD86000000000000000
(008796.785000) can0 207##3200000000000000000000A000000000000000000000000A53000000000000000
(008797.394000) can0 106##6400000000000000000000000000000440E7003E80007004000000000000000000000007DD00000000000000000000000000000000000004D60000000000000000
(009219.064272) can0 113##32000000000000000000000000000000000000800003FF074F000000000000000
(009219.065272) can0 113##32000000000000000000000000000000000001800003FF074F000000000000000
(009219.066272) can0 201##320000000000004420000000000000000000000000000002A5000000000000000
(009219.067272) can0 201##320000000000008872400000000000000000000000000002A5000000000000000

Something is OFF ... Any tips as to what I am missing
Rasberry Pi 4B with December 2023 release OS

cmartin64x
Posts: 2
Joined: Fri 19. Apr 2024, 17:23

Re: PCAN-USD FD on Rasberry Pi (SOCKET CAN)

Post by cmartin64x » Fri 19. Apr 2024, 20:22

I made the followind change:

from this line:

Code: Select all

sudo ip link set can0 up type can bitrate 500000 dbitrate 2000000  fd on
to this line:

Code: Select all

sudo ip link set can0 up type can bitrate 500000 sample-point 0.750 dbitrate 2000000 dsample-point 0.800 fd on
This resolved my problem

M.Heidemann
Sales & Support
Sales & Support
Posts: 862
Joined: Fri 20. Sep 2019, 13:31

Re: PCAN-USD FD on Rasberry Pi (SOCKET CAN)

Post by M.Heidemann » Mon 22. Apr 2024, 09:03

Hello,

When working with CAN-FD you'll need to be precisce with your bit-timings,
otherwise you'll run into issues.

Thank you for letting us know that a more specific timing-setup resolved your issue!

Best Regards

Marvin

-Closed-
---
Marvin Heidemann
PEAK-Support Team

Locked