Setting up an RTEMS development environment for the Raspberry Pi
For this tutorial, I’m going to use Ubuntu 12.10 64 bit (updated to 14.10 LTS on April 2014). It is possible to do RTEMS development on almost any recent version of Linux, OS X, FreeBSD, and Windows. The RTEMS project provides pre-built compilers for all RTEMS architectures for a number of different development hosts including Fedora, CentOS, Suse, and Windows.
In addition to the pre-built compilers provided, there is a tool called RTEMS Source Builder that can download, patch, build, and install the compiler for you. This is what we will use for our Ubuntu setup.
|
Install Ubuntu prerequisites:
|
Decide where the RTEMS tools and projects will reside
Here is the directory structure we will be using:
Path | Description |
---|---|
$HOME/development/rtems | The base directory for all RTEMS work |
$HOME/development/rtems/compiler | Where the compiler is installed |
$HOME/development/rtems/rtems-git | Where the RTEMS source code is checked out |
$HOME/development/rtems/bsps | Where the RTEMS board support packages/libs are installed |
$HOME/development/rtems/rtems-source-builder | The RTEMS source builder tool |
Table 1. Directory Structure
Lets get started on this:
|
Build the RTEMS ARM cross compiler
The RTEMS Source builder documentation is located here:
http://www.rtems.org/ftp/pub/rtems/people/chrisj/source-builder/source-builder.html
1. Check out the RTEMS source builder tool
|
2. Double check that all source builder dependencies are present:
|
This command should return the following:
|
The separate autotools build is no longer needed. The source builder will install them for you. |
3. Build and install the toolchain
|
After the full download and build process, the toolchain is installed in:
$HOME/development/rtems/compiler/4.11
This whole process can take about 10 to 30 minutes depending on your computer specs. This has been run on a Raspberry Pi: Expect that to take all day! |
4. Add the toolchain bin directory to your path, and you are ready to download and build RTEMS:
|
Using your favorite editor, edit the .profile file and add the following line at the end of the file
|
5. Now, logout and log back in. Open a terminal and type:
|
You should see the compiler version message. The compiler is installed and ready to use!
文章转自:http://alanstechnotes.blogspot.com/2013/03/setting-up-rtems-development.html