Setting up an RTEMS development environment for the Raspberry Pi

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.

Note
  1. You will need a RTEMS compiler, an ARM bare metal GCC will not do.

  2. I have posted some instructions for setting up the environment for Windows 7 here

  3. The following instructions start with a fresh install of Ubuntu 14.10 LTS 64 bit, with all updates applied.

Install Ubuntu prerequisites:

$ sudo apt-get install build-essential
$ sudo apt-get install git
$ sudo apt-get install python-dev
$ sudo apt-get build-dep binutils gcc g++ gdb unzip git

Decide where the RTEMS tools and projects will reside

Here is the directory structure we will be using:

PathDescription

$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:

$ cd $HOME
$ mkdir development
$ cd development
$ mkdir rtems
$ cd rtems
$ mkdir compiler

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

$ cd $HOME/development/rtems
$ git clone git://git.rtems.org/chrisj/rtems-source-builder.git

2. Double check that all source builder dependencies are present:

$ cd rtems-source-builder
$ source-builder/sb-check

This command should return the following:

RTEMS Source Builder environment is OK
Note The separate autotools build is no longer needed. The source builder will install them for you.

3. Build and install the toolchain

$ cd $HOME/development/rtems/rtems-source-builder/rtems
$ ../source-builder/sb-set-builder \
         --log=build-log.txt \
         --prefix=$HOME/development/rtems/compiler/4.11 \
          4.11/rtems-arm

After the full download and build process, the toolchain is installed in:
$HOME/development/rtems/compiler/4.11

Tip 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:

$ cd $HOME

Using your favorite editor, edit the .profile file and add the following line at the end of the file

PATH=$HOME/development/rtems/compiler/4.11/bin:$PATH

5. Now, logout and log back in. Open a terminal and type:

$ arm-rtems4.11-gcc -v

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值