Example Xenomai Timer
This is a guide to the
xenomai-timer C example project included in the EMAC OE SDK.
This project demonstrates how to build the real-time software timer.
timer project builds one executable:
Building and Running the Project Files
xenomai-timer C example project will run on an i586 system with a Xenomai real-time enabled kernel.
Building the Project
There are two options for building this example project: Qt Creator or CMake.
This process will show how to build the project using Qt Creator. For further information on using Qt Creator, please see Getting Started With Qt Creator.
- Open Qt Creator using the "EMAC IDE" button on the Ubuntu sidebar.
- Click the "Example" button on the left of the page. This will bring up a list of all included examples.
- Select the "Xenomai Timer" icon. The example wizard will now request the build directory for the project. It is not recommended to use the default location. The following is a reasonable location on an EMAC LDC.
- The next window will prompt you to run CMake. Click the "Run CMake" button.
- Click "Finish" (Note: This project may not build for the Desktop kit, unless the Xenomai libraries are installed for your host system.)
- Click the "Projects" icon in the left column, then click "Add Kit" and select "OE 5.x x86".
- The default build location is fine; click Next.
- Enter the following into the Arguments field, then click, "Run CMake."
- Click Finish.
- Ensure that the "OE 5.x x86" kit is selected by clicking the computer icon on the lower left, then click Build (the hammer icon).
- Add the target device to the Qt Creator devices by following the instructions on this page, starting at point 9.
- Click the Run button on the bottom left (green arrow).
This process will show how to build the project using CMake.
- Navigate to the Projects directory.
- Copy the xenomai-timer example to the current directory.
- Change directory to the project directory.
- Create the build directory for cross-compilation, then change directory into it.
- Run CMake.
- Build the project.
- Copy the executable to the target board. Substitute the IP address
10.0.2.41with the IP address of your target board.
- Open a terminal on the target board, using SSH, serial, or a dedicated screen and keyboard.
- Navigate to the /tmp directory.
- Run the program.
The program will continue running until it is manually halted with a CTRL-C.
timer C example project demonstrates how to use the xenomai timer.