CAN Driver

This page gives an overview of the bare-metal driver support for the Xilinx® LogiCORE™ Controller Area Network (CAN) soft IP.

Table of Contents

Introduction

This page gives an overview of can driver which is available as part of the Xilinx Vivado and SDK distribution.

For more information, please refer CAN_Doc the official documentation and resource utilization. 

Driver Sources

The source code for the driver is included with the Vitis Unified Software Platform installation, as well as being available in the Xilinx Github repository.

Driver name

Path in vitis

path in Git Hub

Driver name

Path in vitis

path in Git Hub

can

<Vitis Install Directory>/data/embedded/XilinxProcessorIPLib/drivers/can

https://github.com/Xilinx/embeddedsw/tree/master/XilinxProcessorIPLib/drivers/can/

 

Note: To view the sources for a particular release, use the rel-version tag in github.  For example, for the 2020.1 release, the proper version of the code is: https://github.com/Xilinx/embeddedsw/tree/master/XilinxProcessorIPLib/drivers/can/

The driver source code is organized into different folders. The table below shows the CAN driver source organization.

Directory

Description

Directory

Description

src

Driver source files, make and cmakelists file

examples

Example applications that show how to use the driver features

doc

Provides the API and data structure details

data

Driver .tcl, .yaml and .mdd file

Note: AMD Xilinx embeddedsw build flow is changed from 2023.2 release to adapt to the new system device tree based flow. For further information, refer to the wiki page Porting embeddedsw components to system device tree (SDT) based flow - Xilinx Wiki - Confluence (atlassian.net).

The .yaml(in data folder) and CMakeLists.txt(in src folder) files are needed for the System Device Tree based flow. The Driver .tcl and .mdd files are for the older build flow which will be deprecated in the future.

Driver Implementation

For a full list of features supported by this IP, please refer CAN_Doc

Features

Controller Features:

  • Industrial (I, –40 to +100°C junction temperature) and automotive/defense Q-Grade (Q, –40 to +125°C junction temperature) device support.

  • Supports both standard (11-bit identifier) and extended (29-bit identifier) frames

  • Supports bit rates up to 1 Mb/s • Transmit message FIFO with a user-configurable depth of up to 64 messages

  • Transmit prioritization through one high-priority transmit buffer

  • Automatic re-transmission on errors or arbitration loss • Receive message FIFO with a user-configurable depth of up to 64 messages

  • Acceptance filtering (through a user-configurable number) of up to four acceptance filters

  • Sleep mode with automatic wake up

  • Loopback mode for diagnostic applications

  • Maskable error and status interrupts

  • Readable error counters

Driver Supported Features

The CAN Standalone driver support the below things.

  • All controller features supported.

Known Issues and Limitations

  • None.

Example Applications

Refer to the driver examples directory for various example applications that exercise the different features of the driver. Each application is linked in the table below. The following sections describe the usage and expected output of the various applications.  These example applications can be imported into the Vitis IDE from the Board Support Package  settings tab.

Examples Path:

https://github.com/Xilinx/embeddedsw/tree/master/XilinxProcessorIPLib/drivers/can/examples

Test Name

Example Source

Description

Test Name

Example Source

Description

Polled

xcan_polled_example.c

 It configures the CAN controller in loop back mode with no interrupt enabled and verifies the data received with data sent.

Interrupt

xcan_intr_example.c

  It configures the CAN controller in loop back mode with interrupts enabled and verifies the data received with data sent.

Example Application Usage

CAN examples

Expected Output

xcan_polled_example.c

                 It configures the CAN controller in loop back mode with no interrupt enabled and verifies the data received with data sent.

Successfully ran Can polled Example

xcan_intr_example.c

                 It configures the CAN controller in loop back mode with interrupts enabled and verifies the data received with data sent.

                 https://github.com/Xilinx/embeddedsw/blob/master/XilinxProcessorIPLib/drivers/can/examples/xcan_intr_example.c

Successfully ran Can Interrupt Example

Example Design Architecture

NA

Known Issues and Limitations

  • None

Change Log

2023.2

https://github.com/Xilinx/embeddedsw/blob/xilinx_v2023.2/doc/ChangeLog#L678

2022.2

  • None

2022.1

  • None

2021.2

  • None

2021.1

https://github.com/Xilinx/embeddedsw/blob/xlnx_rel_v2021.1/doc/ChangeLog#L411

2020.2

https://github.com/Xilinx/embeddedsw/blob/release-2020.2/doc/ChangeLog#L190

2020.1

https://github.com/Xilinx/embeddedsw/blob/release-2020.1/doc/ChangeLog#L425

2019.2

None

2019.1

None

2018.3

https://github.com/Xilinx/embeddedsw/blob/release-2018.3/doc/ChangeLog#L116

Related Links

 

© Copyright 2019 - 2022 Xilinx Inc. Privacy Policy