...
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.
How to Enable
Source path for the driver: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 name | Path in Vitis | Path in GitHub |
---|---|---|
canfd | <Vitis Install Directory>/data/embedded/XilinxProcessorIPLib/drivers/canfd | https://github.com/Xilinx/embeddedsw/tree/master/XilinxProcessorIPLib/drivers/canfd |
Info |
---|
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 |
Driver The driver source code is organized into different folders. Below diagram The table below shows the canfd driver source organization
canfd
|
-- Doc - .
canfd
|
-- Doc - .
Directory | Description |
---|---|
data | Driver .tcl and .mdd file |
doc | Provides the API and data structure details |
- Examples - Reference application to
examples | Example applications that show how to use the driver |
|
- Source -
features | |
src | Driver source files |
Driver Implementation
For a full list of features supported by this IP, please refer Chapter 66: Can Controller in Versal Trm
Features Supported
Controller Features:
- Compatible with the ISO 11898 -1, CAN 2.0A, and CAN 2.0B standards
- Standard (11-bit identifier) and extended (29-bit identifier) frames
- Flexible Bit rates up to 8 Mb/s
- Nominal Bit rates up to 1 Mb/s
- Transmit message FIFO (TxFIFO) with a depth of 64 messages
- Watermark interrupts for TxFIFO and RxFIFO
- Automatic re-transmission on errors or arbitration loss in normal mode
- Two 64-deep RX FIFOs with 32 ID Filter-Mask pairs
- Four Rx acceptance filters with enables, masks and IDs
- Loop back and snoop modes for diagnostic applications
- Mask able error and status interrupts
- 16-Bit time stamping for receive message
- Readable Rx/Tx error counters
- Message with lowest ID transmitted first
Driver Features:
- Supports Standard and extended frames
- Supports Config, Sleep, Normal and snoop modes
- Supports Acceptance filter configurations
- Supports Polled and interrupt modes
- Water mark interrupt support for both Tx and Rx FIFOs
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 Name | Source | Description |
---|---|---|
Polled | 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 |
Interrupt | xcanfd_intr_example.c | It 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
It configures the CANFD controller in loop back mode with no interrupt enabled and verifies the data received with data sent
Code Block | ||
---|---|---|
| ||
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.cIt configures the CANFD controller in loop back mode with interrupts enabled and verifies the data received with data sent
Code Block | ||
---|---|---|
| ||
Interrupt Mode test: CANFD Interrupt Example Test Successfully ran XCanFd Interrupt Mode example |
Known issues and Limitations
NoneChange Log
- 2019
2021.1
Summary:None2019.2
- Summary
- canfd:Fixes incorrect mask values for CANFD2.0
- Commitse1d5650c canfd:Fixes incorrect mask values for CANFD2.0https://github.com/Xilinx/embeddedsw/blob/xlnx_rel_v2021.1/doc/ChangeLog#L414
- Summary
- 2020.2
- 2020.12021.1
- Summary:
- canfd:Used correct macro to access RX FIFO1 buffer
- canfd:Fixed missing RX can packets on CANFD2.0
- canfd: Updated tcl file to support AXI CANFD and CANFD
- canfd: Fix missing TX canfd packet in loopback
- canfd: Added support for Protocol Exception and BusOff Event support.
- canfd: Added PEE support and updated BusOff EventHandler.
- canfd: Fix sending extra frames in XCanFd_Send_Queue.
- canfd: Initialize IsPl of config structure
- Commits:
- 182ead82 :Used correct macro to access RX FIFO1 buffer
- a750484d :Fixed missing RX can packets on CANFD2.0
- d66e87bf :Updated tcl file to support AXI CANFD and CANFD
- fa8441de :Fix missing TX canfd packet in loopback
- dee69bb8 :Added support for Protocol Exception and BusOff Event support.
- 0cff0aa1 :Added PEE support and updated BusOff EventHandler
- 417e3677 :Fix sending extra frames in XCanFd_Send_Queue
- 914c2bdf :Initialize IsPl of config structure
- Summary:
2020.2
- Summary:
- canfd: Update Makefile for parallel make execution
- Commits
- 59aa1f canfd: Update Makefile for parallel make execution
- Summary:
- 2019.2
- 2019.1
- 2018.3
- https://github.com/Xilinx/embeddedsw/blob/xilinx_v2021.1release-2018.3/doc/ChangeLog#L1060ChangeLog#L119
- 2018.2
- None