Errors when using PCI drivers

CAN-Interface for PCI Express Mini
Post Reply
cronix
Posts: 4
Joined: Tue 20. May 2025, 16:25

Errors when using PCI drivers

Post by cronix » Wed 21. May 2025, 15:35

Hello,

we are having issues using the IPEH-003049 PCI Express Mini and its drivers on Ubuntu 20.04.
Our CAN bus consists of seven nodes where the last two are terminated.
While using PEAK USB everything works perfectly. All counters displayed by the command:

Code: Select all

ip -d -s -s link show can0
stay at zero.

When we unplug the USB and plug in the PCI we note the following differences:
The above command steadily increases the arbit-lost counter. Though we are guessing this is normal, this number does not increase when using USB.
Much bigger problem is that error-warn and error-pass increase, which sometimes also triggers the bus-off. Though it is hard to say what raises the number of errors, one thing we noticed that triggers them for sure is when we turn off and on the controller of our vehicle. This restarts three CAN nodes, but none of these are terminated. This does not ALWAYS produce an error-pass or warn, but we can still sometimes see changes in the (berr-counter tx / rx).
We have analysed the TCP dump with Wireshark and the reported problems are, sequentially:
1. Controller problems: Reached warning level for TX errors
2. Controller problems: Reasched error passive status TX
3. Controller problems: Reached wearing level for TX errors
4. Controller problems: Recovered to error active state

We have also tried the pcan (netdev) driver. This driver has the same problem as the peak_pci, but also has some kind of Protocol violation, Bus error at startup, which triggers a lot of errors and bus-offs until the berr-counter rests at tx 95.

Again, all this works normally when using PEAK USB.
Any recommendations on how to fix/debug this issue?

M.Maidhof
Support
Support
Posts: 1751
Joined: Wed 22. Sep 2010, 14:00

Re: Errors when using PCI drivers

Post by M.Maidhof » Thu 22. May 2025, 15:31

Hello,

is your CAN network termianted with 120 Ohms termination resistors on both ends?

best regards

Michael

cronix
Posts: 4
Joined: Tue 20. May 2025, 16:25

Re: Errors when using PCI drivers

Post by cronix » Thu 22. May 2025, 16:11

Hello,
yes, the two furthest points of the network are terminated with 120 Ohms.
Also, to clarify, the same cable that is plugged into the PCI was previously plugged into PEAK USB which works fine.

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

Re: Errors when using PCI drivers

Post by S.Grosjean » Fri 23. May 2025, 09:31

Hi,

Can you give us the firmware version that runs into the PCAN-minPCIe please? You should be able to get it with:

Code: Select all

$ sudo dmesg | grep peak
or

Code: Select all

$ sudo dmesg | grep pcan
according to the driver you run.

Regards,
— Stéphane

cronix
Posts: 4
Joined: Tue 20. May 2025, 16:25

Re: Errors when using PCI drivers

Post by cronix » Fri 23. May 2025, 15:47

Here are both outputs:
1. When using kernel driver:

Code: Select all

 $ sudo dmesg | grep peak
[    2.934433] peak_pci 0000:02:00.0: enabling device (0000 -> 0002)
[    2.940664] peak_pci 0000:02:00.0: can0 at reg_base=0x000000009c5e75dd cfg_base=0x00000000c287fe21 irq=18
[    2.940737] peak_pci 0000:02:00.0: can1 at reg_base=0x0000000030008ebd cfg_base=0x00000000c287fe21 irq=18
[    3.248784] peak_pci 0000:02:00.0 can0: setting BTR0=0x03 BTR1=0x1c
[    3.254380] peak_pci 0000:02:00.0 can1: setting BTR0=0x03 BTR1=0x1c
[    3.878587] snd_hda_codec_realtek hdaudioC0D0:    speaker_outs=1 (0x15/0x0/0x0/0x0/0x0)

2. When I load the pcan:

Code: Select all

 $ sudo dmesg | grep pcan
[  435.645045] pcan: Release_20250213_n (le)
[  435.645046] pcan: driver config [mod] [isa] [pci] [pec] [usb] [net] 
[  435.645190] pcan 0000:02:00.0: PCAN-miniPCIe sub-system id 5h (2 channels)
[  435.667288] pcan: PCB v4h FPGA v1.3.0 (mode 3)
[  435.667309] pcan: - pci/pcie device minor 0 found
[  435.667347] pcan: - pci/pcie device minor 1 found
[  435.667450] usbcore: registered new interface driver pcan
[  435.667608] pcan: registered CAN netdevice can0 for pci hw (237,0)
[  435.667713] pcan: registered CAN netdevice can1 for pci hw (237,1)
[  435.668064] pcan: major 237.

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

Re: Errors when using PCI drivers

Post by S.Grosjean » Mon 26. May 2025, 14:16

Hello,

Ok, thank you for your answer. v1.3.0 is the official release.

Now let's start from the beginning please:
  • What kind of "PEAK USB" device are you talking about? Can you give us its part number (IPEH-00xxxx)?
  • Can you give us the "ip link set" command you use to set the canX channel UP please?
  • And, of course, can you also give us the command you use to set the "PEAK USB" device canX channel UP too?
  • To conclude, can you do a simple test between both CAN channels of the PCAN-miniPCIe? Simply connect both ports together with 120 Ohms termination resistors at both ends, then configure each of the CAN port with the same command as above, then do:
Open a console window and type:

Code: Select all

$ candump can0,0:0,#FFFFFFFF
Then, open a 2nd console window and type:

Code: Select all

$ cangen -g 1 -I 1 -L 8 -D i -c 100 can1
"-c 100" is the count of CAN frames the "cangen" tool is going to write on the wire. Feel free to increase that value until getting ERRORS on the 1st console window (or until you see the rxerr/txerr counter and/or bus STATE changing when polling the link state with "ip -s -d link show can0/can1" from a 3rd console window).

Regards,
— Stéphane

cronix
Posts: 4
Joined: Tue 20. May 2025, 16:25

Re: Errors when using PCI drivers

Post by cronix » Thu 5. Jun 2025, 13:06

Hello, here are the answers:

1. USB device we use: PCAN-USB IPEH-002021
along with the output of dmesg for it's module:

Code: Select all

$ sudo dmesg | grep peak
[    4.402810] peak_usb 1-3:1.0: PEAK-System PCAN-USB adapter hwrev 84 serial FFFFFFFF (1 channel)
[    4.403007] peak_usb 1-3:1.0 can0: attached to PCAN-USB channel 0 (device 255)
[    4.403038] usbcore: registered new interface driver peak_usb
[    4.676162] snd_hda_codec_realtek hdaudioC0D0:    speaker_outs=1 (0x15/0x0/0x0/0x0/0x0)
[    4.698329] peak_usb 1-3:1.0 can0: setting BTR0=0x03 BTR1=0x1c
2. & 3. We do not use

Code: Select all

ip link set
, but have a file:

Code: Select all

/etc/systemd/network/80-can.network
with the following content:

Code: Select all

[Match]
Name=can*

[CAN]
BitRate=125K
RestartSec=100ms
which brings up all the interfaces.

4. I ran the simple test you wanted. When using:

Code: Select all

cangen -g 1 -I 1 -L 8 -D i -c 100 can1
I got:

Code: Select all

write: No buffer space available
But after I ran:

Code: Select all

sudo ip link set can1 txqueuelen 1000
there were never any errors or problems on the bus. Below is the image of the test where you can also see the outputs of the

Code: Select all

ip -d -s -s link show
command for PCI, though parameters are the same for USB.

Image

Post Reply