Quick Start

From RTEMSWiki
Jump to: navigation, search

This page is intended to be a very quick overview of installing an RTEMS Development Environment on your host. An RTEMS Development Environment consists of the tools, ie the C/C++ compiler and debugger, and an RTEMS kernel for the Board Support Package (BSP) you are interested in. If you are new to RTEMS and interested seeing how it works and want to playing we suggest the SPARC simulator SIS BSP. It is easy to set up and use and requires no knowledge of the SPARC CPU. This guide will be enough to get you started and it makes no attempt to detail every configuration option, CPU and BSP supported, or how to download and run on an arbitrary BSP.

  • Installing the Tools. You can get the tools from RTEMS Source Builder (RSB) and for selected hosts there are prebuilt tools are available. Select the sparc CPU toolset since that is the sample BSP we will be building. Don't worry, you can easily remove the tools later if you decide you don't want a simulator environment to play with.
  • Download RTEMS. Use either a release image or checkout from Git. Either way, make sure you get the right toolset for your RTEMS version. The RSB will help you here.
  • If you chose Git, then make sure you installed an RTEMS autoconf and automake. Then run bootstrap script from the top level of the RTEMS source tree. It may take a few minutes to complete.
  • RTEMS is designed to be compiled outside the source tree. Assuming you used the 4.11 head, you would need to do something like the following to configure and compile RTEMS. Be sure to watch versions and install points:
cd rtems
export PATH=/opt/rtems-4.11/bin:$PATH
./bootstrap
cd ..
mkdir b-sis
cd b-sis
../rtems/configure --target=sparc-rtems4.11 --enable-rtemsbsp=sis \
  --enable-tests=samples --disable-posix
make
sudo PATH=/opt/rtems-4.11/bin:${PATH} make install

WARNING: It is absolutely critical that the target name provided to the RTEMS configure command be that same as that used to build binutils, gcc, newlib, and gdb. The binaries provided by the RTEMS Project will use a target name of the form CPU-rtemsVERSION where CPU is sparc in the above example and VERSION is 4.11.

( Getting a "C compiler cannot create executables" error ?[1] )

When this completes, you should have a few sample test executables in the build tree. This shows how to run the ticker.exe example in gdb:

bash-3.1$ sparc-rtems4.11-gdb `find . -name ticker.exe`
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu --target=sparc-rtems4.9"...
GDB can't read core files on this machine.
(gdb) tar sim
Connected to the simulator.
(gdb) load
(gdb) r
Starting program: /home2/work/joel/rtems-4.11-work/build/build-sparc-sis-rtems/sparc-rtems4.11/c/sis/testsuites/samples/ticker/ticker.exe


*** CLOCK TICK TEST ***
TA1  - rtems_clock_get - 09:00:00   12/31/1988
TA2  - rtems_clock_get - 09:00:00   12/31/1988
TA3  - rtems_clock_get - 09:00:00   12/31/1988
TA1  - rtems_clock_get - 09:00:05   12/31/1988
TA2  - rtems_clock_get - 09:00:10   12/31/1988
TA1  - rtems_clock_get - 09:00:10   12/31/1988
TA3  - rtems_clock_get - 09:00:15   12/31/1988
TA1  - rtems_clock_get - 09:00:15   12/31/1988
TA2  - rtems_clock_get - 09:00:20   12/31/1988
TA1  - rtems_clock_get - 09:00:20   12/31/1988
TA1  - rtems_clock_get - 09:00:25   12/31/1988
TA3  - rtems_clock_get - 09:00:30   12/31/1988
TA1  - rtems_clock_get - 09:00:30   12/31/1988
TA2  - rtems_clock_get - 09:00:30   12/31/1988
*** END OF CLOCK TICK TEST ***

Program exited normally.
(gdb) quit
bash-3.1$

If you don't want to debug the application, then use sparc-rtems4.11-run in the above example.


^ If you experience a "C compiler cannot create executables" error, try fixing your compiler by getting libc-dev:

apt-get install libc-dev

This has happened on Debian and Debian-based (like Ubuntu) systems.

Example Application Compiling

There are example applications in RTEMS GIT Repository. Example Application Compiling provides the steps to compile them.

Example Library Compiling

Below is a link to how to build libraries for use with more complex packages

http://www.rtems.org/wiki/index.php/RTEMS_Add-On_Packages

Where to get RTEMS Application Makefile documentation

Additional RTEMS Application Makefile documentation can be found in /opt/rtems-4.11/share/rtems-4.11/make/README

Personal tools
Namespaces

Variants
Actions
Navigation
Gedare's Special Help
Toolbox