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!

AR# 55133

Zynq-7000 SoC Example Design - Is it possible to check PS Controller Area Network (CAN) functionality using the PL as "external loopback"?


I tried to perform the quick test to implement both CAN (Controller Area Network) using the EMIO (by pass the Transceiver). In the PL, I tied the CAN0_Rx to CAN1_Tx, and CAN0_TX to CAN1_RX. If I ran the loopback test, both CAN work fine. However, when I enable the NORMAL mode, the CAN receiver does not receive any CAN message.

Note: An Example Design is an answer record that provides technical tips to test a specific functionality on Zynq-7000. A tip can be a snippet of code, a snapshot, a diagram, or a full design implemented with a specific version of the Xilinx tools. It is up to the user to "update" these tips to future Xilinx tools releases and to "modify" the Example Design to fulfill his needs. Limited support is provided by Xilinx on these Example Designs.

Implementation Details
Design TypePS and PL
SW TypeStandalone
CPUsSingle CPU
PS Features
PL Cores--
Xilinx Tools VersionEDK 14.4
Other details--

Note: A version of the design built using Vivado IP Integrator is also attached.

Simply, create a new Vivado project targeting the ZC702.

Source the .tcl to create the block design.

Add the constraints files.

Generate the output products.

Create the HDL wrapper and generate the bitstream.


You cannot simply connect TX to RX. CAN is a single wire protocol, so that means TX and RX need to be on the same line shorted. 

Therefore, you need to AND the CAN0.TX and CAN1.TX, and then connect the signal to CAN0.RX and CAN1.RX.

   (CAN0_TX and CAN1_TX) connected to CAN0_RX
   (CAN0_TX and CAN1_TX) connected to CAN1_RX

The example provided by Xilinx uses the "LOOPBACK" mode to self check a single controller. You can easily modify the example and use it for this test case.

Here are a few hints:

Define two DEVICE_ID and two driver instances:


   static XCanPs Can0;
   static XCanPs Can1;

Initialize both controller in NORMAL mode (instead of LOOPBACK mode):

   XCanPs_EnterMode(Can0InstPtr, XCANPS_MODE_NORMAL);
   while(XCanPs_GetMode(Can0InstPtr) != XCANPS_MODE_NORMAL);

   XCanPs_EnterMode(Can1InstPtr, XCANPS_MODE_NORMAL);
   while(XCanPs_GetMode(Can1InstPtr) != XCANPS_MODE_NORMAL;

Send with one controller and receive with the other:

   Status = SendFrame(Can0InstPtr);
   if (Status != XST_SUCCESS) {
     return Status;

Status = RecvFrame(Can1InstPtr);


Associated Attachments

Name File Size File Type
ipi_example_design_2013.1.zip 2 KB ZIP

Linked Answer Records

Master Answer Records

Answer Number Answer Title Version Found Version Resolved
51779 Zynq-7000 SoC - Example Designs and Tech Tips N/A N/A
AR# 55133
Date 05/28/2018
Status Active
Type General Article
  • Zynq-7000
  • EDK - 14.4
  • Vivado Design Suite - 2013.1
Page Bookmarked