The next chapters will provide more detailed instructions.
There is no all round packet like WinAVR, you need collect all required parts first. These are
To install the compiler, change to the directory where all packets have been downloaded to. When using the Ethernut Starter Kit, they are located on the CDROM. Then install the rpms. Note, that the filenames may differ, if you got newer releases.
cd /cdrom/gnu-c/gcc_linux/ rpm -Uvh \ avr-binutils-2.13.90.030512-1.i386.rpm \ avr-gcc-3.2.90.20030512-1.i386.rpm \ avr-gcc-c++-3.2.90.20030512-1.i386.rpm \ avr-libc-20030512cvs-1.i386.rpm \ avr-libc-docs-20030512cvs-1.i386.rpm
If not done previously you may install uisp now.
cd /cdrom/tools/linux/ tar -zxvf uisp-20030618.tar.gz -C ~/ cd ~/uisp-20030618/ ./configure make make install
Finally install the Nut/OS and Nut/Net sources.
cd /cdrom/ethernut/unix/ tar -zxvf ethernut-3.3.2.tar.gz -C ~/ cd ~/ethernut-3.3.2/nut/ ./configure
The configure script will guide you through the final steps, selecting the right CPU and the type of your programming adapter.
You may now rebuild the Nut/OS libraries by entering
make clean make install
This step should be passed without any errors or even warning. If not, you may have used the wrong compiler or library version.
Now you can check, if you are able to compile the http daemon sample and upload the resulting binary to your Ethernut board.
cd app/httpd/ make burn
Now you need to set the correct path to the subdirectory, where all the binaries of your compiler are installed.
For ICCAVR you may enter something like
SET PATH=C:\icc\bin;%PATH%
The typical WinAVR installation may require
SET PATH=C:\WinAVR\bin;C:\WinAVR\utils\bin;%PATH%
Next enter
nutconf
which will start the configuration tool. Again select the right compiler, the type of CPU and the programming adapter you are using and press the Configure button. Confirm to rebuild the libraries. Nut/OS comes with ready build libraries, but when using ICCAVR, these libraries need to be copied to the compiler's lib directory. For AVRGCC there's no need to rebuild them, but it didn't hurt.
If you want to change the compiler or in case you modified any part of the system, you can call nutconf again later to change your settings and create a new library version.
Executing nutconf as described above copies all Nut/OS libraries to the ImageCraft library directory.
Before creating Nut/OS applications, you have to enter some special settings in the ImageCraft Project. On the first page of the Compiler Options Dialog you need to add the Nut/OS include file path. Note, that the path of your ImageCraft directory may differ.
..\..\include\;C:\icc\include\
On the second page the macro define
_MCU_enhanced
has to be added if you are developing for the ATmega128.
On the last page you must add the following additional libs.
nutpro nutnet nutfs nutos nutdev nutcrt
On the same page enter
-ucrtnut.o c:\icc\lib\nutinit.o
in the field named Other Options. Again, your path to the ImageCraft directory may differ. Please refer to the ICCAVR Online Manuals for further assistance.
Change to the Nut/OS installation directory and make sure, that your PATH includes the ICCAVR bin directory.
To rebuild the complete library, enter
make clean
followed by
make install
All Nut/OS and Nut/Net libraries should compile and link without problem and will be copied to the Nut/OS lib directory. The configure tool will then copy these libraries to the ImageCraft lib directory.
Get yourself familiar with the GNU make utility.
Most applications written for AVR-GCC will not run properly when compiled by ICCAVR. Specifically the macro PSTR() will not work with ICCAVR. For porting, refer to the samples in subdirectory appicc.
SET PATH=C:\WinAVR\bin;C:\WinAVR\utils\bin;%PATH%
To build you application's hex file, simply enter
make
If you are using uisp for uploading the hex file to the target system, you can enter
make burn
This will build your application and, if successful, automatically program your target.
To rebuild the complete Nut/OS library, change to the Nut/OS installation directory and enter
make clean
followed by
make install
If successful, the new libraries will be copied to the Nut/OS lib directory.