UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor bb8
Visitor
6,540 Views
Registered: ‎03-01-2016

ZC702 J52 CAN Bus

I have a ZC702 and want to set up communication in Linux with a 5V CAN bus device connected to J52. I have the device tree configured and "ifconfig -a" returns:

 

 

can0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          UP RUNNING NOARP  MTU:16  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:10
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:22

eth0      Link encap:Ethernet  HWaddr 00:0A:35:00:01:22
          inet addr:192.168.10.18  Bcast:192.168.10.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:421 errors:0 dropped:0 overruns:0 frame:0
          TX packets:86 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:38432 (37.5 KiB)  TX bytes:16992 (16.5 KiB)
          Interrupt:30 Base address:0xb000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

In Vivado I have can0 configured to use MIO46 (CAN_TXD), MIO47 (CAN_RXD).

 

I am attempting to use canutils to start can0 but receive ERROR-ACTIVE.

root@zc702-zynq7:~/s/canutils_install/sbin# ./canconfig can0 bitrate 500000
[  145.059053] xilinx_can e0008000.can can0: bitrate error 0.7%
can0 bitrate: 496031, sample-point: 0.666
root@zc702-zynq7:~/s/canutils_install/sbin# ./canconfig can0 start
can0 state: ERROR-ACTIVE
root@zc702-zynq7:~/s/canutils_install/sbin# dmesg|grep can
[    3.308406] can: controller area network core (rev 20120528 abi 9)
[    3.319031] can: raw protocol (rev 20120528)
[    3.323306] can: broadcast manager protocol (rev 20120528 t)
[    3.328909] can: netlink gateway (rev 20130117) max_hops=1
[  145.059053] xilinx_can e0008000.can can0: bitrate error 0.7%

What should I look at to get CAN to start? Any advice is appreciated.

0 Kudos
3 Replies
Observer huhanvictory
Observer
1,995 Views
Registered: ‎06-26-2014

Re: ZC702 J52 CAN Bus

Hi,

I also met the same problem. When I type "./config can0 start", it shows:

can0 state: ERROR-ACTIVE

 

How did you solve this problem?

I am a freshmen of FPGA. But I know everything is ok if I work hard.
0 Kudos
Moderator
Moderator
1,963 Views
Registered: ‎07-31-2012

Re: ZC702 J52 CAN Bus

Hi,

 

Could you try these commands?

 

root@Xilinx-ZC702:~# canconfig can0 bitrate 500000 -> this will set bit rate to 500kbps
root@Xilinx-ZC702:~# ifconfig can0 up [OR canconfig can0 start]
root@Xilinx-ZC702:~# ifconfig
root@Xilinx-ZC702:~# cansniffer can0 &

 

Then in CAN analyzer tool it should show up messages like the below:

 

Then we will able to see the can sniffing of packets as below
time ID data ... cansniffer can0 # l=2 h=10 t=50
time ID data ... cansniffer can0 # l=2 h=10 t=50
9.999999 3af 01 01 00 01 ....
0.000000 3af 01 01 00 01 ....
3.004191 3af 02 .
0.000000 3af 02 .

 

To check number of packets received


root@Xilinx-ZC702:~# ifcofign can0
can0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
UP RUNNING NOARP MTU:16 Metric:1
RX packets:2 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:10
RX bytes:5 (5.0 B) TX bytes:0 (0.0 B)

Interrupt:10

 

Regards

Praveen


-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Contributor
Contributor
149 Views
Registered: ‎10-29-2018

Re: ZC702 J52 CAN Bus

Hi @bb8 

did you solve this problem? because i have the same issue.

Hi @pvenugo 
Is it possible to test the CAN-BUS in two boards zc7020 using cansend and candump command on J52.
because i try to wire the CAN_H, CAN_L and Ground with jumper and try to send the sample data for one board (zc7020) using cansend can0 05a1#11.22.33 and try to recieve the this data using candump can0 in other terminla but nothing appears.
Do you have some advise for me, please? how to test candump can0 to communicate two boards zc7020? or should we just use CAN-Analyzer?

Best Regards

Ray

 

0 Kudos