I’ve come across a problem with the FlexCAN ports on the i.MX8X. In Linux, we bring up the CAN ports thusly;
ip link set can0 type can bitrate 1000000 dbitrate 1000000 fd on
ip link set can0 up
…even though we really want the port to operate in CAN 2.0B (non FD) mode. Examining the link with;
ip -details link show can0
...yields;
2: can0: <NOARP,ECHO> mtu 72 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 10
link/can promiscuity 0
can <FD> state STOPPED (berr-counter tx 0 rx 0) restart-ms 0
bitrate 1000000 sample-point 0.750
tq 25 prop-seg 14 phase-seg1 15 phase-seg2 10 sjw 1
flexcan: tseg1 2..64 tseg2 1..32 sjw 1..32 brp 1..1024 brp-inc 1
dbitrate 1000000 dsample-point 0.750
dtq 50 dprop-seg 7 dphase-seg1 7 dphase-seg2 5 dsjw 1
flexcan: dtseg1 1..39 dtseg2 1..8 dsjw 1..8 dbrp 1..1024 dbrp-inc 1
clock 40000000numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
This seems to confirm that the port is in fact in CAN FD mode which we don’t want. But I am not able to set it with CAN FD turned off (fd off). If I do, I get;
RTNETLINK answers: Operation not supported
In fact I can listen in on non-FD traffic on that port, but as soon as I attempt to transmit, it brings down the bus and the FlexCAN will eventually go bus off. This makes sense since the other devices on the bus are not FD capable.
Is there a way to get the port operating in non-FD (2.0B) mode?
Thanks.