Skip to content

02. Test Tool Failure

Symptom

kcanfd_test reports Failed, or the transmitted and received packet counts do not match.

Causes and Fixes

A. The Physical Loop Is Incomplete

The test uses paired transmit and receive channels. Connect channels in pairs, for example CAN0 to CAN1 and CAN2 to CAN3. Use 120 Ω termination at both ends for long cables or high data rates.

B. Parameters Do Not Match the Hardware

Check the channel count, selected port pairs, bus mode, bit rates and payload size. Use values supported by the connected device and network.

Examples

bash
# Two channels with default CAN FD parameters
sudo kcanfd_test

# Four channels with automatic pairing
sudo kcanfd_test -c 4

# A manually selected pair at 1 Mbit/s / 5 Mbit/s
sudo kcanfd_test -m fd -p can0:can2 -b 1000000 -d 5000000

Parameters

ParameterMeaningExample
-cNumber of channels2, 4, 8
-pManual receiver:sender paircan0:can2
-mcan or fd modefd
-bArbitration bit rate1000000
-dCAN FD data bit rate5000000
-tPacket count1000000
-sPayload length8, 64

Logs

The tool creates a timestamped directory such as kcanfd_test_20251105_143022:

bash
ls -la kcanfd_test_*
cd kcanfd_test_20251105_143022

Test log directory

Driving Intelligent Connections, Empowering the Future