This page gives an overview of the bare-metal driver support for the PS and Soft CANFD IP.   

Table of Contents 

Introduction

This page gives an overview of canfd driver which is available as part of the Xilinx Vivado and Vitis Core Development Kit distribution.
For more information, please refer Chapter 66: Can Controller in Versal Trm which includes links to 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 namePath in Vitis

Path in GitHub

canfd

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

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



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/canfd


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


DirectoryDescription
dataDriver .tcl, .yaml and .mdd file
docProvides the API and data structure details
examplesExample applications that show how to use the driver features
srcDriver source files, make and cmakelists 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 Chapter 66: Can Controller in Versal Trm


Features 

Controller Features:

Driver Features:


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.

Links to Examples

Examples Path:

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

Test NameSourceDescription
Polledxcanfd_polled_example.cIt configures the CANFD controller in loop back mode with no interrupt enabled and verifies the data received with data sent
Interruptxcanfd_intr_example.cIt configures the CANFD controller in loop back mode with interrupts enabled and verifies the data received with data sent


Example Application Usage

Canfd polled mode test

https://github.com/Xilinx/embeddedsw/blob/master/XilinxProcessorIPLib/drivers/canfd/examples/xcanfd_polled_example.c


It configures the CANFD controller in loop back mode with no interrupt enabled and verifies the data received with data sent
Polled Mode test::
CANFD Polled Mode Example Test
Successfully ran XCanFd Polled Mode example

Canfd interrupt mode test

https://github.com/Xilinx/embeddedsw/blob/master/XilinxProcessorIPLib/drivers/canfd/examples/xcanfd_intr_example.c
It configures the CANFD controller in loop back mode with interrupts enabled and verifies the data received with data sent
Interrupt Mode test:
CANFD Interrupt Example Test
Successfully ran XCanFd Interrupt Mode example

Change Log

2023.2

2023.1

2022.2

2022.1

2021.2

2021.1

 2020.2

2020.1

2019.2

2019.1

2018.3

2018.2


Related Links