Skip to content
Tercio FD

Bus health

2 min readFirmware v2 · protocol v2

CAN controllers keep score of every error they see. The Tercio FD reports those counters four times a second, so a bad cable or a missing terminator shows up as a number instead of a mystery.

In Tercio Control, open Tercio FD at the bottom of the side bar. In Python, read bus.adapter_status.

Error active
HealthyNormal. Both error counters below 96.
Warning
Errors seenA counter reached 96. Frames still get through, but something is wrong.
Error passive
Error passiveA counter reached 128. The adapter stops signalling errors so it cannot disturb the bus.
Bus off
Bus offThe transmit counter passed 255. The adapter left the bus and tries to rejoin every 50 ms.

The drivers have the same counters: an S1 in error passive shows the CAN errors warning.

Field Meaning
Transmit errors (TEC) Rises by 8 for each failed transmission, falls by 1 for each successful one.
Receive errors (REC) The same for reception.
Last error The type of the most recent error, see below.
To the bus Frames delivered to the bus (acknowledged by some node).
From the bus Frames received from the bus.
Dropped out Frames from the computer that could not be sent: the queue was full, or no node acknowledged them within 50 ms.
Dropped in Frames from the bus lost because the computer did not read fast enough.
Bad USB frames Damaged frames from the computer, rejected by their CRC.
Bus-off events How often the adapter went bus-off.

Reset counters zeroes the traffic statistics; the error counters belong to the CAN controller and fall by themselves as frames get through.

Error Usual cause
No acknowledge Nothing else on the bus is powered or listening. Check that the S1 has power and that CAN-H and CAN-L are not swapped.
Stuff error, Form error Noise or reflections: a missing or extra terminator, an untwisted cable, a long stub.
Bit 0 error, Bit 1 error The adapter could not drive the bus to the level it sent: a short, a swapped pair, or a node on a different bit rate.
CRC error Corrupted frames: noise, bad termination or a poor ground connection.
None / No change Nothing new since the last report.

The adapter sends this on its own channel (ID 0x800) every 250 ms while the port is open, and in answer to GetStatus and ResetCounters. See Serial link.

Adapter status28 bytes
OffsetFieldTypeMeaning
0bus stateu80 error active, 1 warning, 2 error passive, 3 bus off
1tecu8Transmit error counter
2recu8Receive error counter
3last erroru8Last protocol error code (0 none … 6 CRC, 7 no change)
4to CANu32Frames delivered to the bus
8from CANu32Frames received from the bus
12dropped to CANu32Queue full, or not deliverable within 50 ms
16dropped from CANu32The host did not read fast enough
20framing errorsu32Damaged serial frames from the host
24bus-off eventsu16Times the adapter went bus-off
26reservedu160