1.12 RTEMS Operating System
2012-02-20Publicerad av Sven-Åke Andersson
The Real-Time Executive for Multiprocessor Systems or RTEMS is a full featured RTOS that supports a variety of open API and interface standards. It work well on a wide range of embedded targets using cross development from a variety of hosts including GNU/Linux, MS-Windows, FreeBSD, Mingw, Cygwin, and Solaris.
LEON32 RTEMS Cross Compilation System (RCC)
We will start by downloading the cross compiler system (RCC) for LEON3. RCC allows cross-compilation of RTEMS C/C++ applications for LEON4, LEON3, LEON2 and ERC32. Using the gdb debugger, it is possible to perform source-level symbolic debugging, either on the TSIM simulator or using real target hardware.
First we will download and study the RCC-1-2-0 Users's Manual. Then we click the Download link and choose bin and linux and download: sparc-rtems-4.10-gcc-4.4.6-1.2.0-linux.tar.bz2
Installation of RCC
The RCC directory tree is compiled to reside in the /opt/rtems-4.10 directory on all platforms. After obtaining the bzipped tarfile with the binary distribution, uncompress and untar it in a suitable location - if this is not /opt/ rtems-4.10 then a link have to be created to point to the location of the RCC directory. The distribution can be installed with the following commands:
sudo cp ...../sparc-rtems-4.10-gcc-4.4.6-1.2.0-linux.tar.bz2 .
sudo bunzip2 sparc-rtems-4.10-gcc-4.4.6-1.2.0-linux.tar.bz2
sudo tar xfv sparc-rtems-4.10-gcc-4.4.6-1.2.0-linux.tar
Here is the result:
After the compiler is installed add the path: /opt/rtems-4.10/bin to your PATH variable in the .profile file.
Compilation and debugging of applications is typically done in the following steps:
- Compile and link program with gcc
- Debug program using a simulator (gdb connected to TSIM/GRSIM)
- Debug program on remote target (gdb connected to GRMON)
- Create boot-prom for a standalone application with mkprom2
Compiling a RTEMS application
To compile and link an RTEMS application, use ‘sparc-rtems-gcc’: sparc-rtems-gcc -g -O2 PrimeNumbers.c -o PrimeNumbers
RCC creates executables for LEON3/4 by default. The default load address is start of RAM: 0x40000000 for LEON2/3/4
Use GRMON to load and run the program.