Difference between revisions of "IMote2 Compiler"

From TinyOS Wiki
Jump to: navigation, search
(New page: This article assumes that you already have tinyos-2.x installed on your system. Go to http://www.tinyos.net/tinyos-2.x/doc/html/install-tinyos.html for install instructions. Do not install...)
 
Line 3: Line 3:
 
== Installing xscale-elf toolchain with Debian packages ==
 
== Installing xscale-elf toolchain with Debian packages ==
  
Download the following package files (not yet hosted):
+
=== Download packages ===
 +
 
 +
Download the following package files (hosting not available as of yet):
  
 
'''xscale-elf-binutils-2.15-2.i386.deb'''
 
'''xscale-elf-binutils-2.15-2.i386.deb'''
Line 11: Line 13:
 
'''xscale-elf-newlib-1.13.0-1.i386.deb'''
 
'''xscale-elf-newlib-1.13.0-1.i386.deb'''
  
Install the packages:
+
=== Install the packages ===
  
 
<pre>$ dpkg --install xscale-elf-binutils-2.15-2.i386.deb
 
<pre>$ dpkg --install xscale-elf-binutils-2.15-2.i386.deb
Line 29: Line 31:
  
 
The xscale-elf rpms on the Tinyos-2.x install page contain a version of newlib that does not work on debian linux. This section relies on instructions from the Harvard imote2 install page: [http://www.eecs.harvard.edu/~konrad/projects/imote2Camera/IMote2-Installation-Instructions.html]
 
The xscale-elf rpms on the Tinyos-2.x install page contain a version of newlib that does not work on debian linux. This section relies on instructions from the Harvard imote2 install page: [http://www.eecs.harvard.edu/~konrad/projects/imote2Camera/IMote2-Installation-Instructions.html]
 +
 +
=== Download source ===
  
 
To compile a working xscale-elf toolchain on debian from source, you will need to download the following source distributions:
 
To compile a working xscale-elf toolchain on debian from source, you will need to download the following source distributions:
Line 38: Line 42:
 
[ftp://sources.redhat.com/pub/newlib/newlib-1.13.0.tar.gz newlib 1.13]
 
[ftp://sources.redhat.com/pub/newlib/newlib-1.13.0.tar.gz newlib 1.13]
  
Define environment variables (can be removed after the installation):
+
=== Define environment variables ===
 +
 
 +
These can be removed after the installation.
  
 
<pre>export TARGET=xscale-elf
 
<pre>export TARGET=xscale-elf
Line 47: Line 53:
 
<pre>export PATH=${PREFIX}/bin:${PATH}</pre>
 
<pre>export PATH=${PREFIX}/bin:${PATH}</pre>
  
Build binutils:
+
=== Build binutils ===
  
 
<pre>$ tar xzf xscale-elf-binutils-2.15.tgz
 
<pre>$ tar xzf xscale-elf-binutils-2.15.tgz
Line 55: Line 61:
 
$ make all install</pre>
 
$ make all install</pre>
  
Build bootstrap compiler:
+
=== Build bootstrap compiler ===
  
 
<pre>tar xzf xscale-elf-gcc-3.4.3.tgz
 
<pre>tar xzf xscale-elf-gcc-3.4.3.tgz
Line 65: Line 71:
 
$ make all-gcc install-gcc</pre>
 
$ make all-gcc install-gcc</pre>
  
Build newlib:
+
=== Build newlib ===
  
 
<pre>$ tar xzf newlib-1.13.0.tar.gz
 
<pre>$ tar xzf newlib-1.13.0.tar.gz
Line 73: Line 79:
 
$ make all install</pre>
 
$ make all install</pre>
  
Rebuild gcc:
+
=== Rebuild gcc ===
  
 
<pre>$ cd xscale-elf-gcc-3.4.3
 
<pre>$ cd xscale-elf-gcc-3.4.3
Line 81: Line 87:
 
   --with-gnu-as --with-gnu-ld --enable-languages=c
 
   --with-gnu-as --with-gnu-ld --enable-languages=c
 
$ make all install</pre>
 
$ make all install</pre>
 +
 +
=== Verification ===
  
 
You should now be able to compile Blink:
 
You should now be able to compile Blink:
Line 89: Line 97:
 
You should see an executable output.
 
You should see an executable output.
  
[[User:Ifreeman|Ifreeman]]
+
 
 +
--[[User:Ifreeman|Ian Freeman]]

Revision as of 11:02, 20 May 2008

This article assumes that you already have tinyos-2.x installed on your system. Go to http://www.tinyos.net/tinyos-2.x/doc/html/install-tinyos.html for install instructions. Do not install the xscale tools from that page (step 3 can be skipped).

Installing xscale-elf toolchain with Debian packages

Download packages

Download the following package files (hosting not available as of yet):

xscale-elf-binutils-2.15-2.i386.deb

xscale-elf-gcc-3.4.3-2.i386.deb

xscale-elf-newlib-1.13.0-1.i386.deb

Install the packages

$ dpkg --install xscale-elf-binutils-2.15-2.i386.deb
$ dpkg --install xscale-elf-gcc-3.4.3-2.i386.deb
$ dpkg --install xscale-elf-newlib-1.13.0-1.i386.deb

That's it. Run make on Blink (or other code) to see if it works:

$ cd $TOSROOT/apps/Blink
$ make intelmote2

You should see an executable output.

Installing xscale-elf toolchain from source

If you can install debin packages and do no need the source, this section is not for you. Scroll up and install the packages.

The xscale-elf rpms on the Tinyos-2.x install page contain a version of newlib that does not work on debian linux. This section relies on instructions from the Harvard imote2 install page: [1]

Download source

To compile a working xscale-elf toolchain on debian from source, you will need to download the following source distributions:

xscale-elf-binutils 2.15

xscale-elf-gcc 3.4.3

newlib 1.13

Define environment variables

These can be removed after the installation.

export TARGET=xscale-elf
export PREFIX=/usr

If you don't already have the bin subdir of the directory specified by PREFIX added to your PATH, add it now:

export PATH=${PREFIX}/bin:${PATH}

Build binutils

$ tar xzf xscale-elf-binutils-2.15.tgz
$ cd xscale-elf-binutils-2.15
$ mkdir build; cd build
$ ../configure --target=$TARGET --prefix=$PREFIX
$ make all install

Build bootstrap compiler

tar xzf xscale-elf-gcc-3.4.3.tgz
$ cd xscale-elf-gcc-3.4.3
$ mkdir build; cd build
$ ../configure --target=$TARGET --prefix=$PREFIX \
   --with-newlib --without-headers --with-gnu-as \
   --with-gnu-ld --disable-shared --enable-languages=c
$ make all-gcc install-gcc

Build newlib

$ tar xzf newlib-1.13.0.tar.gz
$ cd newlib-1.13.0
$ mkdir build; cd build
$ ../configure --target=$TARGET --prefix=$PREFIX
$ make all install

Rebuild gcc

$ cd xscale-elf-gcc-3.4.3
$ cd build
$ rm -rf *
$ ../configure --target=$TARGET --prefix=$PREFIX \
   --with-gnu-as --with-gnu-ld --enable-languages=c
$ make all install

Verification

You should now be able to compile Blink:

$ cd $TOSROOT/apps/Blink
$ make intelmote2

You should see an executable output.


--Ian Freeman