cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
486 Views
Registered: ‎05-07-2019

zynq-7000 CAN bus doesn't work correctly

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

 

Tags (3)
0 Kudos
3 Replies
Highlighted
Visitor
Visitor
479 Views
Registered: ‎05-07-2019

Re: zynq-7000 CAN bus doesn't work correctly

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.

0 Kudos
Highlighted
Observer
Observer
199 Views
Registered: ‎10-26-2018

Re: zynq-7000 CAN bus doesn't work correctly

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.

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
162 Views
Registered: ‎04-09-2019

Re: zynq-7000 CAN bus doesn't work correctly

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