RTEMS for Embedded Software Developers/Getting Started

From Wikibooks, open books for an open world
< RTEMS for Embedded Software Developers
Jump to navigation Jump to search

RTEMS uses a patched version on the Gnu tools to compile RTEMS. This chapter will cover:

  1. building the RTEMS Toolset
  2. building/using a bootloader
  3. configuring RTEMS
  4. RTEMS Eclipse Plug-in
  5. using RTEMS on a hardware emulator
  6. using RTEMS on hardware

RTEMS Toolset[edit | edit source]

Although there are pre-built tools that can be installed on some platforms, some developers may desire to install the RTEMS toolset on a different platform, or install a more recent or more mature version of the RTEMS toolset on their machine.

RTEMS applications are designed to run on a different operating system (RTEMS as opposed to Windows, Mac, or Linux) and different hardware than the system the development is done on (such as Sparc, Arm or m68k as opposed to an x86-64). The tool set is a specially patched and configured version of binutils, newlib, and gcc. As this is a text book, this material will be presented in a lengthy explanatory fashion—the how-to can be found on the RTEMS website.

First, the platform must support patching code, writing configure scripts from configure.ac meta-scripts, generating Makefiles from Makefile.ams, and compiling the cross-compiler. Different platforms require different processes to achieve this goal. Ideally, this text will eventually include how to build the toolset on Windows, Mac, and Linux.

Getting the RTEMS Toolset[edit | edit source]

To get the RTEMS Toolset follow the directions at http://www.rtems.org/wiki/index.php/RTEMS_Development_Hosts

More on this topic can be found at:

How to build the tools from scratch http://www.rtems.org/wiki/index.php/Building_the_RTEMS_toolset_on_Ubuntu

Ideas for a Windows Installer: Using NSIS: see rtems/contrib/mingw at http://git.rtems.org/rtems/tree/contrib/mingw

Building RTEMS[edit | edit source]

RTEMS has the following switches:

  1. list and describe them

RTEMS can be built for multiple architectures simultaneously. For our m68k example, we select the Coldfire architectures (because that is the m68k architecture that QEMU emulates), and the sim68000 (because that's what the RTEMS-GDB runs).

../rtems/configure --target=m68k-rtems4.11 --enable-tests=samples --enable-rtemsbsps=all
gmake RTEMS_BSP="av5282 uC5282"
gmake CC=/opt/rtems-4.11/bin/m68k-rtems4.11-gcc install

building/using a bootloader[edit | edit source]

This is a stub. The reason for covering the bootloader is to inform new developers how to get their code to run on a board without binary modification. Need a table of hardware RTEMS has been ported to and bootloaders that work with them. Possible reference:


Some references for bootloaders for different architectures can be found in the Debian installer manual


This subsection covers:

GRUB[edit | edit source]

Micro Monitor[edit | edit source]

A boot loader for a variety of hardware...

Reference material: http://www.rtems.org/wiki/index.php/MicroMonitor


SILO[edit | edit source]

U-Boot[edit | edit source]

Insert information about the Universal Bootloader (U-Boot).

Building U-Boot[edit | edit source]

To compile U-Boot from the source, the typical steps are taken are similar to free-electrons.com/doc/u-boot.pdf:

  1. Look in boards.config for the correct configuration
  2. Configure U-Boot for the board using gmake eb_cpu5282_config
  3. Build U-Boot for the board using gmake CROSS_COMPILE=m68k-rtems4.11-

other bootloaders needed for hardware architectures RTEMS runs on[edit | edit source]

A reference for filling out this section is: http://www.rtems.com/wiki/index.php/Building_Grub and http://www.rtems.org/wiki/index.php/QEMU

(Documentation will have to be written and posted on another web page first, and cited, so as not to put original work on Wikibooks) For demonstration purposes, the coldfire-m68k example may use u-boot. http://git.denx.de/?p=u-boot/u-boot-coldfire.git

RTEMS Eclipse Plug-In[edit | edit source]

This is a stub. The reason for covering the RTEMS Eclipse Plug-In is to ensure material in the book is forward-looking. Other RTOSs use integrated development environments, and new RTEMS developers may find using Eclipse increases their productivity. For filling out this section reference:

http://www.rtems.org/wiki/index.php/RTEMS_Eclipse_Plug-in .

http://www.rtems.org/wiki/index.php/RTEMS_Eclipse_Information .

http://www.fogel.ca/2008/10/02/getting-eclipse-and-java-working-on-debian/ .


Using RTEMS on a Hardware Emulator[edit | edit source]

Building QEMU[edit | edit source]

Qemu uses the zlib compression library, and the sdl library, which must be installed before building QEMU. To build QEMU This is a stub. Reference to draw ideas from for why Qemu:


The reason for covering a hardware emulator is because some RTEMS developers lack continual access to actual hardware. For filling out this section reference: http://www.rtems.org/wiki/index.php/QEMU (If possible, running Qemu out of eclipse should be documented elsewhere, such as the RTEMS wiki, and cited, so as not to put original work on Wikibooks, and included in this section)

1. Getting Qemu to run from Eclipse http://www.codeconfidence.com/technote-0002.shtml

2. Getting GDB and DDD to run from Eclipse

Walk reader through using DDD to debug RTEMS.

Example for using DDD to debug a native C program


Slideshow of how to debug Uboot on Qemu using GDB on the command line


Post explaining how to run U-boot as a stand-alone on QEMU http://old.nabble.com/can-u-boot-run-standalone-in-qemu%28qemu-system-arm%29-without-kernel-image%28for-mainstone-II%29-td17534853.html

How to get Eclipse to build uboot and launch a debug session... http://www.at91.com/forum/viewtopic.php/t%2c20216/

Using RTEMS on Hardware[edit | edit source]

This is a stub. Ideally loading executables on at least two board support packages should be covered. Again, documenting IDE support will be an end-goal.

Reference for getting RTEMS to work on LEON3 using Xilinx. http://www.rte.se/blog/blogg-modesty-corex/index