Hi,
I came across this older thread (viewtopic.php?t=3445&sid=366236ac1650d4 ... eb8f9c7c6d) about RX/TX error counters and the mainline peak_usb driver, and have a related question on a PCAN-USB FD X6, kernel 6.12.47 using the newest proprietary driver Version 9.2.0, with CAN_CTRLMODE_BERR_REPORTING and CAN_RAW_ERR_FILTER enabled.
When an interface transmits continuously without any acknowledgment on the bus, it reaches error-passive state after a short time. Per linux/can/error.h, error-passive requires a counter value of 128–255, yet the TX error counter byte (data[6]) we receive never exceeds 8 and does not increment further, even though the controller must internally be counting well past that to reach error-passive.
Additionally, CAN_ERR_CNT the flag documented in error.h as indicating that data[6]/data[7] actually contain valid counter values is never set on any of these error frames. Without it, we have no way to know whether the data[6] value we do see is meant to be trusted at all.
Is it possible to reliably retrieve the actual, incrementing TX/RX error counters from this device via error frames? And why would CAN_ERR_CNT never be set, and data[6] not reflect the counter growth implied by reaching error-passive?
Best regards,
Lukas
TX/RX error counter (data[6]/data[7]) not incrementing and CAN_ERR_CNT never set
-
lukas.toma1
- Posts: 12
- Joined: Mon 31. Mar 2025, 10:37
- S.Grosjean
- Software Development

- Posts: 369
- Joined: Wed 4. Jul 2012, 17:02
Re: TX/RX error counter (data[6]/data[7]) not incrementing and CAN_ERR_CNT never set
Hi,
CAN_ERR_CNT was not introduced until Linux 6.0, even though the proprietary driver has supported the socket-CAN interface for much longer. Nevertheless, we plan to include support for it in the next version. Thank you for your contribution.
Regarding your comment that the error counters may not be incremented high enough, we will set up a test platform in our labs to verify this. However, there is no requirement for a Socket-CAN driver to report the exact increment of these counters throughout the transition from ERROR_ACTIVE to ERROR_PASSIVE.
Best regards,
CAN_ERR_CNT was not introduced until Linux 6.0, even though the proprietary driver has supported the socket-CAN interface for much longer. Nevertheless, we plan to include support for it in the next version. Thank you for your contribution.
Regarding your comment that the error counters may not be incremented high enough, we will set up a test platform in our labs to verify this. However, there is no requirement for a Socket-CAN driver to report the exact increment of these counters throughout the transition from ERROR_ACTIVE to ERROR_PASSIVE.
Best regards,
— Stéphane