PCAN Linux driver fails while time synchronization

This forum covers PCAN-Linux and Linux development issues concerning our products
Post Reply
Magnus.Zaza
Posts: 2
Joined: Mon 2. May 2022, 11:15

PCAN Linux driver fails while time synchronization

Post by Magnus.Zaza » Thu 5. Sep 2024, 17:45

We are using CAN Driver and Library API for Linux. The pcifd hardware is connected to a raspberry pi device that does not have a real time clock. This is the output of

Code: Select all

cat /proc/pcan

Code: Select all

*------------- PEAK-System CAN interfaces (www.peak-system.com) -------------
*------------- Release_20230330_n (8.16.0) Feb 12 2024 14:05:32 --------------
*------------------------- [mod] [pci] [pec] [usb] --------------------------
*--------------------- 4 interfaces @ major 237 found -----------------------
*n -type- -ndev- --base-- irq --btr- --read-- --write- --irqs-- -errors- status
 0  pcifd   -NA-  88a1000 030 0x001c 001a463d 0005bf47 0009bf80 00000000 0x0000
 1  pcifd   -NA-  88a2000 030 0x011c 00036b2d 0000543b 0001c9c9 00000000 0x0000
 2  pcifd   -NA-  88a3000 030 0x001c 000bb03f 0014a610 00054876 00000000 0x0000
 3  pcifd   -NA-  88a4000 030 0x001c 0043ebec 00000000 000cf087 00000000 0x0000
We are facing an issue on boot-up where we can see the following message in the journalctl:

Code: Select all

Sep 05 13:42:09 mydev systemd-timesyncd[438]: Contacted time server.
Sep 05 13:42:10 mydev systemd-journald[273]: Time jumped backwards, rotating.
Sep 05 13:42:10 mydev kernel: pcan: PCAN-M.2 CAN4: abnormal sync times: tv=1725536529.929459 < tv=1725536587.924408 dts_us=4511 tv_off=0
Sep 05 13:42:10 mydev kernel: pcan: PCAN-M.2 CAN1: abnormal sync times: tv=1725536529.929551 < tv=1725536587.925511 dts_us=3508 tv_off=0
Sep 05 13:42:10 mydev kernel: pcan: PCAN-M.2 CAN4: abnormal sync times: tv=1725536529.930559 < tv=1725536587.924408 dts_us=5613 tv_off=0
We think that this issue happens while time is synchronizing. However while time synchronizing is happening we miss the communication on CANBUS.

Can we turn off pcan time sync service?

Is there a way to avoid this situation in the pcan driver?

We are looking forward to hear from you.

Best Regards,
Magnus

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

Re: PCAN Linux driver fails while time synchronization

Post by M.Heidemann » Fri 6. Sep 2024, 08:33

Hello,


First off: I'll move this topic, there is a Linux Sub-Forum.

Secondly:

Our driver will use the system-time for timestamps, there is no clock on the device.

You have different option how to handle time, see page 12 of the docs:

https://www.peak-system.com/fileadmin/m ... an_eng.pdf

Try running using monotonic time, see if that helps.

BR

Marvin
---
Marvin Heidemann
PEAK-Support Team

Post Reply