Difference between revisions of "Using Xenomai with the EMAC OE SDK"

From wiki.emacinc.com
Jump to: navigation, search
(Created page with "{{ subst:Pgtempl | initials={{subst::Templateimpl:getinitials}} | project=OE 5.0 | title=Using Xenomia with the EMAC OE SDK | desc=This page will cover how to use xenomai with...")
 
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{todo| NotStarted (10.06.2015-14:59->KY+)| Kyoungmeyer | project=OE 5.0,KY }}
+
{{todo| Complete (10.06.2015-14:59->KY+)(10.27.2015-14:05->MG+)(11.12.2015-15:00->MD+)|Klint Youngmeyer| project=OE 5.0,KY,MD,Complete }}
 
{{#seo:
 
{{#seo:
|title=Using Xenomia with the EMAC OE SDK
+
|title=Using Xenomai with the EMAC OE SDK
 
|titlemode=append
 
|titlemode=append
 
|keywords=
 
|keywords=
Line 10: Line 10:
 
<!-- /****************************************  Page Description Text  ****************************************/ -->
 
<!-- /****************************************  Page Description Text  ****************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
<span style="background:#00FF00;color:#FF0000;font-size:300%">'''''Put the page description text here.'''''</span>
+
This page provides a brief description on how to use the Xenomai real time operating system API with the EMAC OE SDK.
  
 
__TOC__
 
__TOC__
Line 17: Line 17:
 
<!-- /***************************************** Background Information ****************************************/ -->
 
<!-- /***************************************** Background Information ****************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
{{:Templateimpl:bg | initials=KY | title=Using Xenomia with the EMAC OE SDK | desc=This page will cover how to use xenomai with the EMAC OE SDK and how to use some examples. | project=OE 5.0 }}
+
{{:Templateimpl:bg | initials=KY | title=Using Xenomai with the EMAC OE SDK | desc=This page will cover how to use xenomai with the EMAC OE SDK and how to use some examples. | project=OE 5.0 }}
 
+
Xenomai is a real-time operating system (RTOS) API designed to work alongside Linux. It provides a means of migrating from a proprietary RTOS to a Linux based system. This also allows for native Linux applications to be run side-by-side with real-time applications on the same target
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*****************************************  General Information  *****************************************/ -->
 
<!-- /*****************************************  General Information  *****************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
{{:Templateimpl:geninfo | initials=KY | title=Using Xenomia with the EMAC OE SDK | desc=This page will cover how to use xenomai with the EMAC OE SDK and how to use some examples. | project=OE 5.0 }}
+
{{:Templateimpl:geninfo | initials=KY | title=Using Xenomai with the EMAC OE SDK | desc=This page will cover how to use xenomai with the EMAC OE SDK and how to use some examples. | project=OE 5.0 }}
 
+
By default, the EMAC SDK includes support for Xenomai. However, due to the hardware dependent nature of the real time API, a Xenomai enabled kernel is necessary.
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*****************************************  Using/Working With  ******************************************/ -->
 
<!-- /*****************************************  Using/Working With  ******************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
{{:Templateimpl:using | initials=KY | title=Using Xenomia with the EMAC OE SDK | desc=This page will cover how to use xenomai with the EMAC OE SDK and how to use some examples. | project=OE 5.0 }}
+
{{:Templateimpl:using | initials=KY | title=Using Xenomai with the EMAC OE SDK | desc=This page will cover how to use xenomai with the EMAC OE SDK and how to use some examples. | project=OE 5.0 }}
 +
For the purposes of this document, all examples will be using the CMake build system. These examples can be easily modified to be used on a traditional Makefile project or a Qt qmake project as well. For most Xenomai enabled projects, adding the following lines to the project's CMakeLists.txt file will be sufficient.
 +
<syntaxhighlight lang="cmake">
 +
project (example)
 +
 
 +
#######################################
 +
### Necessary additions for Xenomai ###
 +
#######################################
 +
set(XENO_BASE "${CMAKE_FIND_ROOT_PATH}/usr")
 +
 
 +
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -MMD -g")
 +
 
 +
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I${XENO_BASE}/include/xenomai/cobalt -I${XENO_BASE}/include/xenomai -D_GNU_SOURCE -D_REENTRANT -D__COBALT__ -I${XENO_BASE}/include/xenomai/alchemy")
 +
 
 +
set(CMAKE_EXE_LINKER_FLAGS "-lalchemy -lcopperplate ${XENO_BASE}/lib/xenomai/bootstrap.o -Wl,--wrap=main -Wl,--dynamic-list=${XENO_BASE}/lib/dynlist.ld -L${XENO_BASE}/lib -lcobalt -lpthread -lrt")
 +
 
 +
include_directories(${XENO_BASE}/include ${XENO_BASE}/include/cobalt)
  
 +
link_directories(${XENO_BASE}/lib)
 +
#######################################
 +
#######################################
 +
#######################################
 +
 +
 +
 +
add_executable(example example.c)
 +
 +
#######################################
 +
### Necessary additions for Xenomai ###
 +
#######################################
 +
add_definitions(-D_GNU_SOURCE -D_REENTRANT -D__XENO__ -DNO_GPL)
 +
 +
target_link_libraries(example pthread rt alchemy copperplate cobalt)
 +
#######################################
 +
#######################################
 +
 +
#######################################
 +
 +
</syntaxhighlight>
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*****************************************      Examples        *****************************************/ -->
 
<!-- /*****************************************      Examples        *****************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
{{:Templateimpl:examples | initials=KY | title=Using Xenomia with the EMAC OE SDK | desc=This page will cover how to use xenomai with the EMAC OE SDK and how to use some examples. | project=OE 5.0 }}
+
{{:Templateimpl:examples | initials=KY | title=Using Xenomai with the EMAC OE SDK | desc=This page will cover how to use xenomai with the EMAC OE SDK and how to use some examples. | project=OE 5.0 }}
 
+
To see how to build and use an actual example Xenomai project with the EMAC SDK, please see the [[Example_Xenomai_Timer | Xenomai Timer Example]] page. Additionally, Xenomai provides many example projects on their own [https://xenomai.org/documentation/xenomai-3/html/xeno3prm/examples.html documentation page].
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /******************************************    Conclusion      ******************************************/ -->
 
<!-- /******************************************    Conclusion      ******************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
{{:Templateimpl:conclusion | initials=KY | title=Using Xenomia with the EMAC OE SDK | desc=This page will cover how to use xenomai with the EMAC OE SDK and how to use some examples. | project=OE 5.0 }}
+
<!--{{:Templateimpl:conclusion | initials=KY | title=Using Xenomai with the EMAC OE SDK | desc=This page will cover how to use xenomai with the EMAC OE SDK and how to use some examples. | project=OE 5.0 }}-->
  
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /******************************************  More Information  *****************************************/ -->
 
<!-- /******************************************  More Information  *****************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
{{:Templateimpl:moreinfo | initials=KY | title=Using Xenomia with the EMAC OE SDK | desc=This page will cover how to use xenomai with the EMAC OE SDK and how to use some examples. | project=OE 5.0 }}
+
{{:Templateimpl:moreinfo | initials=KY | title=Using Xenomai with the EMAC OE SDK | desc=This page will cover how to use xenomai with the EMAC OE SDK and how to use some examples. | project=OE 5.0 }}
*  
+
*[[Xenomai]]
 +
*[[Installing_EMAC_OE_5.0_SDK | Install the EMAC SDK]]
  
{{:Templateimpl:whatnext | initials=KY | title=Using Xenomia with the EMAC OE SDK | desc=This page will cover how to use xenomai with the EMAC OE SDK and how to use some examples. | project=OE 5.0 }}
+
{{:Templateimpl:whatnext | initials=KY | title=Using Xenomai with the EMAC OE SDK | desc=This page will cover how to use xenomai with the EMAC OE SDK and how to use some examples. | project=OE 5.0 }}
*
+
*[[Example_Xenomai_Timer | Xenomai Timer Example]]
 +
*[[Getting_Started_with_the_EMAC_OE_SDK | Getting Started with the EMAC OE SDK]]

Latest revision as of 15:46, 13 July 2017

TODO: {{#todo: Complete (10.06.2015-14:59->KY+)(10.27.2015-14:05->MG+)(11.12.2015-15:00->MD+)|Klint Youngmeyer|OE 5.0,KY,MD,Complete}}

This page provides a brief description on how to use the Xenomai real time operating system API with the EMAC OE SDK.

Background

Xenomai is a real-time operating system (RTOS) API designed to work alongside Linux. It provides a means of migrating from a proprietary RTOS to a Linux based system. This also allows for native Linux applications to be run side-by-side with real-time applications on the same target

General Information

By default, the EMAC SDK includes support for Xenomai. However, due to the hardware dependent nature of the real time API, a Xenomai enabled kernel is necessary.

Using Xenomai with the EMAC OE SDK

For the purposes of this document, all examples will be using the CMake build system. These examples can be easily modified to be used on a traditional Makefile project or a Qt qmake project as well. For most Xenomai enabled projects, adding the following lines to the project's CMakeLists.txt file will be sufficient.

project (example)

#######################################
### Necessary additions for Xenomai ###
#######################################
set(XENO_BASE "${CMAKE_FIND_ROOT_PATH}/usr")

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -MMD -g")

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I${XENO_BASE}/include/xenomai/cobalt -I${XENO_BASE}/include/xenomai -D_GNU_SOURCE -D_REENTRANT -D__COBALT__ -I${XENO_BASE}/include/xenomai/alchemy")

set(CMAKE_EXE_LINKER_FLAGS "-lalchemy -lcopperplate ${XENO_BASE}/lib/xenomai/bootstrap.o -Wl,--wrap=main -Wl,--dynamic-list=${XENO_BASE}/lib/dynlist.ld -L${XENO_BASE}/lib -lcobalt -lpthread -lrt")

include_directories(${XENO_BASE}/include ${XENO_BASE}/include/cobalt)

link_directories(${XENO_BASE}/lib)
#######################################
#######################################
#######################################



add_executable(example example.c)

#######################################
### Necessary additions for Xenomai ###
#######################################
add_definitions(-D_GNU_SOURCE -D_REENTRANT -D__XENO__ -DNO_GPL)

target_link_libraries(example pthread rt alchemy copperplate cobalt)
#######################################
#######################################

#######################################

Examples

To see how to build and use an actual example Xenomai project with the EMAC SDK, please see the Xenomai Timer Example page. Additionally, Xenomai provides many example projects on their own documentation page.

Further Information

Where to Go Next
Pages with Related Content