06-20-2019 08:04 AM
Hi there,
Recently, I am working on enabling the ZYNQ 7000 based device. Everything goes well, when I enable the CAN bus, I face a problem on it.
I refered to https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842496/Linux+CAN+driver to enable the device tree and kernel drivers. After compiling, I can see can0 via ifconfig.
I used following steps to turn on the can0 interface:
ip link set can0 down
ip link set can0 type can bitrate 100000
ip link set can0 up
I can observe the can0 was working as metioned in xilinx confluence
root@OpenWrt:/# ip -details -statistic link show can0
2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP mode DEFAULT group default qlen 10
link/can promiscuity 0
can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
bitrate 99999 sample-point 0.875
tq 1250 prop-seg 3 phase-seg1 3 phase-seg2 1 sjw 1
xilinx_can: tseg1 1..16 tseg2 1..8 sjw 1..4 brp 1..256 brp-inc 1
clock 99999999
re-started bus-errors arbit-lost error-warn error-pass bus-off
0 14 0 0 0 7 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gs
RX: bytes packets errors dropped overrun mcast
112 14 0 0 0 0
TX: bytes packets errors dropped carrier collsns
42 0 14 8 0 0
When I used "cansend" command to send data to bus, error happened, the kernel post an error message as below:
" [ 2583.183533] xilinx_can e0008000.can can0: xcan_err_interrupt: error status register:0x0 "
"[ 2583.193352] xilinx_can e0008000.can can0: bus-off "
"[ 3622.908910] xilinx_can e0008000.can can0: xcan_err_interrupt: error status register:0x0 "
And my can0 interface went to BUS-OFF status as below:
root@OpenWrt:/# ip -details -statistic link show can0
2: can0: <NO-CARRIER,NOARP,UP,ECHO> mtu 16 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 10
link/can promiscuity 0
can state BUS-OFF (berr-counter tx 0 rx 0) restart-ms 0
bitrate 99999 sample-point 0.875
tq 1250 prop-seg 3 phase-seg1 3 phase-seg2 1 sjw 1
xilinx_can: tseg1 1..16 tseg2 1..8 sjw 1..4 brp 1..256 brp-inc 1
clock 99999999
re-started bus-errors arbit-lost error-warn error-pass bus-off
0 16 0 0 0 8 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gs
RX: bytes packets errors dropped overrun mcast
128 16 0 0 0 0
TX: bytes packets errors dropped carrier collsns
50 0 16 8 0 0
root@OpenWrt:/#
Have you ever seen this problem?
==============More information=================
My device tree:
can0: can@e0008000 {
compatible = "xlnx,zynq-can-1.0";
status = "okay";
clocks = <&clkc 19>,<&clkc 36>;
clock-names = "can_clk", "pclk";
reg = <0xe0008000 0x1000>;
interrupts = <0 28 4>;
interrupt-parent = <&intc>;
tx-fifo-depth = <0x40>;
rx-fifo-depth = <0x40>;
};
Thanks
Best regards,
Chen
06-20-2019 08:27 AM
More information:
I used a uart to can device connected to zynq board's can, I can recevice the data from zynq can0 interface via candump command.
04-03-2020 08:19 AM
Hello @chenxy1988
Can you please tell me if you resolved this issue of getting bus-off error on using cansend.
I am facing similar issue, but without any errors on interrupt pins. If resolved, can you please share your solution.
Thanks in advance.
04-05-2020 06:53 AM
Hi,
Can you please verify the bus is formed correctly or not, i mean to say the termination resistor is added to from the bus.
Regards,
Venu
09-15-2020 11:16 PM
Hi, can you help me, please?. How do you to install the library can-util(.bin). Do you have some tutorial?.
Best regards.
09-16-2020 09:25 AM
Hi,
Please follow the link https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842496/Linux+CAN+driver
Regards,
Venu