Jump to: navigation, search

There is the GRCAN and OCCAN libs.

  • GRCAN is the device driver lib for LEON2 CAN controller (RASTA
  • OCCAN is for LEON3/LEON4 CAN Open cores (GR712, GR740).

The NGMP or N2X does not have a CAN bus.

GR712RC Board Issues with CANBUS¶

It could possibly be that the CAN bus multiplexer is not properly configured. It disabled CAN bus A and B by default. Bus A and bus B can be enabled in GRMON before starting the application:

Configure OC-CAN1 on CAN bus A and OC-CAN2 on CAN bus B

    wmem 0x80000500 3

There is also an RTEMS driver named "canmux" for the CAN bus multiplexor. The multiplexer is programmed by opening the file "/dev/canmux" and requestiong an IOCTL. An example of this is provided in the RTEMS example gr712/rtems-satcan.c.

SpaceWire 2 must be disabled (clock gated) for the shared GR712RC outputs to be assigned to CAN. The following GRMON commands can be used to setup the clock gating:

Disable all peripheral clocks except for OCCAN.

    grcg disable all
    grcg enable 7

If this does not work, maybe you could take a photo of the GR712RC board switch matrix so we can verify the connections.

CANBUS on configuration on leon boards

In the device driver implementation all management control commands are done directly on the CAN HW controlller via IOCLT. The Management commands are following:

  • STOP
  • SET_FILTER (set an acceptance filter)
  • SET_LINK (set the physical link)
  • SET_SPEED_AUTO (this one is weird… the implementation is avalable buy not used=
  • SET_BTRS (set speed via timing bit rate)

The overall management concerning timing of reading/writing is controlled by semaphores, the driver is just writing/reading data packet to/from a FIFO and locking/blocking semaphores. So, in the specific case of setting retransmission there is no functionality, in fact the it seem to be HW that does support use behaviour is hard-coded and not studied.