Difference between revisions of "Xenomai RTCAN"

From wiki.emacinc.com
Jump to: navigation, search
Line 26: Line 26:
 
If the standard Linux CAN driver is built as a module, the module can just be unloaded using rmmod.
 
If the standard Linux CAN driver is built as a module, the module can just be unloaded using rmmod.
 
<syntaxhighlight lang="console">
 
<syntaxhighlight lang="console">
root@somimx6-xenomai:/usr/demo# lsmodModule                 Size  Used by
+
root@somimx6-xenomai:~# lsmod
 +
Module                 Size  Used by
 
can_raw                6668  0  
 
can_raw                6668  0  
 
can                    28850  1 can_raw
 
can                    28850  1 can_raw
Line 34: Line 35:
 
flexcan                9971  0  
 
flexcan                9971  0  
 
can_dev                11309  1 flexcan
 
can_dev                11309  1 flexcan
 +
root@somimx6-xenomai:~# rmmod flexcan
 +
</syntaxhighlight>
  
 
+
Once the standard Linux CAN driver is unloaded the Xenomai real-time CAN driver can be loaded.
root@somimx6-xenomai:~# rmmod flexcan
+
<syntaxhighlight lang="console">
 +
root@somimx6-xenomai:~# modprobe xeno_can_flexcan
 +
[  662.498586] RT-Socket-CAN 0.90.2 - (C) 2006 RT-Socket-CAN Development Team
 +
[  662.509318] 2090000.flexcan supply xceiver not found, using dummy regulator
 +
[  662.516398] rtcan: registered rtcan0
 +
[  662.520047] flexcan 2090000.flexcan: RTCAN device registered (reg_base=c0c70000, irq=142, clock=30000000)
 +
[  662.529809] 2094000.flexcan supply xceiver not found, using dummy regulator
 +
[  662.536881] rtcan: registered rtcan1
 +
[  662.540504] flexcan 2094000.flexcan: RTCAN device registered (reg_base=c0c78000, irq=143, clock=30000000)
  
  
 
</syntaxhighlight>
 
</syntaxhighlight>
 
+
 +
=== Configuring CAN interface ===
 +
<syntaxhighlight lang="console">
 +
</syntaxhighlight>
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*****************************************      Examples        *****************************************/ -->
 
<!-- /*****************************************      Examples        *****************************************/ -->

Revision as of 16:41, 4 March 2016

TODO: {{#todo: NotStarted (03.03.2016-13:04->MW+)|Michael Welling|OE 5.0,MW,NotStarted}}

General Information

Xenomai provides a RTDM profile for CAN device drivers enabling real-time CAN communication. The driver exposes a real-time interface similar to the standard SocketCAN interface. Xenomai provides several user-space tools to enable simple interface testing. The following sections will provide the information needed to load the CAN driver, configure the interface, and communicate using the command line utilities provided with Xenomai.

Xenomai RTCAN

Loading the driver

If a Linux driver has already been associated with the CAN interfaces it is required to unload the standard Linux driver or unbind that device for the driver.

If the standard Linux CAN driver is built as a module, the module can just be unloaded using rmmod.

root@somimx6-xenomai:~# lsmod
Module                  Size  Used by
can_raw                 6668  0 
can                    28850  1 can_raw
rt_fec                 14450  0 
rtnet                  51349  1 rt_fec
fec                    37316  0 
flexcan                 9971  0 
can_dev                11309  1 flexcan
root@somimx6-xenomai:~# rmmod flexcan

Once the standard Linux CAN driver is unloaded the Xenomai real-time CAN driver can be loaded.

root@somimx6-xenomai:~# modprobe xeno_can_flexcan
[  662.498586] RT-Socket-CAN 0.90.2 - (C) 2006 RT-Socket-CAN Development Team
[  662.509318] 2090000.flexcan supply xceiver not found, using dummy regulator
[  662.516398] rtcan: registered rtcan0
[  662.520047] flexcan 2090000.flexcan: RTCAN device registered (reg_base=c0c70000, irq=142, clock=30000000)
[  662.529809] 2094000.flexcan supply xceiver not found, using dummy regulator
[  662.536881] rtcan: registered rtcan1
[  662.540504] flexcan 2094000.flexcan: RTCAN device registered (reg_base=c0c78000, irq=143, clock=30000000)

Configuring CAN interface

Examples

Further Information

Where to Go Next