CANCONFIG(8) System Manager's Manual CANCONFIG(8)

canconfig
configure CAN network interface parameters

canconfig -a

canconfig canif

canconfig can command [args ...]

The canconfig utility is used to configure CAN network interface parameters and retrieve CAN network interface parameters and status from the kernel.

The base time unit used to define the network bit rate is the time quanta (tq), its value is defined by the input clock frequency and the prescaler value as (1/ freq * prescaler).

The network bit time is split in 4 segments:

sync_seg
fixed to 1 tq
prop_seg
 
phase_seg1
 
phase_seg2
 
The network bit time is (1 + prop_seg + phase_seg1 + phase_seg2), in tq. The sample point is between phase_seg1 and phase_seg2.

The receiver hardware is allowed to shorten prop_seg or phase_seg2 to resynchronize with the sender. The swj (Synchronisation Jump Width) parameter defines by how much the hardware can shorten these segments.

Some hardware can use 3 sample points instead of one, and keep the majority as the final value.

The options are as follows:
Display the status of all CAN devices present on the system. This flag is mutually exclusive with all other sub-commands.

All other operations require that a CAN interface be specified. If a CAN interface is specified with no sub-commands, the status of that interface is displayed.

The following sub-commands are available:

Start network operations on the interface. Requires that all timing parameters have been set.
Stop network operations on the interface.
value
Set the value of the baud rate prescaler.
value
Set the number of tq for the propagation segment.
value
Set the number of tq for the phase segment 1.
value
Set the number of tq for the phase segment 2.
value
Set the number of tq for the Synchronisation Jump Width.
Enable triple-sampling.
Disable triple-sampling.
Enable listen-only mode. In this mode the controller is passive, and doesn't send ACKs on the bus.
Disable listen-only mode.
Enable loopback mode. In this mode, the controller doesn't expect ACK from the bus.
Disable loopback mode.

ifconfig.if(5), ifconfig(8)

The canconfig utility first appeared in NetBSD 8.0.

This version of the canconfig utility was written by Manuel Bouyer.
April 15, 2017 NetBSD 9.4