wiki:TBR/UserManual/Quick_Start

Version 16 (modified by C Rempel, on Dec 3, 2012 at 4:01:04 AM) (diff)

Quick Start

This page is intended to be a very quick overview of installing an RTEMS Development Environment on a host for which prebuilt tools? are available and and building RTEMS for a sample BSP. While this guide will be enough to get you started, it makes no attempt to detail every configuration option, CPU and BSP supported, or how to download and run on an arbitrary BSP.

  • Download and install tools. For some hosts, prebuilt tools? are available. If they are not then you may need to build tools from source?. 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.
  • If you chose Git, then make sure you installed the RTEMS autoconf and automake RPMs. Then run bootstrap 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 ?{{ref|abc}} )

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.


{{note|abc}}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