Difference between revisions of "CAN"

From TASTE
Jump to: navigation, search
(Created page with " 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...")
 
 
Line 15: Line 15:
 
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:
 
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:
  
1.Configure OC-CAN1 on CAN bus A and OC-CAN2 on CAN bus B
+
Configure OC-CAN1 on CAN bus A and OC-CAN2 on CAN bus B
 
     wmem 0x80000500 3
 
     wmem 0x80000500 3
  
Line 22: Line 22:
  
 
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:
 
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:
1.Disable all peripheral clocks except for OCCAN.
+
 
 +
Disable all peripheral clocks except for OCCAN.
 
     grcg disable all
 
     grcg disable all
 
     grcg enable 7
 
     grcg enable 7
Line 44: Line 45:
 
* SET_SPEED_AUTO (this one is weird… the implementation is avalable buy not used=
 
* SET_SPEED_AUTO (this one is weird… the implementation is avalable buy not used=
 
* SET_BTRS (set speed via timing bit rate)
 
* SET_BTRS (set speed via timing bit rate)
*set_SPEED
+
* SET_SPEED
  
 
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.
 
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.
 
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.

Latest revision as of 16:07, 15 November 2017


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:

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

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.