CAN Driver

The CAN-CTRL core is a serial communication controller that enables serial communication in compliance with the CAN protocol. The CAN bus interface supported by this core adopts the Basic CAN principle and fully meets all constraints specified in the CAN Specification 2.0B (Active) standard.

The CAN protocol utilizes a multi-master bus architecture to transmit frames (communication objects) between network nodes. It also handles error management independently, without imposing any additional load on the CPU. The CAN-CTRL bus controller allows users to establish cost-effective and reliable connections between various system components. To control the transmission or reception of frames, a CPU accesses the CAN-CTRL core, which then communicates via a two-wire CAN bus system.

The RTOS includes a CAN driver and a corresponding test program which are located at:
  • rtthread/bsp/starfive/libraries/driver/drv_can.c

  • rtthread/bsp/starfive/libraries/hal/can/

  • rtthread/bsp/starfive/jh7110/applications/can_test.c

As the VF2 board does not have a CAN device transceiver, the test program must be run on the DevKit's board.

The following figure illustrates how a USB-CAN device is connected to CANO on the DevKit's board.

Figure 1. CAN Test Setup

Running GCAN Tools on PC to send data frame via the CAN bus:

Figure 2. GCAN Tools
Figure 3. CAN Test Case