PCAN-USB FD: unexpected receive behavior after switching from Listen-Only to Normal mode

This forum covers PCAN-Linux and Linux development issues concerning our products
Post Reply
MacCAN
Posts: 1
Joined: Wed 30. Sep 2026, 12:08

PCAN-USB FD: unexpected receive behavior after switching from Listen-Only to Normal mode

Post by MacCAN » Wed 30. Sep 2026, 15:36

While investigating a long-standing issue in our macOS PCAN-Basic compatible library, I found that the same behavior is reproducible on Linux using PEAK's current Linux driver v9.3.1 and PCAN-Basic.

The original issue and its history can be found here: https://github.com/mac-can/PCBUSB-Library/issues/8

Test setup
- Debian 13.7
- PEAK Linux driver v9.3.1
- PCAN-USB FD (IPEH-004022)
- Kvaser U100P connected to another computer as the transmitting CAN node
- 250 kbit/s
- No additional CAN node is connected to acknowledge CAN frames

The test sequence is:

Code: Select all

CAN_SetValue(channel, PCAN_LISTEN_ONLY, ON, ...);
CAN_Initialize(channel, PCAN_BAUD_250K, ...);
CAN_SetValue(channel, PCAN_LISTEN_ONLY, OFF, ...);
After switching `PCAN_LISTEN_ONLY` back to `OFF`, the PCAN-USB FD reports a large number of apparently received standard CAN messages although only one or very few messages have actually been transmitted by the other node. The data of these messages remains unchanged.

The behavior disappears when another active CAN node is connected to the bus and acknowledges the CAN communication.

The attached `pcan_recv.c` is a minimal reproducer. On Linux it can be built with:

Code: Select all

gcc pcan_recv.c -lpthread -lpcanbasic -o pcan_recv
We have additionally inspected the raw USB receive data on macOS. The repeated messages are already present in the USB transfers, including unchanged CAN data and timestamps. Therefore they are not generated by our CAN-message decoding code.

Could you please clarify whether this behavior is known for the PCAN-USB FD, and whether switching from Listen-Only mode to Normal mode requires any additional initialization or reset of the device?

---

Code: Select all

haumea@UV-PC012DEB:~$ uname -a
Linux UV-PC012DEB 6.12.107+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.107-1 (2026-08-29) x86_64 GNU/Linux
haumea@UV-PC012DEB:~$ lsmod | grep pcan
pcan                  307200  0
i2c_algo_bit           16384  2 pcan,i915
usbcore               409600  8 xhci_hcd,usbhid,btmtk,rtsx_usb,btusb,xhci_pci,pcan,hid_logitech_hidpp
haumea@UV-PC012DEB:~$ cat /proc/pcan

*------------- PEAK-System CAN interfaces (www.peak-system.com) -------------
*------------- Release_20260916_n (9.3.1) Sep 28 2026 10:31:43 --------------
*---------------------- [mod] [isa] [pci] [pec] [usb] -----------------------
*--------------------- 1 interfaces @ major 237 found ----------------------
*n -type- -ndev- --base-- irq --btr- --read-- --write- --irqs-- -errors- status
32  usbfd   -NA-        0 000 0x001c 00000000 00000000 00000000 00000000 0x0000
haumea@UV-PC012DEB:~$ 
Attachments
pcan_recv.c
(3.15 KiB) Downloaded 107 times

F.Vergnaud
Software Development
Software Development
Posts: 311
Joined: Mon 9. Sep 2013, 12:21

Re: PCAN-USB FD: unexpected receive behavior after switching from Listen-Only to Normal mode

Post by F.Vergnaud » Fri 2. Oct 2026, 10:22

Hello MacCAN,

Thank you for your detailed report. We were able to reproduce your issue and are preparing a patch for PCANBasic Linux.
Currently, in your usecase the second call "CAN_SetValue(channel, PCAN_LISTEN_ONLY, OFF, ...);" configures the setting in the API but it is not applied to the active connection.
A workaround is to manually uninitialize the channel and re-initialize it.

If you want to test the next release that will include this patch, please send an email to our support (support.peak [at] hms-networks.com) and we will share a link to download a beta version.
Best regards,
Fabrice

Post Reply