Start / Documentation / Software / Compiler Setup

HowTo setup your project build environment

Compiler Setup

This section will provide a howto description for the configuration and build environment for Linuy as well as for windows users. The setup is making use of the automake & autoconf system to configure your build eg. for the correct CPU on your board.

Setup the environment for Linux

To compile the eXplorer's Pal firmware, you will need:

  • gcc-avr
  • binutils-avr
  • avr-libc (http://www.nongnu.org/avr-libc/)

Debian users can install them as package.

FATFS: http://elm-chan.org/fsw/ff/00index_e.html

Use the --with-cpu=xxx option to configure a specific CPU type from the following list:

atmega1280
atmega2560

depending on the IC type that is installed on your board.

--host options: avr (required)

--with-cpu options: atmega1280 (default), atmega2560

--with-programmer options: jtag2, avrisp, stk500 (default)

--with-programmer options: usb, (serial port)

./configure --host=avr --with-cpu=atmega1280 --with-programmer=jtag2 --with-programmer-port=usb
make

Setup the environment for Windows

The following procedure has been tested with Windows XP. Work down the installation steps in that order. If you have WinAVR installed already and you feel less familiar with such shell environments, consider to uninstall it first.
Now follow this installation steps:

1) Download MinGW

http://sourceforge.net/projects/mingw/ mingw-get-0.1-mingw32-alpha-4-bin.zip

Unzip to C:\MinGW
extend PATH with ;C:\MinGW erweitern

2) Download MSYS 1.0.11

http://sourceforge.net/projects/mingw/files/MSYS/BaseSystem/msys-core/msys-1.0.11/MSYS-1.0.11.exe/download
MSYS-1.0.11.exe
Install to C:\msys

3) Start MSYS

  • edit /etc/fstab und add your project directory
  • restart MSYS

You can skip this step if you like to work with a copy of your working directory first (recommended)

4) Download and install 7-Zip

You will need this tool to unpack .lzma files:

7z465.exe

5) Download additional tools and lib's

from http://sourceforge.net/projects/mingw/files/

automake-1.11.1-1-msys-1.0.13-doc.tar.lzma
automake-1.11.1-1-msys-1.0.13-bin.tar.lzma
autoconf-2.65-1-msys-1.0.13-bin.tar.lzma
autoconf-2.65-1-msys-1.0.13-doc.tar.lzma
perl-5.6.1_2-2-msys-1.0.13-doc.tar.lzma
perl-5.6.1_2-2-msys-1.0.13-bin.tar.lzma
perl-5.6.1_2-2-msys-1.0.13-man.tar.lzma
libcrypt-1.1_1-3-msys-1.0.13-dll-0.tar.lzma
libcrypt-1.1_1-3-msys-1.0.13-dev.tar.lzma
crypt-1.1_1-3-msys-1.0.13-bin.tar.lzma
crypt-1.1_1-3-msys.RELEASE_NOTES.txt
crypt-1.1_1-3-msys-1.0.13-doc.tar.lzma
m4-1.4.14-1-msys-1.0.13-doc.tar.lzma
m4-1.4.14-1-msys-1.0.13-bin.tar.lzma
Unzip with 7-zip to the c:\msys directory according to the directory structure given within the lzma file.

6) Download WinAVR

http://sourceforge.net/projects/winavr/files/WinAVR/20100110/WinAVR-20100110-install.exe/download

7) Install WinAVR

Install with default settings. Nothing special to do.

8) edit C:\msys\1.0\etc\profile

Add the following lines:

# Add PATH for WINAVR
# Path for AVR32 is not added here !!
export PATH="/c/WinAVR-20100110/bin:/c/WinAVR-20100110/avr/bin:$PATH"

9) start msys in working directory

add the following line to /etc/profile, modify it according to the location of
your working directory. The line below will change to C:\my_work_dir.

cd /c/my_work_dir

To test the installation it may help to try the following steps on a copy of your SVN working directory.
A good place to create such a copy is the msys home directory:
eg. c:\msys1.0\home\your_username\
can be accessed with cd ~ within your msys shell.

10) Start MSYS and create the makefile.

Enter the following commands one after the other:

aclocal
automake --add-missing --copy
autoconf
configure --host=avr --with-cpu=atmega2560

The commands should run without error messages.

11) Build the project

make

12) Check for success

When successfull, make should list the created .hex files when done.
Check if the created .hex files are new, with the current date and time.