<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Setup</title><link>https://sourceforge.net/p/avr-ada/wiki/Setup/</link><description>Recent changes to Setup</description><atom:link href="https://sourceforge.net/p/avr-ada/wiki/Setup/feed" rel="self"/><language>en</language><lastBuildDate>Sun, 12 Aug 2012 13:20:04 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/avr-ada/wiki/Setup/feed" rel="self" type="application/rss+xml"/><item><title>WikiPage Setup modified by Rolf Ebert</title><link>https://sourceforge.net/p/avr-ada/wiki/Setup/</link><description>&lt;pre&gt;--- v2
+++ v3
@@ -1,12 +1,12 @@
 #How to build and install AVR-Ada#
 
-This tutorial explains step by step how to install AVR-Ada on a Linux system. This tutorial was tested on a 64 Bit Ubuntu 9.10 system.  The steps for building AVR-Ada on a Windows system are essentially the same.  The prerequisits are more demanding as you need MSYS, MinGW, Cygwin, and WinAVR.  See [BuildScript] for further details.
+This tutorial explains step by step how to install AVR-Ada on a Linux system. This tutorial was tested on a 64 Bit Ubuntu 9.10 system.  The steps for building AVR-Ada on a Windows system are essentially the same.  The prerequisits are more demanding as you need MSYS, MinGW, Cygwin, the Atmel Toolsuite (as part of the Atmel Studio) and gprconfig and gprbuild (provided by Adacore's GNAT).  See [BuildScript] for further details.
 
 ##Preparations##
 
 For building the AVR-Ada cross compiler you have to download the following packages:
 
-    binutils-2.10.1.tar.bz2
+    binutils-2.20.1.tar.bz2
     gcc-4.7.1.tar.bz2
     avr-libc-1.8.0.tar.bz2
     avr-ada-1.2.0.tar.bz2
@@ -26,13 +26,13 @@
     tar xvfj binutils-2.20.1.tar.bz2
     tar xvfj avr-ada-1.2.0p.tar.bz2
 
-This will create the binutils-2.19 and avr-ada-1.0.3 directories.
+This will create the binutils-2.20.1 and avr-ada-1.2.0 directories.
 
 First you have to apply the AVR-Ada patches to the Binutils:
 
-    cd binutils-2.19
-    patch --verbose --strip=0 --input=../avr-ada-1.0.3/patches/binutils/2.19/10-binutils-2.19-sprintf-format.patch
-    patch --verbose --strip=0 --input=../avr-ada-1.0.3/patches/binutils/2.19/50-binutils-2.19-xmega-autoconf.patch
+    cd binutils-2.20.1
+    patch --verbose --strip=0 --input=../avr-ada-1.2.0/patches/binutils/2.20.1/10-binutils-2.19-sprintf-format.patch
+    patch --verbose --strip=0 --input=../avr-ada-1.2.0/patches/binutils/2.20.1/50-binutils-2.19-xmega-autoconf.patch
 
 Now run the configure script:
 
@@ -57,14 +57,14 @@
 
 Go back to your working directory and extract the GCC Compiler package
 
-    tar xvfj gcc-4.3.2.tar.bz2
+    tar xvfj gcc-4.7.1.tar.bz2
 
-This will create the gcc-4.3.2 subdirectory.
+This will create the gcc-4.7.1 subdirectory.
 
 Apply the AVR-Ada patches to the GCC package:
 
-    cd gcc-4.3.2
-    patch --verbose --strip=0 --input=../avr-ada-1.0.3/patches/gcc/4.3.2/22-gcc-4.3.2-ada-xgnatugn.patch
+    cd gcc-4.7.1
+    patch --verbose --strip=0 --input=../avr-ada-1.2.0/patches/gcc/4.7.1/22-gcc-4.7-ada-xgnatugn.patch
     ...
 
 
@@ -88,7 +88,7 @@
 
 Go to your working directory and extract the AVR-Libc package
 
-tar xvfj avr-libc-1.6.7.tar.bz
+tar xvfj avr-libc-1.8.0.tar.bz
 
 For compiling the AVR-Libc you have to use the avr-gcc compiler. This is achieved by setting the CC environment variable
 
@@ -96,7 +96,7 @@
 
 Than you can configure, compile and install the AVR-Libc:
 
-    cd avr-libc-1.6.7
+    cd avr-libc-1.8.0
     ./configure --prefix=/opt/avr --build=`./config.guess` --host=avr
     make
     sudo make install
@@ -116,7 +116,7 @@
 
 According to the build scripts supplied with AVR-Ada under the directory avr-ada-1.1.0/tools/build/ the installation process should work this way:
 
-    cd avr-ada-1.1.0
+    cd avr-ada-1.2.0
     ./configure --prefix=/opt/avr
     make build_rts
     sudo make install_rts
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Rolf Ebert</dc:creator><pubDate>Sun, 12 Aug 2012 13:20:04 -0000</pubDate><guid>https://sourceforge.net17a75ce01a9c78601c8db6582f64fae3e4116f5b</guid></item><item><title>WikiPage Setup modified by Rolf Ebert</title><link>https://sourceforge.net/p/avr-ada/wiki/Setup/</link><description>&lt;pre&gt;--- v1
+++ v2
@@ -1,24 +1,21 @@
-##How to build and install AVR-Ada##
+#How to build and install AVR-Ada#
 
 This tutorial explains step by step how to install AVR-Ada on a Linux system. This tutorial was tested on a 64 Bit Ubuntu 9.10 system.  The steps for building AVR-Ada on a Windows system are essentially the same.  The prerequisits are more demanding as you need MSYS, MinGW, Cygwin, and WinAVR.  See [BuildScript] for further details.
 
 ##Preparations##
 
-For building AVR-Ada you have to download the following packages:
+For building the AVR-Ada cross compiler you have to download the following packages:
 
-binutils-2.19.tar.bz2
+    binutils-2.10.1.tar.bz2
+    gcc-4.7.1.tar.bz2
+    avr-libc-1.8.0.tar.bz2
+    avr-ada-1.2.0.tar.bz2
 
-gcc-4.3.2.tar.bz2
-
-avr-libc-1.6.7.tar.bz2
-
-avr-ada-1.1.0.tar.bz2
-
-For building a gcc Ada compiler you will need a working Ada compiler on your system because the Ada front-end of gcc is written in Ada. Therefore on an Ubuntu system you need to have the package gnat installed.
+For building an Ada compiler you will need a working Ada compiler on your system because the Ada front-end of gcc is written in Ada. Therefore on an Ubuntu and other Debian systems you need to have the package gnat installed. On Windows you have to build a native gcc including Ada support first. MinGW currently (Summer 2012) provides gcc-4.6 which does not work.
 
 Further check that you have the packages flex and bison installed.
 
-On Ubuntu and Debian systems the normal gcc is built without Ada support. The gcc with Ada support is called gnatgcc. Take care you are using a gcc with Ada support for building an Ada cross compiler. You can force using the gnatgcc by setting the CC environment variable.
+On Ubuntu and Debian systems the normal gcc is built without Ada support. The gcc with Ada support is called gnatgcc. Take care you are using a gcc with Ada support for building an Ada cross compiler. You can force using the gnatgcc by setting the CC environment variable. 
 
 export CC=gnatgcc
 
@@ -26,8 +23,8 @@
 
 Extract the binutils and the avr-ada packages into your working directory.
 
-    tar xvfj binutils-2.19.tar.bz2
-    tar xvfj avr-ada-1.0.3
+    tar xvfj binutils-2.20.1.tar.bz2
+    tar xvfj avr-ada-1.2.0p.tar.bz2
 
 This will create the binutils-2.19 and avr-ada-1.0.3 directories.
 
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Rolf Ebert</dc:creator><pubDate>Tue, 24 Jul 2012 22:05:56 -0000</pubDate><guid>https://sourceforge.net19a1f121247a7f933788935b16eeaca4caa93d25</guid></item><item><title>WikiPage Setup modified by Warren W. Gay VE3WWG</title><link>https://sourceforge.net/p/avr-ada/wiki/Setup/</link><description>##How to build and install AVR-Ada##

This tutorial explains step by step how to install AVR-Ada on a Linux system. This tutorial was tested on a 64 Bit Ubuntu 9.10 system.  The steps for building AVR-Ada on a Windows system are essentially the same.  The prerequisits are more demanding as you need MSYS, MinGW, Cygwin, and WinAVR.  See [BuildScript] for further details.

##Preparations##

For building AVR-Ada you have to download the following packages:

binutils-2.19.tar.bz2

gcc-4.3.2.tar.bz2

avr-libc-1.6.7.tar.bz2

avr-ada-1.1.0.tar.bz2

For building a gcc Ada compiler you will need a working Ada compiler on your system because the Ada front-end of gcc is written in Ada. Therefore on an Ubuntu system you need to have the package gnat installed.

Further check that you have the packages flex and bison installed.

On Ubuntu and Debian systems the normal gcc is built without Ada support. The gcc with Ada support is called gnatgcc. Take care you are using a gcc with Ada support for building an Ada cross compiler. You can force using the gnatgcc by setting the CC environment variable.

export CC=gnatgcc

##Compiling the AVR binutils##

Extract the binutils and the avr-ada packages into your working directory.

    tar xvfj binutils-2.19.tar.bz2
    tar xvfj avr-ada-1.0.3

This will create the binutils-2.19 and avr-ada-1.0.3 directories.

First you have to apply the AVR-Ada patches to the Binutils:

    cd binutils-2.19
    patch --verbose --strip=0 --input=../avr-ada-1.0.3/patches/binutils/2.19/10-binutils-2.19-sprintf-format.patch
    patch --verbose --strip=0 --input=../avr-ada-1.0.3/patches/binutils/2.19/50-binutils-2.19-xmega-autoconf.patch

Now run the configure script:

    ./configure --prefix=/opt/avr --target=avr

If you don't set the prefix option the default prefix will be /usr/local. So you will find the avr-as under /usr/local/bin/.  Ensure that you use the same prefix for all packages.

Than you can compile and install the whole package

    make
    sudo make install

This last step can be omitted if you have installed your AVR-Binutils into a standard path like /usr/local/bin. Otherwise you have to add the directory of the installation to your PATH environment variable.

    export PATH=$PATH:/opt/avr/bin

To permanently add this path to your PATH variable on an Ubuntu system you have to edit the file /etc/environment.

Now your AVR-Binutils are working.

##Compiling the AVR-GCC/Ada compiler##

Go back to your working directory and extract the GCC Compiler package

    tar xvfj gcc-4.3.2.tar.bz2

This will create the gcc-4.3.2 subdirectory.

Apply the AVR-Ada patches to the GCC package:

    cd gcc-4.3.2
    patch --verbose --strip=0 --input=../avr-ada-1.0.3/patches/gcc/4.3.2/22-gcc-4.3.2-ada-xgnatugn.patch
    ...


Now create a new directory build

    mkdir build
    cd build

Creating this build directory is very important because it is not possible to compile GCC within its root directory like most other projects. If you do so compiling will fail with strange error messages.

Now run the configure script:

    ../configure --prefix=/opt/avr --target=avr --enable-languages=c,c++,ada --with-dwarf2 --disable-nls --disable-libssp --disable-libada

Than you can compile and install the whole package

    make
    sudo make install

##Compiling the AVR-Libc##

Go to your working directory and extract the AVR-Libc package

tar xvfj avr-libc-1.6.7.tar.bz

For compiling the AVR-Libc you have to use the avr-gcc compiler. This is achieved by setting the CC environment variable

    export CC=avr-gcc

Than you can configure, compile and install the AVR-Libc:

    cd avr-libc-1.6.7
    ./configure --prefix=/opt/avr --build=`./config.guess` --host=avr
    make
    sudo make install

##Compiling the AVR-Ada libraries##
Note: If you installed everything into /opt/avr (for example), which is probably not already referenced in your PATH variable, now is the time to correct this. Check where your avr-gcc is being referenced now:
    
    $ type avr-gcc
    avr-gcc is /opt/avr/bin/avr-gcc

If it doesn't report your installed avr-gcc (as above) then you need to adjust your PATH.  On Debian installations, you might prefer to just uninstall their C-only versions of the avr software to avoid mixing them up.

In any case, you need to put /opt/avr/bin in your PATH:

    $ PATH="/opt/avr/bin:$PATH"


According to the build scripts supplied with AVR-Ada under the directory avr-ada-1.1.0/tools/build/ the installation process should work this way:

    cd avr-ada-1.1.0
    ./configure --prefix=/opt/avr
    make build_rts
    sudo make install_rts
    make build_libs
    sudo make install_libs

##Architecture Problem (attiny167)##
Unfortunately compiling stopped with an error message that attiny167 is only supported in assembly language. As I do not use this processor I just removed its directory from the avr_lib directory:

    rm -r avr/avr_lib/attiny167

But this is just a quick and dirty solution.

##Architecture Problem (at90can)##
Another error message I received when just calling make without any target. Compiling stopped when compiling a library for the at90can processor. In this case you can just call make install and than go on with make for building the missing libraries. If you do the two step build with make build_rts and make build_libs you shall not run into this error.

##Architecture Problem (avr6)##
A similar problem occurred for avr6 (yet attiny167 didn't):

    gnat1: error: MCU 'avr6' supported for assembly only
    make[1]: *** [s-bitops.o] Error 1

I found that if you just edit the top-level Makefile and comment out the offending architecture (avr6):

    ARCH_LIST := avr2 avr25 avr3 avr35 avr4 avr5 # avr6

You can get it to build successfully doing:

    $ make clean
    $ make build_rts

##The Automated Way##

All the previous steps are automated in the build script '''build-avr-ada-gcc-4.3.x.sh'''. See the [BuildScript] of usage. The scripts includes an automated download of the required source packages and it also checks out the current set of patches from WinAVR.  Be sure to set the paths and directories suitable for your environment in the top part of the script.

Up to date version of this script &amp; build procedure can be found on the [Build_From_Ubuntu_Lucid_Or_Debian_Squeeze].

##Adding Contributed Packages##

If you find that the version of the avr-ada package you installed is missing a contributed Ada library that
you'd like to use, this section will save you some time in getting that included.

##1. Get The Source Code##

The first thing to do is to acquire a copy of the software package source code from the avr-ada git repository.

1. Go to the main SF Avr-ada page (not the wiki area) and click on "Code" on the menu bar, and select "Git" (not "Git Browse").
+ Under the heading "Git Access" you'll see how to gain access in "read-only" mode. Here I'll assume it still says "git://avr-ada.git.sourceforge.net/gitroot/avr-ada/avr-ada" when you read this.
+ From a work area (''NOT'' where you built avr-ada), type "git clone git://avr-ada.git.sourceforge.net/gitroot/avr-ada/avr-ada". A bunch of files will be downloaded for you.
+ cd to ./avr-ada/avr, where you should find the contributed library(ies) of interest.

## 2. Add to the Avr-ada Build##

1. For each library you want to include, tar up the ''pkgdir''_lib.gpr and the subdirectory ''pkgdir'' itself.
+ cd to your avr-ada build directory, descending into it's ./avr subdirectory (example avr-ada-1.1.0/avr)
+ Unpack your tar file to put ''pkgdir''_lib.gpr and ''pkgdir'' there.
+ Edit the Makefile and look for the line "libraries := debug lcd sensirion onewire".
+ Add the name ''pkgdir'' to that list. For example, if you were interested in the crc and slip contributed packages, then add "crc slip" to the list, so that it reads as follows:

    
    libraries := debug lcd sensirion onewire crc slip

##3. Install##

1. Type "make"
+ Become root (su)
+ Then "make install".

##Contributed Ada Packages##
As of this writing, there are the following optional Ada packages that may not be in your downloaded AVR-Ada distribution:

* [CRC] - Ada CRC package (the non C version)
* [Fatfs] - FAT File System support for memory sticks etc. (FAT16 and FAT32)
* [MCP4922] - SPI Support for the MCP4922 DAC chip
* [MIDI] - MIDI message support on any byte stream
* [Slip] - Packet SLIP support on any byte stream
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Warren W. Gay VE3WWG</dc:creator><pubDate>Tue, 24 Jul 2012 05:05:38 -0000</pubDate><guid>https://sourceforge.net59bb4c60f234141fe1535d0ca51750b4f9246d19</guid></item></channel></rss>