How to achieve normal communication between CAN FD interfaces, and what commands need to be input?
Previously, the CAN FD loopback test commands provided by NV were used, and the test passed.
However, when two CAN FD interfaces are interconnected, low-speed communication with 8-byte data can be achieved successfully. But high-speed communication at 8 Mbps with 64-byte data cannot be performed normally.
For example, when CAN0 and CAN1 are connected to each other, and CAN0 sends the command
I’m developing functions using self - developed boards equipped with the Thor module. The CAN FD signals output by the module are converted into differential signals through a transceiver. The differential signals of CAN 1 and CAN 0 can ensure that there is no problem with the hardware connection because the low - speed communication between CAN 0 and CAN 1 is normal.
When CAN 0 sends 8 - byte data, CAN 1 can receive it normally, but the measured differential signal waveform has a maximum rate of only 1 Mbps. When CAN 0 sends 64 - byte data, CAN 1 cannot receive it normally, and the bus enters the BUS - OFF state. The specific commands for setting CAN are as follows:
Open the terminal window and enter:
ip link set down can0 ip link set down can1 ip link set can0 up type can bitrate 1000000 dbitrate 8000000 berr - reporting on fd on ip link set can1 up type can bitrate 1000000 dbitrate 8000000 berr - reporting on fd on
At this time, CAN 0 and CAN 1 are configured. Enter
#ip - details link show can0and ip - details link show can1
to check the working status of the two CAN interfaces, which are operating normally. Open another terminal window and enter
#candump can1
and then CAN 1 enters the receiving mode. In the original working input, enter
#cansend can0 123#1122334455667788.
At this time, CAN 1 can display the normal reception of 8 - byte data, but the measured waveform transmission rate is only 1 Mbps.
on the CAN 0 side, CAN 1 cannot receive the data normally. Checking the status with
#ip - details link show can0
shows that the bus has entered the BUS - OFF state.
However, with the same rear - end CAN transceiver hardware, when using the SPI - to - CAN - FD solution on the RK platform and inputting the same operation instructions and adopting the same operation method, CAN 1 can receive 64 - byte data normally, and the measured waveform transmission rate can reach more than 5 Mbps.
Since these operation instructions come from the official RK technical document for testing CAN FD, they may not be applicable to the NV platform. This phenomenon is not specific to 8M CAN - FD; the same problem exists for 5M. I think that normal transmission of 64 - byte data is required to achieve high - speed CAN FD, while 8 - byte data transmission is low - speed CAN communication.
Which CAN transceiver is used in your setup?
Have you confirmed it supporting upto 8M bitrate?
Is there the issue with 1M CAN-FD?
# ip link set can0 up type can bitrate 1000000 dbitrate 1000000 berr - reporting on fd on
# ip link set can1 up type can bitrate 1000000 dbitrate 1000000 berr - reporting on fd on
Please share the full dmesg and device tree for further check.
Thank you. After applying these two patches, the CAN interface configured at 8Mbps can now successfully transmit 64 bytes of data. The issue has been resolved.