Hello,
Currently we are testing CANFD with channel0 in RZG2UL SOC based custom board with Linux 3.0.3 BSP.
When data bitrate is set to 2Mbps or lower CAN data transfer is working properly.
When data bitrate is increased to 3/4Mbps it shows some error prints and bitrate is not set properly. but CPU HW user guide states CANFD can support upto 4Mbps bitrate (Pg - 1471 and table 28.6)
bitrate is set using below command
ip link set can0 up type can bitrate <bitrate> dbitrate <dbitrate> fd on
when 2Mbps bitrate is set:
ip link set can0 up type can bitrate 2000000 dbitrate 2000000 fd on
below is the statistics of bitrate set
ip -details -statistics -h link show can0
3: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 72 qdisc pfifo_fast state UP mode DEFAULT group default qlen 10
link/can promiscuity 0 minmtu 0 maxmtu 0
can <FD> state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
bitrate 2000000 sample-point 0.720
tq 20 prop-seg 8 phase-seg1 9 phase-seg2 7 sjw 1
rcar_canfd: tseg1 2..128 tseg2 2..32 sjw 1..32 brp 1..1024 brp-inc 1
dbitrate 2000000 dsample-point 0.680
dtq 20 dprop-seg 8 dphase-seg1 8 dphase-seg2 8 dsjw 1
rcar_canfd: dtseg1 2..16 dtseg2 2..8 dsjw 1..8 dbrp 1..256 dbrp-inc 1
clock 50000000
re-started bus-errors arbit-lost error-warn error-pass bus-off
0 0 0 0 0 0 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
RX: bytes packets errors dropped overrun mcast
24 6 0 0 0 0
TX: bytes packets errors dropped carrier collsns
24 6 0 0 0 0
when 3Mbps bitrate is set using below command it shows error when setting bitrate and data transfer does not happen
ip link set can0 up type can bitrate 3000000 dbitrate 3000000 fd on
[ 813.124264] rcar_canfd 10050000.can can0: bitrate error 1.9%
[ 813.130062] rcar_canfd 10050000.can can0: bitrate error 1.9%
[ 813.143031] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready
ip -details -statistics -h link show can0
3: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 72 qdisc pfifo_fast state UP mode DEFAULT group default qlen 10
link/can promiscuity 0 minmtu 0 maxmtu 0
can <FD> state ERROR-ACTIVE (berr-counter tx 0 rx 88) restart-ms 0
bitrate 2941176 sample-point 0.705
tq 20 prop-seg 5 phase-seg1 6 phase-seg2 5 sjw 1
rcar_canfd: tseg1 2..128 tseg2 2..32 sjw 1..32 brp 1..1024 brp-inc 1
dbitrate 2941176 dsample-point 0.705
dtq 20 dprop-seg 5 dphase-seg1 6 dphase-seg2 5 dsjw 1
rcar_canfd: dtseg1 2..16 dtseg2 2..8 dsjw 1..8 dbrp 1..256 dbrp-inc 1
clock 50000000
re-started bus-errors arbit-lost error-warn error-pass bus-off
0 24 0 0 0 0 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
RX: bytes packets errors dropped overrun mcast
216 30 24 0 0 0
TX: bytes packets errors dropped carrier collsns
24 6 0 0 0 0
How to support higher bitrate for CAN in RZG2UL board?
We are using canutils (cansend and candump) for testing data transfer.