http://www.ethernut.de/nutwiki/api.php?action=feedcontributions&user=Uwe&feedformat=atomNutwiki - User contributions [en]2024-03-28T13:47:44ZUser contributionsMediaWiki 1.26.2http://www.ethernut.de/nutwiki/index.php?title=Documents/Win_Install&diff=450Documents/Win Install2017-07-13T16:02:06Z<p>Uwe: /* Requirements */ Link to ARMDeveloper arm-none-eabi toolchain</p>
<hr />
<div><div id="content"><br />
<br />
= Installing Nut/OS on Windows =<br />
<br />
This document describes how to install the Nut/OS development environment on Windows.<br />
<br />
Linux/UNIX users should follow [[debian.html|this link]].<br />
<br />
== Requirements ==<br />
<br />
You will need<br />
<br />
* A PC running Windows NT, 2000, 2003 or XP. Other flavors may work as well.<br />
* If you want to build Nut/OS for the AVR target, you need to download WinAVR from the related project page at [http://winavr.sourceforge.net/ SourceForge]. WinAVR is based on the free GNU Compiler Collection for AVR. Here is a [[wininst.html|[[File:../../img/demo2.gif|16x16px|swf]] Shockwave Flash Demo]] of the installation.<br />
* If you intend to use Nut/OS with ARM targets, we recommend the GNU ARM Embedded Toolchain, which is available at [https://developer.arm.com/open-source/gnu-toolchain/gnu-rm ARMdeveloper].<br />
* As an alternative to the GNU Compilers mentioned above, you may consider to use the commercially supported Compilers from [http://www.imagecraft.com/software/ ImageCraft]. However, at the time of this writing, only the AVR compiler had been successfully tested with Nut/OS.<br />
* The executable Nut/OS installation package ethernut-x.y.z.exe (x.y.z to be replaced by the current version number). It is available at our [[../download/index.html|download page]]. Here is a [[nut440.html|[[File:../../img/demo2.gif|16x16px|swf]] Shockwave Flash Demo]] of the installation.<br />
<br />
The tools listed above will enable you to create Nut/OS libraries and final application binaries. A specific software and optional hardware is needed for uploading these binaries to the target board.<br />
<br />
* For the AVR platform, an [[../programmer/index.html|SPI or JTAG Programmer]] is required. The [[../isp/spduo.html|SP Duo]] comes with both interfaces, but doesn't provide debugging like the ATJTAGICE from [http://www.atmel.com/ Atmel].<br />
* Almost all ARM targets offer support for [[../hardware/enut3/jtag.html|JTAG Programming]]. Many of them even come with integrated boot loaders, in which case a standard PC cable (e.g. Ethernet, USB, RS232) is all you need on the hardware side.<br />
<br />
== Compiler Installation ==<br />
<br />
Nothing special is required for Nut/OS. Simply follow the installation instructions for [http://winavr.sourceforge.net/ WinAVR], [http://www.yagarto.de/ YAGARTO] or [http://www.imagecraft.com/software/ ImageCraft].<br />
<br />
== Nut/OS Installation ==<br />
<br />
The Nut/OS package for Windows is a self-extracting executable. Starting it, will present a language selection dialog.<br />
<br />
[[File:../../img/sam7x-inst01.png|Language Selection]]<br /><br />
<br />
Select either English or German. Other languages may be offered, but may not be fully supported. We will use English.<br />
<br />
The next dialog shows a welcome page with the Nut/OS version in the lower left corner.<br />
<br />
[[../../img/nut-inst02.png|[[File:../../img/nut-inst02h.png|487x356px|Welcome Page]]]]<br /><br />
<br />
Click '''Next &gt;'''.<br />
<br />
The following dialog can be used to install a subset of the package. Select '''Full''' and click '''Next &gt;'''.<br />
<br />
[[../../img/nut-inst03.png|[[File:../../img/nut-inst03h.png|487x356px|Component Page]]]]<br /><br />
<br />
Select '''Full''' if not already selected and click '''Next &gt;'''.<br />
<br />
Another dialog allows you to choose a destination folder.<br />
<br />
[[../../img/nut-inst04.png|[[File:../../img/nut-inst04h.png|487x356px|Destination Folder]]]]<br /><br />
<br />
Clicking on '''Install''' will copy the files to the selected folder.<br />
<br />
The following dialog shows the installation progress.<br />
<br />
[[../../img/nut-inst05.png|[[File:../../img/nut-inst05h.png|487x356px|Installation Progress]]]]<br /><br />
<br />
On the last dialog select '''Start Nut/OS Configurator''' and click '''Finish'''.<br />
<br />
[[../../img/nut-inst06.png|[[File:../../img/nut-inst06h.png|487x356px|Installation Completed]]]]<br /><br />
<br />
If everything went well, the installation terminates and the Nut/OS Configurator is started.<br />
<br />
The installation will have created several subdirectories in the destination folder.<br />
<br />
[[File:../../img/nut-inst07.png|Installation Result]]<br />
'''nut'''<br /><br />
Source tree. With the Configurator you will later create sibling directories called build trees (e.g. nutbld-mega256) and application trees (e.g. nutapp-ctrl). This way different Nut/OS configurations for different platforms can be derived from the same source tree and can be used concurrently.<br />
<br />
'''nut/app'''<br /><br />
[[nutapps.html|Sample applications]], from simple system event or timer tests to FTP and HTTP servers.<br />
<br />
'''nut/appicc'''<br /><br />
ImageCraft project templates for the sample applications.<br />
<br />
'''nut/arch'''<br /><br />
Architecture specific system code, device drivers, linker scripts, runtime initialization etc.<br />
<br />
'''nut/bin'''<br /><br />
Application binaries will be copied to this directory with 'make install'.<br />
<br />
'''nut/boot'''<br /><br />
Ethernut boot loaders.<br />
<br />
'''nut/c'''<br /><br />
Hardware independant C runtime routines. May be used for platforms without libc, but not used with the compilers listed above, as they provide their own.<br />
<br />
'''nut/conf'''<br /><br />
Nut/OS configuration scripts, used by the Configurator.<br />
<br />
'''nut/cpp'''<br /><br />
C++ support, probably limited.<br />
<br />
'''nut/crt'''<br /><br />
Hardware dependant C runtime routines, mainly I/O and date/time.<br />
<br />
'''nut/dev'''<br /><br />
Device drivers, which are configurable for all platforms. These are just a few. Most drivers are not yet portable and are therefore located in nut/arch.<br />
<br />
'''nut/doc'''<br /><br />
API documentation including copyright statements.<br />
<br />
'''nut/fs'''<br /><br />
Nut/OS file systems.<br />
<br />
'''nut/include'''<br /><br />
Collection of all C header files, which are related to Nut/OS source files. You compiler may provide similar, in which case it is important, that this directory is searched first.<br />
<br />
'''nut/lib'''<br /><br />
Pre-build Nut/OS libraries. You may try these, if your compiler somehow fails to create them.<br />
<br />
'''nut/net'''<br /><br />
Network related code. The TCP/IP stack can be found here.<br />
<br />
'''nut/os'''<br /><br />
Nut/OS kernel code and some useful APIs, which are not really needed by the kernel.<br />
<br />
'''nut/pro'''<br /><br />
High level network code, like DHCP, HTTP etc.<br />
<br />
'''nut/tools'''<br /><br />
Source code and binaries of various tools. Your PATH environment should point to nut\tools\win32 in the first place. For example, make.exe may be also included in your compiler package, but it may not work with the Nut/OS Makefiles, which sometimes use very specific features.<br />
<br />
A few main tools are not located in the tools directory, but in the application folder.<br />
<br />
'''nutconf.exe'''<br /><br />
Nut/OS Configurator. GUI tool to setup Nut/OS for your specific environment.<br />
<br />
'''nutconfigure.exe'''<br /><br />
Command line version of the Nut/OS Configurator. Useful for automatic builds and [[../tools/commandline.html|purists]].<br />
<br />
'''nutdisc.exe'''<br /><br />
This tiny utility is new with Nut/OS release 4.2. It scans local networks for Nut/OS nodes and allows to configure them remotely. Provided, that the application activates this service.<br />
<br />
== What's Next? ==<br />
<br />
You will now be able to build Nut/OS for your specific target hardware and test some of the sample applications. The following links will guide you.<br />
<br />
[[../../pdf/enswm28e.pdf|Nut/OS Software Manual]] (November 2005)<br /><br />
For Ethernut 1 and 2 and other ATmega based boards. Needs to be updated for Ethernut 3.<br />
<br />
[[atmega2561.html|Nut/OS on the ATmega2561]]<br /><br />
Requires the commercial ImageCraft Compiler.<br />
<br />
[[../portarm/gbaxport2.html|Nut/OS on the Gameboy Advance]]<br /><br />
Little bit outdated.<br />
<br />
[[at91sam7x256.html|Nut/OS on the AT91SAM7X256 EK]]<br /><br />
Atmel evaluation board.<br />
<br />
[[at91sam9260.html|Nut/OS on the AT91SAM9260 EK]]<br /><br />
Atmel evaluation board.<br />
<br />
[http://www.yagarto.de YAGARTO Projects]<br /><br />
Michael Fischer tried Nut/OS on the LPC2294 and the STR711.<br />
<br />
<br /><br />
<br /><br />
<br />
Good luck,<br /><br />
Harald Kipp<br /><br />
Castrop-Rauxel, 18th of October 2006<br />
<br />
<br />
</div></div>Uwehttp://www.ethernut.de/nutwiki/index.php?title=Documents/Development_on_Debian&diff=443Documents/Development on Debian2017-07-13T15:55:23Z<p>Uwe: /* wxWidgets */ Hint that wx built is now diabled by default.</p>
<hr />
<div><div id="content"><br />
<br />
= Nut/OS Development on Debian [[File:debian-logo.png|[Logo]]] =<br />
<br />
Currently there's no binary package available for Debian. Thus, you need to build the Nut/OS development environment from the source package.<br />
<br />
This document will explain, how to install all tools you need to create Nut/OS applications on a Debian Linux PC. In general, this should also work for other Unix-like operating systems, including Mac OS X.<br />
<br />
== Short Version ==<br />
<br />
If you are an experienced user and refuse to read lengthy descriptions, then you may try the following command sequence:<br />
<br />
<pre class="coding">sudo apt-get install automake autoconf<br />
sudo apt-get install libtool<br />
sudo apt-get install build-essential<br />
sudo apt-get install doxygen doxygen-doc graphviz<br />
sudo apt-get install lua5.1 liblua5.1-0 liblua5.1-0-dev<br />
sudo apt-get install libgtk2.0-dev<br />
sudo apt-get install libqtcore4 libqtgui4 libqt4-dev<br />
mkdir ~/ethernut<br />
cd ~/ethernut<br />
wget http://www.ethernut.de/arc/ethernut-5.0.5.tar.gz<br />
tar xzf ethernut-5.0.5.tar.gz<br />
ln -s ethernut-5.0.5 nut<br />
cd nut/<br />
./configure<br />
make<br />
sudo make install</pre><br />
Next install the cross compiler toolchain for your target system. For AVR boards this is simple:<br />
<br />
<pre class="coding">sudo apt-get install binutils-avr gcc-avr avr-libc avrdude</pre><br />
For ARM based target boards we recommend the [https://developer.arm.com/open-source/gnu-toolchain/gnu-rm arm-none-eabi toolchain] provided by ARM.<br />
<br />
For other targets you can build the toolchain from the source code. Several resources are available in the Internet to help with this.<br />
<br />
When done, start the Configurator...<br />
<br />
<pre class="coding">cd ~/ethernut/<br />
qnutconf &amp;</pre><br />
and follow the [[../../pdf/enswm28e.pdf|Nut/OS Software Manual]].<br />
<br />
== Requirements ==<br />
<br />
Before delving into the details of the installation, we will give a first overview.<br />
<br />
The following GNU tools are required to configure and build a minimal Nut/OS development environment:<br />
<br />
* C compiler 4.1 or later<br />
* Binutils 2.18 or later<br />
* Autoconf 2.61<br />
* Automake 1.10<br />
<br />
Furthermore, you need a so called ''cross toolchain'', which allows us to create binaries on a Linux host, which will later run on our target board. When developing for 8-bit AVR, we need<br />
<br />
* GNU Compiler Collection for AVR<br />
* GNU Binary Utilities for AVR<br />
* AVRDUDE programmer software<br />
<br />
while for 32-bit ARM development the following tools are recommended<br />
<br />
* GNU Compiler Collection for ARM<br />
* GNU Binary Utilities for ARM<br />
* OpenOCD for JTAG programming and debugging<br />
<br />
You have the choice to install different options of the development environment. Depending on this, additional tools may be required, as shown in the following table.<br />
<br />
{| class="wikitable"<br />
!width="25%"| Module<br />
!width="25%"| Provisions<br />
!width="25%"| Additional Requirements<br />
!width="25%"| Exclude with<br />
|-<br />
| Nut/OS Sources<br /><br />
'''(mandatory)'''<br />
|<br />
Target selection via shell script<br />
Configurable by editing C header files<br />
Tool for creating simple file system images<br />
| None<br />
| Always enabled<br />
|-<br />
| CLI Configurator<br /><br />
'''(recommended)'''<br />
|<br />
Multiple build and application trees<br />
Automated script based target configuration<br />
Batch build<br />
| Lua 5.1 libraries<br />
| <br />
|-<br />
| UROM Image Creator<br /><br />
'''(recommended)'''<br />
| Creates simple filesystem images<br />
| C compiler<br />
| --disable-crurom<br />
|-<br />
| GUI Configurator<br /><br />
wxWidgets version<br /><br />
(optional)<br />
|<br />
Easy to use configuration interface<br />
Multiple build and application trees<br />
Automated script based target configuration<br />
|<br />
Lua 5.1 libraries<br />
wxWidgets 2.9 libraries<br />
GNU C++ compiler<br />
| Disabled by default<br />
|-<br />
| GUI Configurator<br /><br />
Qt version<br /><br />
(optional)<br />
|<br />
Easy to use configuration interface<br />
Multiple build and application trees<br />
Automated script based target configuration<br />
|<br />
Lua 5.1 libraries<br />
Qt4 libraries<br />
GNU C++ compiler<br />
| --disable-qnutconf<br />
|-<br />
| GUI Discoverer<br /><br />
wxWidgets version<br /><br />
(optional)<br />
|<br />
Scans local and remote networks for Nut/OS nodes<br />
Remote configuration of Nut/OS nodes<br />
|<br />
wxWidgets 2.9.3 libraries<br />
GNU C++ compiler<br />
| --disable-nutdisc<br />
|-<br />
| GUI Discoverer<br /><br />
Qt version<br /><br />
(optional)<br />
|<br />
Scans local networks for Nut/OS nodes<br />
Remote configuration of Nut/OS nodes<br />
|<br />
Qt4 libraries<br />
GNU C++ compiler<br />
| Disabled by default<br />
|-<br />
| API Reference<br /><br />
(optional)<br />
| HTML document created from source code<br />
|<br />
Doxygen 1.4 or later<br />
GraphViz 2.2 or later<br />
| Disabled by default<br />
|}<br />
<br />
[http://www.lua.org/ Lua] is an embeddable scripting language, which is used here to specify the configuration rules.<br />
<br />
[http://www.wxwidgets.org/ wxWidgets] is a cross-platform C++ GUI framework.<br />
<br />
[http://www.doxygen.org/ Doxygen] and [http://www.graphviz.org/ GraphViz] are used to automatically create a Nut/OS API reference from the C source files.<br />
<br />
It's recommended to try the full installation first. If it fails for some reason, you may step down to a less complete environment.<br />
<br />
== Full Installation ==<br />
<br />
=== Build Essentials ===<br />
<br />
Most Debian distributions offer to install all basic tools for building Linux applications in one step:<br />
<br />
<pre class="coding">sudo apt-get install build-essential</pre><br />
If that doesn't work for you, we will show below, how to install them separately.<br />
<br />
Check the version of the GNU Compiler Collection installed on your PC. Note, that this compiler is needed to create binaries, which will run on Linux. Code for AVR or ARM targets is created by the cross compiler, which will be installed later.<br />
<br />
<pre class="coding">$ gcc --version<br />
gcc (GCC) 4.3.3<br />
$ g++ --version<br />
g++ (GCC) 4.3.3</pre><br />
Actually the version is not critical. Previous versions should work fine. Typically, newer releases of the GNU compiler are more strict about code compliance and may emit warnings or even error messages.<br />
<br />
To install or upgrade, use<br />
<br />
<pre class="coding">sudo apt-get install gcc g++</pre><br />
Next you need to make sure to have a recent version of the GNU autotools installed.<br />
<br />
<pre class="coding">$ autoconf --version<br />
autoconf (GNU Autoconf) 2.63<br />
$ automake --version<br />
automake (GNU automake) 1.10.2</pre><br />
To install or upgrade, use<br />
<pre class="coding">sudo apt-get install automake autoconf</pre><br />
=== wxWidgets ===<br />
<br />
When enabled, the recent configuration of the Nut/OS tools requires at least wxWidgets version 2.9.3. It will definitely not work with earlier versions. At the time of this writing this version is not available as a binary package. You have to build it from the sources. This is a bit time consuming, but works straightforward.<br />
<br />
First, make sure that you have installed the GCC toolchain and the GTK 2.0 libraries.<br />
<br />
<pre class="coding">sudo apt-get install build-essential libgtk2.0-dev</pre><br />
Next, you can download and unpackk the wxWidgets 2.9.3 source code.<br />
<br />
<pre class="coding">wget -r -nd http://tenet.dl.sourceforge.net/project/wxwindows/2.9.3/wxWidgets-2.9.3.tar.bz2<br />
tar xjf wxWidgets-2.9.3.tar.bz2</pre><br />
To avoid later problems with shared libraries and other features, we prefer to build a very basic version. However, shared libraries and unicode builds may work for you. In any case, we recommend to create a build directory first.<br />
<br />
<pre class="coding">cd wxWidgets-2.9.3/<br />
mkdir build-GTK<br />
cd build-GTK<br />
../configure --with-gtk --disable-debug --disable-shared --disable-unicode</pre><br />
Building the libraries is done in a second step. Be prepared that this takes at least several minutes.<br />
<br />
<pre class="coding">make</pre><br />
As usual, the binaries are finally installed with<br />
<br />
<pre class="coding">sudo make install<br />
sudo ldconfig</pre><br />
You may now test the installation by trying the AUI sample.<br />
<br />
<pre class="coding">cd ../samples/aui<br />
make -f makefile.unx<br />
./auidemo</pre><br />
The last command should open a sample application window with dockable toolbars. This means the wxWidgets installation is working.<br />
<br />
=== wxPropertyGrid ===<br />
<br />
The Nut/OS Discoverer is based on a wxWidgets extension called wxPropertyGrid. For earlier versions of wxWidgets it was required to install it separately. Now it has become part of the official wxWidgets distribution. Nevertheless, we keep the related installation instructions for archival purposes.<br />
<br />
Like most wxWidgets extensions, wxPropertyGrid is available in source code and must be applied to the wxWidgets source code package.<br />
<br />
Create a temporary directory and change to it.<br />
<br />
<pre class="coding">mkdir ~/propgrid<br />
cd ~/propgrid</pre><br />
Next download and unpack the source code archive in that directory.<br />
<br />
<pre class="coding">wget http://ovh.dl.sourceforge.net/sourceforge/wxpropgrid/wxpropgrid-1.4.5-src.tar.gz<br />
tar xzf wxpropgrid-1.4.5-src.tar.gz</pre><br />
Now run the standard command sequence to apply wxPropertyGrid to your wxWidgets source tree.<br />
<br />
<pre class="coding">cd propgrid/<br />
./configure --disable-share<br />
make<br />
sudo make install</pre><br />
This should install the package in /usr/include/wx-2.8/wx or /usr/local/include/wx-2.8/wx. On our machine this didn't work properly. The wxPropertyGrid extension had been installed in /usr/local/include/wx/propgrid/ instead. Moving it manually to the right place helped.<br />
<br />
<pre class="coding">mv /usr/local/include/wx/propgrid/ /usr/local/include/wx-2.8/wx/propgrid/</pre><br />
=== Lua ===<br />
<br />
In the next step we are going to install the Lua language, which is used later by the Nut/OS Configurator to parse the configuration files.<br />
<br />
The Nut/OS Configurator had been tested with Lua 5.1 and may still run with either Lua 5.0 or even later versions. However, the configure script that is currently provided, will not accept anything else but version 5.1. Use the following command to install the binaries:<br />
<br />
<pre class="coding">sudo apt-get install lua5.1 liblua5.1-0 liblua5.1-0-dev</pre><br />
If it worked you can skip the rest of this chapter and continue with installing Doxygen and GraphViz.<br />
<br />
If no binary package is available for your Linux distribution, which is most unlikely by the way, you can build Lua from the source. The following explanation had been written some time ago for the version 5.0, when Lua was not as widespread as it is today. It may be of some help.<br />
<br />
Download lua-5.0.3.tar.gz from [http://www.lua.org www.lua.org] and unpack it.<br />
<br />
<pre class="coding">tar xzf lua-5.0.3.tar.gz<br />
cd lua-5.0.3/</pre><br />
The Lua source archive doesn't provide a configure script. Instead it comes with a prepared Makefile, which includes another file named config. This file allows to modify several build options. On our system the original file worked fine, but you may at least have a look to the contents.<br />
<br />
Building and installing is done in the usual way:<br />
<br />
<pre class="coding">make<br />
sudo make install</pre><br />
=== Doxygen And GraphViz ===<br />
<br />
For creating the Nut/OS API Reference Document, we need to install Doxygen and GraphViz.<br />
<br />
<pre class="coding">sudo apt-get install doxygen doxygen-doc graphviz</pre><br />
If something fails here: No big deal. The documents are also available [[api/|online]].<br />
<br />
=== Nut/OS ===<br />
<br />
Now we got everything on our Linux system to install the Nut/OS source package. Well, in fact the AVR or ARM toolchains are missing to build the Nut/OS libraries and sample applications. But this is done later with the Nut/OS Configurator and therefore the platform specific cross toolchains are not yet required.<br />
<br />
It is highly recommended to create a project directory first and then download the latest ethernut-x.y.z.tar.bz2 (or tar.gz) from the download section into this directory.<br />
<br />
<pre class="coding">mkdir ~/ethernut<br />
cd ~/ethernut<br />
wget http://www.ethernut.de/arc/ethernut-5.0.5.tar.gz<br />
tar xzf ethernut-5.0.5.tar.gz</pre><br />
We may later upgrade to a new version or we may concurrently work with different versions. Thus, it is most convenient to create a symbolic link before starting the ''configure'' script.<br />
<br />
<pre class="coding">ln -s ethernut-5.0.5 nut<br />
cd nut/<br />
./configure</pre><br />
Carefully check the output, specially the following lines:<br />
<br />
<pre class="coding">checking for doxygen... true<br />
checking for dot... true<br />
configure: nutconf tools enabled<br />
configure: nutconfgui is enabled<br />
configure: nutdisc enabled</pre><br />
If anything hasn't been enabled, refer to the addtional requirements given in the table in the first chapter of this document and make sure that they had been properly installed. However, even if not all requirements are fulfilled, you can still continue. But not all features of the development environment will be available.<br />
<br />
The next command will build tools and documentation and will take several minutes to finish.<br />
<br />
<pre class="coding">make</pre><br />
If the build fails because of wxWidgets, try<br />
<br />
<pre class="coding">./configure --disable-nutconf --disable-nutdisc<br />
make clean<br />
make</pre><br />
This will only build the Qt and the command line versions of the Configurator.<br />
<br />
By default<br />
<br />
<pre class="coding">sudo make install</pre><br />
should install five executables<br />
<br />
* crurom, UROM file system creator<br />
* nutconfigure, Nut/OS Configurator for the command line<br />
* qnutconf, full fledged Nut/OS Configurator GUI, based on Qt4<br />
* nutconf, same as above, but based on wxWidgets<br />
* nutdisc, Nut/OS Discoverer<br />
<br />
in a global directory, typically /usr/local/bin/.<br />
<br />
== Installation With Command Line Tools Only ==<br />
<br />
In case you experience problems with GTK+ or wxWidgets, or simply refuse to use GUI tools for building embedded applications, you can install a reduced version. Beside GUI gimmicks, you won't miss anything important.<br />
<br />
Install the same packages as described in the full installation, but completely skip the wxWidget part.<br />
<br />
After downloading and unpacking Nut/OS source code package, configure it with two additional parameters.<br />
<br />
<pre class="coding">cd ~/ethernut/nut/<br />
./configure --disable-nutconf-gui --disable-html-docs<br />
make<br />
sudo make install</pre><br />
== Minimal Installation ==<br />
<br />
Even if all fails, there is still hope: Try the bare minimum! In fact you can simply use the raw unpacked sources.<br />
<br />
Create a project directory and download the latest ethernut-x.y.z.tar.bz2 (or tar.gz) from the download section into this directory.<br />
<br />
<pre class="coding">mkdir ~/ethernut<br />
cd ~/ethernut<br />
wget -N http://www.ethernut.de/arc/ethernut-5.0.5.tar.gz</pre><br />
When downloaded, unpack the Ethernut source package.<br />
<br />
<pre class="coding">tar xzf ethernut-5.0.5.tar.gz</pre><br />
Now create a symbolic link to the unpacked sources, change to this new directory and run ''nutsetup'' to configure Nut/OS for your target board.<br />
<br />
<pre class="coding">ln -s ethernut-5.0.5 nut<br />
cd nut/<br />
./nutsetup</pre><br />
The nutsetup script will create a file named UserConf.mk used by make and will create a link of Makedefs, Makerules, app/Makedefs and app/Makerules to the platform specific files. For the AVR platform the link will point to Makedefs.avr-gcc, Makerules.avr-gcc, app/Makedefs.avr-gcc and app/Makerules.avr-gcc resp. For the Nut/OS emulation on UNIX, it will also create some wrapper header files in directory include/.<br />
<br />
After this, everything is ready to build Nut/OS in the source tree. We will explain this later.<br />
<br />
However, some applications, e.g. ''basemon'' or ''httpd'' require ''crurom'' to build an UROM file system image. Try<br />
<br />
<pre class="coding">./configure --disable-nutconf-tools --disable-html-docs<br />
make<br />
sudo make install</pre><br />
Even if this fails, you can still build most application samples.<br />
<br />
== Cross Toolchain ==<br />
<br />
To create any binaries for our AVR or ARM target system, we need to install the related cross toolchain.<br />
<br />
=== AVR Toolchain ===<br />
<br />
For the 8-bit AVR platform use<br />
<br />
<pre class="coding">sudo apt-get install binutils-avr gcc-avr avr-libc avrdude</pre><br />
=== ARM Toolchain ===<br />
<br />
Unfortunately there is no official binary package available. You may try to build the toolchain from the official sources.<br />
<br />
== Nut/OS Libraries ==<br />
<br />
The way we build Nut/OS libraries depends on the tools, which are available from the installation described above.<br />
<br />
=== Using the Configurator GUI ===<br />
<br />
Change to the Ethernut project directory and start the Configurator.<br />
<br />
<pre class="coding">cd ~/ethernut/<br />
nutconf</pre><br />
Now follow the [[../../pdf/enswm28e.pdf|Nut/OS Software Manual]] to build Nut/OS and the related sample applications.<br />
<br />
=== Using the Configurator CLI ===<br />
<br />
Change to the Ethernut project directory and enter the following command to display the usage help for the Configurator's command line interface.<br />
<br />
<pre class="coding">cd ~/ethernut/<br />
nutconfigure -?</pre><br />
<pre class="coding">Usage: nutconfigure OPTIONS ACTIONS<br />
OPTIONS:<br />
-a&lt;dir&gt; application directory (./nutapp)<br />
-b&lt;dir&gt; build directory (./nutbld)<br />
-c&lt;file&gt; configuration file (./nut/conf/ethernut21b.conf)<br />
-i&lt;dir&gt; first include path ()<br />
-j&lt;dir&gt; last include path ()<br />
-l&lt;dir&gt; library directory ()<br />
-m&lt;type&gt; target platform (avr-gcc)<br />
-p&lt;type&gt; programming adapter (avr-dude)<br />
-q quiet (verbose)<br />
-s&lt;dir&gt; source directory (./nut)<br />
-r&lt;file&gt; repository (./nut/conf/repository.nut)<br />
ACTIONS:<br />
create-buildtree<br />
create-apptree</pre><br />
The document [[../tools/commandline.html|Nut/OS development for purists]] explains the whole process.<br />
<br />
=== Building in the Source Tree ===<br />
<br />
'''Today, building in the source tree is seldom used, currently not maintained and considered broken.'''<br />
<br />
With the minimal installation it is necessary to build Nut/OS libraries and applications directly in the source tree. It is assumed, that you already ran the ''nutsetup'' script to configure Nut/OS for a specific target board.<br />
<br />
Change to the subdirectory ''lib'' within the source tree and run ''make''.<br />
<br />
<pre class="coding">cd ~/ethernut/nut/lib/<br />
make clean install</pre><br />
Although simple, most developers prefer to use the Configurator nowadays. Therefore, building in the source tree is not always properly maintained. If your build fails, it is probably caused by a missing or outdated source file entry in the related Makefile. You can easily fix this by updating the Makefile with a text editor. Just make sure that your editor will preserve tabs. We will give an example.<br />
<br />
The build for Ethernut 2.1 fails with the following error:<br />
<br />
<pre class="coding">make[1]: *** No rule to make target `httpdopt.o', needed by `libnutpro.a'. Stop.<br />
make[1]: Leaving directory `/home/harald/ethernut/ethernut-4.7.3/pro'<br />
make: *** [install] Error 2</pre><br />
Change to the directory where the problem occured (remember that we use the symbolic link ''nut'') and load the Makefile into an editor.<br />
<br />
<pre class="coding">cd ~/ethernut/nut/pro/<br />
vi Makefile</pre><br />
We can see, that ''httpdopt.c'' is in the Makefile, but no such file exists in the current directory. Instead a file named ''httpopt.c'' (without letter d) exists. After correcting the Makefile, the error is gone.<br />
<br />
Applications are build in the source tree in a similar way.<br />
<br />
<pre class="coding">cd ~/ethernut/nut/app/events/<br />
make clean all</pre><br />
== Getting Nut/OS from Subversion ==<br />
<br />
Instead of downloading the source package, you may retrieve the latest updates from the SVN repository.<br />
<br />
<pre class="coding">mkdir ~/ethernut<br />
cd ~/ethernut<br />
svn co https://ethernut.svn.sourceforge.net/svnroot/ethernut/branches/nut-4_8-branch ethernut-4.8<br />
ln -s ethernut-4.8 nut<br />
cd nut</pre><br />
If you want to try the latest code, use:<br />
<br />
<pre class="coding">cd ~/ethernut<br />
svn co https://ethernut.svn.sourceforge.net/svnroot/ethernut/trunk ethernut-trunk<br />
ln -s ethernut-trunk nut<br />
cd nut</pre><br />
A script named ''reconf'' had been prepared to run the autotools. Run it now.<br />
<br />
<pre class="coding">./reconf</pre><br />
The CVS repository will never contain any files, which can be created locally. This is also true for some default files used by automake. Thus, after checking out the module for the first time, ''reconf'' will fail. To fix this, run<br />
<br />
<pre class="coding">automake --add-missing</pre><br />
and then run ''./reconf'' again. We are now ready to configure, build and install the Nut/OS tools.<br />
<br />
<pre class="coding">./configure<br />
make<br />
sudo make install</pre><br />
To keep up with the latest changes, use the following commands.<br />
<br />
<pre class="coding">cd ~/ethernut/nut<br />
svn update</pre><br />
== Related Links ==<br />
<br />
[http://packages.debian.org/testing/devel/ packages.debian.org/testing/devel]<br /><br />
Devel section of Debian software packages in the testing distribution.<br />
<br />
[http://www.alphapogo.de www.alphapogo.de]<br /><br />
How to setup the GNU Arm toolchain on (K)Ubuntu Linux (in lax German).<br />
<br />
[http://wiki.debian.org/Crosstool wiki.debian.org/Crosstool]<br /><br />
Quick and dirty hack to bundle crosstool output into .tgz and .deb packages.<br />
<br />
[http://www.rowley.co.uk/arm/ www.rowley.co.uk/arm/]<br /><br />
Commercially supported toolchain (may not be suitable for Nut/OS yet).<br />
<br />
[http://www.inf.u-szeged.hu/gcc-arm/ www.inf.u-szeged.hu/gcc-arm/]<br /><br />
GCC ARM Improvement Project.<br />
<br />
[http://www.es-business.com/ethernut/eng/rhel4.php www.es-business.com/ethernut/eng/rhel4.php]<br /><br />
Nut/OS development on Red Hat Enterprise Linux 4 (RHEL4).<br />
<br />
[http://www.geisterstunde.org/drupal/?q=ethernut_gentoo www.geisterstunde.org/drupal/]<br /><br />
Ethernut Setup with Gentoo.<br />
<br />
[http://www.btnode.ethz.ch/Documentation/LinuxInstall www.btnode.ethz.ch/Documentation/LinuxInstall]<br /><br />
BTnut Development Tools - Linux Installation.<br />
<br />
[http://www.ethernut.de/nutwiki/Installing_NutOS_developement_environment_on_Debian_Etch Nut/OS on Debian Etch]<br /><br />
Some additional notes in the NutWiki.<br />
<br />
<br /><br />
<br /><br />
<br />
Good luck,<br /><br />
Harald Kipp<br /><br />
<br /><br />
Castrop-Rauxel, 21st of June 2009<br />
<br />
<br />
</div></div>Uwehttp://www.ethernut.de/nutwiki/index.php?title=Documents/Development_on_Debian&diff=442Documents/Development on Debian2017-07-13T15:53:31Z<p>Uwe: /* Requirements */ wx configurator and documentation build now disabled by default</p>
<hr />
<div><div id="content"><br />
<br />
= Nut/OS Development on Debian [[File:debian-logo.png|[Logo]]] =<br />
<br />
Currently there's no binary package available for Debian. Thus, you need to build the Nut/OS development environment from the source package.<br />
<br />
This document will explain, how to install all tools you need to create Nut/OS applications on a Debian Linux PC. In general, this should also work for other Unix-like operating systems, including Mac OS X.<br />
<br />
== Short Version ==<br />
<br />
If you are an experienced user and refuse to read lengthy descriptions, then you may try the following command sequence:<br />
<br />
<pre class="coding">sudo apt-get install automake autoconf<br />
sudo apt-get install libtool<br />
sudo apt-get install build-essential<br />
sudo apt-get install doxygen doxygen-doc graphviz<br />
sudo apt-get install lua5.1 liblua5.1-0 liblua5.1-0-dev<br />
sudo apt-get install libgtk2.0-dev<br />
sudo apt-get install libqtcore4 libqtgui4 libqt4-dev<br />
mkdir ~/ethernut<br />
cd ~/ethernut<br />
wget http://www.ethernut.de/arc/ethernut-5.0.5.tar.gz<br />
tar xzf ethernut-5.0.5.tar.gz<br />
ln -s ethernut-5.0.5 nut<br />
cd nut/<br />
./configure<br />
make<br />
sudo make install</pre><br />
Next install the cross compiler toolchain for your target system. For AVR boards this is simple:<br />
<br />
<pre class="coding">sudo apt-get install binutils-avr gcc-avr avr-libc avrdude</pre><br />
For ARM based target boards we recommend the [https://developer.arm.com/open-source/gnu-toolchain/gnu-rm arm-none-eabi toolchain] provided by ARM.<br />
<br />
For other targets you can build the toolchain from the source code. Several resources are available in the Internet to help with this.<br />
<br />
When done, start the Configurator...<br />
<br />
<pre class="coding">cd ~/ethernut/<br />
qnutconf &amp;</pre><br />
and follow the [[../../pdf/enswm28e.pdf|Nut/OS Software Manual]].<br />
<br />
== Requirements ==<br />
<br />
Before delving into the details of the installation, we will give a first overview.<br />
<br />
The following GNU tools are required to configure and build a minimal Nut/OS development environment:<br />
<br />
* C compiler 4.1 or later<br />
* Binutils 2.18 or later<br />
* Autoconf 2.61<br />
* Automake 1.10<br />
<br />
Furthermore, you need a so called ''cross toolchain'', which allows us to create binaries on a Linux host, which will later run on our target board. When developing for 8-bit AVR, we need<br />
<br />
* GNU Compiler Collection for AVR<br />
* GNU Binary Utilities for AVR<br />
* AVRDUDE programmer software<br />
<br />
while for 32-bit ARM development the following tools are recommended<br />
<br />
* GNU Compiler Collection for ARM<br />
* GNU Binary Utilities for ARM<br />
* OpenOCD for JTAG programming and debugging<br />
<br />
You have the choice to install different options of the development environment. Depending on this, additional tools may be required, as shown in the following table.<br />
<br />
{| class="wikitable"<br />
!width="25%"| Module<br />
!width="25%"| Provisions<br />
!width="25%"| Additional Requirements<br />
!width="25%"| Exclude with<br />
|-<br />
| Nut/OS Sources<br /><br />
'''(mandatory)'''<br />
|<br />
Target selection via shell script<br />
Configurable by editing C header files<br />
Tool for creating simple file system images<br />
| None<br />
| Always enabled<br />
|-<br />
| CLI Configurator<br /><br />
'''(recommended)'''<br />
|<br />
Multiple build and application trees<br />
Automated script based target configuration<br />
Batch build<br />
| Lua 5.1 libraries<br />
| <br />
|-<br />
| UROM Image Creator<br /><br />
'''(recommended)'''<br />
| Creates simple filesystem images<br />
| C compiler<br />
| --disable-crurom<br />
|-<br />
| GUI Configurator<br /><br />
wxWidgets version<br /><br />
(optional)<br />
|<br />
Easy to use configuration interface<br />
Multiple build and application trees<br />
Automated script based target configuration<br />
|<br />
Lua 5.1 libraries<br />
wxWidgets 2.9 libraries<br />
GNU C++ compiler<br />
| Disabled by default<br />
|-<br />
| GUI Configurator<br /><br />
Qt version<br /><br />
(optional)<br />
|<br />
Easy to use configuration interface<br />
Multiple build and application trees<br />
Automated script based target configuration<br />
|<br />
Lua 5.1 libraries<br />
Qt4 libraries<br />
GNU C++ compiler<br />
| --disable-qnutconf<br />
|-<br />
| GUI Discoverer<br /><br />
wxWidgets version<br /><br />
(optional)<br />
|<br />
Scans local and remote networks for Nut/OS nodes<br />
Remote configuration of Nut/OS nodes<br />
|<br />
wxWidgets 2.9.3 libraries<br />
GNU C++ compiler<br />
| --disable-nutdisc<br />
|-<br />
| GUI Discoverer<br /><br />
Qt version<br /><br />
(optional)<br />
|<br />
Scans local networks for Nut/OS nodes<br />
Remote configuration of Nut/OS nodes<br />
|<br />
Qt4 libraries<br />
GNU C++ compiler<br />
| Disabled by default<br />
|-<br />
| API Reference<br /><br />
(optional)<br />
| HTML document created from source code<br />
|<br />
Doxygen 1.4 or later<br />
GraphViz 2.2 or later<br />
| Disabled by default<br />
|}<br />
<br />
[http://www.lua.org/ Lua] is an embeddable scripting language, which is used here to specify the configuration rules.<br />
<br />
[http://www.wxwidgets.org/ wxWidgets] is a cross-platform C++ GUI framework.<br />
<br />
[http://www.doxygen.org/ Doxygen] and [http://www.graphviz.org/ GraphViz] are used to automatically create a Nut/OS API reference from the C source files.<br />
<br />
It's recommended to try the full installation first. If it fails for some reason, you may step down to a less complete environment.<br />
<br />
== Full Installation ==<br />
<br />
=== Build Essentials ===<br />
<br />
Most Debian distributions offer to install all basic tools for building Linux applications in one step:<br />
<br />
<pre class="coding">sudo apt-get install build-essential</pre><br />
If that doesn't work for you, we will show below, how to install them separately.<br />
<br />
Check the version of the GNU Compiler Collection installed on your PC. Note, that this compiler is needed to create binaries, which will run on Linux. Code for AVR or ARM targets is created by the cross compiler, which will be installed later.<br />
<br />
<pre class="coding">$ gcc --version<br />
gcc (GCC) 4.3.3<br />
$ g++ --version<br />
g++ (GCC) 4.3.3</pre><br />
Actually the version is not critical. Previous versions should work fine. Typically, newer releases of the GNU compiler are more strict about code compliance and may emit warnings or even error messages.<br />
<br />
To install or upgrade, use<br />
<br />
<pre class="coding">sudo apt-get install gcc g++</pre><br />
Next you need to make sure to have a recent version of the GNU autotools installed.<br />
<br />
<pre class="coding">$ autoconf --version<br />
autoconf (GNU Autoconf) 2.63<br />
$ automake --version<br />
automake (GNU automake) 1.10.2</pre><br />
To install or upgrade, use<br />
<pre class="coding">sudo apt-get install automake autoconf</pre><br />
=== wxWidgets ===<br />
<br />
The recent configuration of the Nut/OS tools requires at least wxWidgets version 2.9.3. It will definitely not work with earlier versions. At the time of this writing this version is not available as a binary package. You have to build it from the sources. This is a bit time consuming, but works straightforward.<br />
<br />
First, make sure that you have installed the GCC toolchain and the GTK 2.0 libraries.<br />
<br />
<pre class="coding">sudo apt-get install build-essential libgtk2.0-dev</pre><br />
Next, you can download and unpackk the wxWidgets 2.9.3 source code.<br />
<br />
<pre class="coding">wget -r -nd http://tenet.dl.sourceforge.net/project/wxwindows/2.9.3/wxWidgets-2.9.3.tar.bz2<br />
tar xjf wxWidgets-2.9.3.tar.bz2</pre><br />
To avoid later problems with shared libraries and other features, we prefer to build a very basic version. However, shared libraries and unicode builds may work for you. In any case, we recommend to create a build directory first.<br />
<br />
<pre class="coding">cd wxWidgets-2.9.3/<br />
mkdir build-GTK<br />
cd build-GTK<br />
../configure --with-gtk --disable-debug --disable-shared --disable-unicode</pre><br />
Building the libraries is done in a second step. Be prepared that this takes at least several minutes.<br />
<br />
<pre class="coding">make</pre><br />
As usual, the binaries are finally installed with<br />
<br />
<pre class="coding">sudo make install<br />
sudo ldconfig</pre><br />
You may now test the installation by trying the AUI sample.<br />
<br />
<pre class="coding">cd ../samples/aui<br />
make -f makefile.unx<br />
./auidemo</pre><br />
The last command should open a sample application window with dockable toolbars. This means the wxWidgets installation is working.<br />
<br />
=== wxPropertyGrid ===<br />
<br />
The Nut/OS Discoverer is based on a wxWidgets extension called wxPropertyGrid. For earlier versions of wxWidgets it was required to install it separately. Now it has become part of the official wxWidgets distribution. Nevertheless, we keep the related installation instructions for archival purposes.<br />
<br />
Like most wxWidgets extensions, wxPropertyGrid is available in source code and must be applied to the wxWidgets source code package.<br />
<br />
Create a temporary directory and change to it.<br />
<br />
<pre class="coding">mkdir ~/propgrid<br />
cd ~/propgrid</pre><br />
Next download and unpack the source code archive in that directory.<br />
<br />
<pre class="coding">wget http://ovh.dl.sourceforge.net/sourceforge/wxpropgrid/wxpropgrid-1.4.5-src.tar.gz<br />
tar xzf wxpropgrid-1.4.5-src.tar.gz</pre><br />
Now run the standard command sequence to apply wxPropertyGrid to your wxWidgets source tree.<br />
<br />
<pre class="coding">cd propgrid/<br />
./configure --disable-share<br />
make<br />
sudo make install</pre><br />
This should install the package in /usr/include/wx-2.8/wx or /usr/local/include/wx-2.8/wx. On our machine this didn't work properly. The wxPropertyGrid extension had been installed in /usr/local/include/wx/propgrid/ instead. Moving it manually to the right place helped.<br />
<br />
<pre class="coding">mv /usr/local/include/wx/propgrid/ /usr/local/include/wx-2.8/wx/propgrid/</pre><br />
=== Lua ===<br />
<br />
In the next step we are going to install the Lua language, which is used later by the Nut/OS Configurator to parse the configuration files.<br />
<br />
The Nut/OS Configurator had been tested with Lua 5.1 and may still run with either Lua 5.0 or even later versions. However, the configure script that is currently provided, will not accept anything else but version 5.1. Use the following command to install the binaries:<br />
<br />
<pre class="coding">sudo apt-get install lua5.1 liblua5.1-0 liblua5.1-0-dev</pre><br />
If it worked you can skip the rest of this chapter and continue with installing Doxygen and GraphViz.<br />
<br />
If no binary package is available for your Linux distribution, which is most unlikely by the way, you can build Lua from the source. The following explanation had been written some time ago for the version 5.0, when Lua was not as widespread as it is today. It may be of some help.<br />
<br />
Download lua-5.0.3.tar.gz from [http://www.lua.org www.lua.org] and unpack it.<br />
<br />
<pre class="coding">tar xzf lua-5.0.3.tar.gz<br />
cd lua-5.0.3/</pre><br />
The Lua source archive doesn't provide a configure script. Instead it comes with a prepared Makefile, which includes another file named config. This file allows to modify several build options. On our system the original file worked fine, but you may at least have a look to the contents.<br />
<br />
Building and installing is done in the usual way:<br />
<br />
<pre class="coding">make<br />
sudo make install</pre><br />
=== Doxygen And GraphViz ===<br />
<br />
For creating the Nut/OS API Reference Document, we need to install Doxygen and GraphViz.<br />
<br />
<pre class="coding">sudo apt-get install doxygen doxygen-doc graphviz</pre><br />
If something fails here: No big deal. The documents are also available [[api/|online]].<br />
<br />
=== Nut/OS ===<br />
<br />
Now we got everything on our Linux system to install the Nut/OS source package. Well, in fact the AVR or ARM toolchains are missing to build the Nut/OS libraries and sample applications. But this is done later with the Nut/OS Configurator and therefore the platform specific cross toolchains are not yet required.<br />
<br />
It is highly recommended to create a project directory first and then download the latest ethernut-x.y.z.tar.bz2 (or tar.gz) from the download section into this directory.<br />
<br />
<pre class="coding">mkdir ~/ethernut<br />
cd ~/ethernut<br />
wget http://www.ethernut.de/arc/ethernut-5.0.5.tar.gz<br />
tar xzf ethernut-5.0.5.tar.gz</pre><br />
We may later upgrade to a new version or we may concurrently work with different versions. Thus, it is most convenient to create a symbolic link before starting the ''configure'' script.<br />
<br />
<pre class="coding">ln -s ethernut-5.0.5 nut<br />
cd nut/<br />
./configure</pre><br />
Carefully check the output, specially the following lines:<br />
<br />
<pre class="coding">checking for doxygen... true<br />
checking for dot... true<br />
configure: nutconf tools enabled<br />
configure: nutconfgui is enabled<br />
configure: nutdisc enabled</pre><br />
If anything hasn't been enabled, refer to the addtional requirements given in the table in the first chapter of this document and make sure that they had been properly installed. However, even if not all requirements are fulfilled, you can still continue. But not all features of the development environment will be available.<br />
<br />
The next command will build tools and documentation and will take several minutes to finish.<br />
<br />
<pre class="coding">make</pre><br />
If the build fails because of wxWidgets, try<br />
<br />
<pre class="coding">./configure --disable-nutconf --disable-nutdisc<br />
make clean<br />
make</pre><br />
This will only build the Qt and the command line versions of the Configurator.<br />
<br />
By default<br />
<br />
<pre class="coding">sudo make install</pre><br />
should install five executables<br />
<br />
* crurom, UROM file system creator<br />
* nutconfigure, Nut/OS Configurator for the command line<br />
* qnutconf, full fledged Nut/OS Configurator GUI, based on Qt4<br />
* nutconf, same as above, but based on wxWidgets<br />
* nutdisc, Nut/OS Discoverer<br />
<br />
in a global directory, typically /usr/local/bin/.<br />
<br />
== Installation With Command Line Tools Only ==<br />
<br />
In case you experience problems with GTK+ or wxWidgets, or simply refuse to use GUI tools for building embedded applications, you can install a reduced version. Beside GUI gimmicks, you won't miss anything important.<br />
<br />
Install the same packages as described in the full installation, but completely skip the wxWidget part.<br />
<br />
After downloading and unpacking Nut/OS source code package, configure it with two additional parameters.<br />
<br />
<pre class="coding">cd ~/ethernut/nut/<br />
./configure --disable-nutconf-gui --disable-html-docs<br />
make<br />
sudo make install</pre><br />
== Minimal Installation ==<br />
<br />
Even if all fails, there is still hope: Try the bare minimum! In fact you can simply use the raw unpacked sources.<br />
<br />
Create a project directory and download the latest ethernut-x.y.z.tar.bz2 (or tar.gz) from the download section into this directory.<br />
<br />
<pre class="coding">mkdir ~/ethernut<br />
cd ~/ethernut<br />
wget -N http://www.ethernut.de/arc/ethernut-5.0.5.tar.gz</pre><br />
When downloaded, unpack the Ethernut source package.<br />
<br />
<pre class="coding">tar xzf ethernut-5.0.5.tar.gz</pre><br />
Now create a symbolic link to the unpacked sources, change to this new directory and run ''nutsetup'' to configure Nut/OS for your target board.<br />
<br />
<pre class="coding">ln -s ethernut-5.0.5 nut<br />
cd nut/<br />
./nutsetup</pre><br />
The nutsetup script will create a file named UserConf.mk used by make and will create a link of Makedefs, Makerules, app/Makedefs and app/Makerules to the platform specific files. For the AVR platform the link will point to Makedefs.avr-gcc, Makerules.avr-gcc, app/Makedefs.avr-gcc and app/Makerules.avr-gcc resp. For the Nut/OS emulation on UNIX, it will also create some wrapper header files in directory include/.<br />
<br />
After this, everything is ready to build Nut/OS in the source tree. We will explain this later.<br />
<br />
However, some applications, e.g. ''basemon'' or ''httpd'' require ''crurom'' to build an UROM file system image. Try<br />
<br />
<pre class="coding">./configure --disable-nutconf-tools --disable-html-docs<br />
make<br />
sudo make install</pre><br />
Even if this fails, you can still build most application samples.<br />
<br />
== Cross Toolchain ==<br />
<br />
To create any binaries for our AVR or ARM target system, we need to install the related cross toolchain.<br />
<br />
=== AVR Toolchain ===<br />
<br />
For the 8-bit AVR platform use<br />
<br />
<pre class="coding">sudo apt-get install binutils-avr gcc-avr avr-libc avrdude</pre><br />
=== ARM Toolchain ===<br />
<br />
Unfortunately there is no official binary package available. You may try to build the toolchain from the official sources.<br />
<br />
== Nut/OS Libraries ==<br />
<br />
The way we build Nut/OS libraries depends on the tools, which are available from the installation described above.<br />
<br />
=== Using the Configurator GUI ===<br />
<br />
Change to the Ethernut project directory and start the Configurator.<br />
<br />
<pre class="coding">cd ~/ethernut/<br />
nutconf</pre><br />
Now follow the [[../../pdf/enswm28e.pdf|Nut/OS Software Manual]] to build Nut/OS and the related sample applications.<br />
<br />
=== Using the Configurator CLI ===<br />
<br />
Change to the Ethernut project directory and enter the following command to display the usage help for the Configurator's command line interface.<br />
<br />
<pre class="coding">cd ~/ethernut/<br />
nutconfigure -?</pre><br />
<pre class="coding">Usage: nutconfigure OPTIONS ACTIONS<br />
OPTIONS:<br />
-a&lt;dir&gt; application directory (./nutapp)<br />
-b&lt;dir&gt; build directory (./nutbld)<br />
-c&lt;file&gt; configuration file (./nut/conf/ethernut21b.conf)<br />
-i&lt;dir&gt; first include path ()<br />
-j&lt;dir&gt; last include path ()<br />
-l&lt;dir&gt; library directory ()<br />
-m&lt;type&gt; target platform (avr-gcc)<br />
-p&lt;type&gt; programming adapter (avr-dude)<br />
-q quiet (verbose)<br />
-s&lt;dir&gt; source directory (./nut)<br />
-r&lt;file&gt; repository (./nut/conf/repository.nut)<br />
ACTIONS:<br />
create-buildtree<br />
create-apptree</pre><br />
The document [[../tools/commandline.html|Nut/OS development for purists]] explains the whole process.<br />
<br />
=== Building in the Source Tree ===<br />
<br />
'''Today, building in the source tree is seldom used, currently not maintained and considered broken.'''<br />
<br />
With the minimal installation it is necessary to build Nut/OS libraries and applications directly in the source tree. It is assumed, that you already ran the ''nutsetup'' script to configure Nut/OS for a specific target board.<br />
<br />
Change to the subdirectory ''lib'' within the source tree and run ''make''.<br />
<br />
<pre class="coding">cd ~/ethernut/nut/lib/<br />
make clean install</pre><br />
Although simple, most developers prefer to use the Configurator nowadays. Therefore, building in the source tree is not always properly maintained. If your build fails, it is probably caused by a missing or outdated source file entry in the related Makefile. You can easily fix this by updating the Makefile with a text editor. Just make sure that your editor will preserve tabs. We will give an example.<br />
<br />
The build for Ethernut 2.1 fails with the following error:<br />
<br />
<pre class="coding">make[1]: *** No rule to make target `httpdopt.o', needed by `libnutpro.a'. Stop.<br />
make[1]: Leaving directory `/home/harald/ethernut/ethernut-4.7.3/pro'<br />
make: *** [install] Error 2</pre><br />
Change to the directory where the problem occured (remember that we use the symbolic link ''nut'') and load the Makefile into an editor.<br />
<br />
<pre class="coding">cd ~/ethernut/nut/pro/<br />
vi Makefile</pre><br />
We can see, that ''httpdopt.c'' is in the Makefile, but no such file exists in the current directory. Instead a file named ''httpopt.c'' (without letter d) exists. After correcting the Makefile, the error is gone.<br />
<br />
Applications are build in the source tree in a similar way.<br />
<br />
<pre class="coding">cd ~/ethernut/nut/app/events/<br />
make clean all</pre><br />
== Getting Nut/OS from Subversion ==<br />
<br />
Instead of downloading the source package, you may retrieve the latest updates from the SVN repository.<br />
<br />
<pre class="coding">mkdir ~/ethernut<br />
cd ~/ethernut<br />
svn co https://ethernut.svn.sourceforge.net/svnroot/ethernut/branches/nut-4_8-branch ethernut-4.8<br />
ln -s ethernut-4.8 nut<br />
cd nut</pre><br />
If you want to try the latest code, use:<br />
<br />
<pre class="coding">cd ~/ethernut<br />
svn co https://ethernut.svn.sourceforge.net/svnroot/ethernut/trunk ethernut-trunk<br />
ln -s ethernut-trunk nut<br />
cd nut</pre><br />
A script named ''reconf'' had been prepared to run the autotools. Run it now.<br />
<br />
<pre class="coding">./reconf</pre><br />
The CVS repository will never contain any files, which can be created locally. This is also true for some default files used by automake. Thus, after checking out the module for the first time, ''reconf'' will fail. To fix this, run<br />
<br />
<pre class="coding">automake --add-missing</pre><br />
and then run ''./reconf'' again. We are now ready to configure, build and install the Nut/OS tools.<br />
<br />
<pre class="coding">./configure<br />
make<br />
sudo make install</pre><br />
To keep up with the latest changes, use the following commands.<br />
<br />
<pre class="coding">cd ~/ethernut/nut<br />
svn update</pre><br />
== Related Links ==<br />
<br />
[http://packages.debian.org/testing/devel/ packages.debian.org/testing/devel]<br /><br />
Devel section of Debian software packages in the testing distribution.<br />
<br />
[http://www.alphapogo.de www.alphapogo.de]<br /><br />
How to setup the GNU Arm toolchain on (K)Ubuntu Linux (in lax German).<br />
<br />
[http://wiki.debian.org/Crosstool wiki.debian.org/Crosstool]<br /><br />
Quick and dirty hack to bundle crosstool output into .tgz and .deb packages.<br />
<br />
[http://www.rowley.co.uk/arm/ www.rowley.co.uk/arm/]<br /><br />
Commercially supported toolchain (may not be suitable for Nut/OS yet).<br />
<br />
[http://www.inf.u-szeged.hu/gcc-arm/ www.inf.u-szeged.hu/gcc-arm/]<br /><br />
GCC ARM Improvement Project.<br />
<br />
[http://www.es-business.com/ethernut/eng/rhel4.php www.es-business.com/ethernut/eng/rhel4.php]<br /><br />
Nut/OS development on Red Hat Enterprise Linux 4 (RHEL4).<br />
<br />
[http://www.geisterstunde.org/drupal/?q=ethernut_gentoo www.geisterstunde.org/drupal/]<br /><br />
Ethernut Setup with Gentoo.<br />
<br />
[http://www.btnode.ethz.ch/Documentation/LinuxInstall www.btnode.ethz.ch/Documentation/LinuxInstall]<br /><br />
BTnut Development Tools - Linux Installation.<br />
<br />
[http://www.ethernut.de/nutwiki/Installing_NutOS_developement_environment_on_Debian_Etch Nut/OS on Debian Etch]<br /><br />
Some additional notes in the NutWiki.<br />
<br />
<br /><br />
<br /><br />
<br />
Good luck,<br /><br />
Harald Kipp<br /><br />
<br /><br />
Castrop-Rauxel, 21st of June 2009<br />
<br />
<br />
</div></div>Uwehttp://www.ethernut.de/nutwiki/index.php?title=Documents/Development_on_Debian&diff=441Documents/Development on Debian2017-07-13T15:46:19Z<p>Uwe: /* Nut/OS Development on Debian [Logo] */ Link to ARM arm-none-eabi</p>
<hr />
<div><div id="content"><br />
<br />
= Nut/OS Development on Debian [[File:debian-logo.png|[Logo]]] =<br />
<br />
Currently there's no binary package available for Debian. Thus, you need to build the Nut/OS development environment from the source package.<br />
<br />
This document will explain, how to install all tools you need to create Nut/OS applications on a Debian Linux PC. In general, this should also work for other Unix-like operating systems, including Mac OS X.<br />
<br />
== Short Version ==<br />
<br />
If you are an experienced user and refuse to read lengthy descriptions, then you may try the following command sequence:<br />
<br />
<pre class="coding">sudo apt-get install automake autoconf<br />
sudo apt-get install libtool<br />
sudo apt-get install build-essential<br />
sudo apt-get install doxygen doxygen-doc graphviz<br />
sudo apt-get install lua5.1 liblua5.1-0 liblua5.1-0-dev<br />
sudo apt-get install libgtk2.0-dev<br />
sudo apt-get install libqtcore4 libqtgui4 libqt4-dev<br />
mkdir ~/ethernut<br />
cd ~/ethernut<br />
wget http://www.ethernut.de/arc/ethernut-5.0.5.tar.gz<br />
tar xzf ethernut-5.0.5.tar.gz<br />
ln -s ethernut-5.0.5 nut<br />
cd nut/<br />
./configure<br />
make<br />
sudo make install</pre><br />
Next install the cross compiler toolchain for your target system. For AVR boards this is simple:<br />
<br />
<pre class="coding">sudo apt-get install binutils-avr gcc-avr avr-libc avrdude</pre><br />
For ARM based target boards we recommend the [https://developer.arm.com/open-source/gnu-toolchain/gnu-rm arm-none-eabi toolchain] provided by ARM.<br />
<br />
For other targets you can build the toolchain from the source code. Several resources are available in the Internet to help with this.<br />
<br />
When done, start the Configurator...<br />
<br />
<pre class="coding">cd ~/ethernut/<br />
qnutconf &amp;</pre><br />
and follow the [[../../pdf/enswm28e.pdf|Nut/OS Software Manual]].<br />
<br />
== Requirements ==<br />
<br />
Before delving into the details of the installation, we will give a first overview.<br />
<br />
The following GNU tools are required to configure and build a minimal Nut/OS development environment:<br />
<br />
* C compiler 4.1 or later<br />
* Binutils 2.18 or later<br />
* Autoconf 2.61<br />
* Automake 1.10<br />
<br />
Furthermore, you need a so called ''cross toolchain'', which allows us to create binaries on a Linux host, which will later run on our target board. When developing for 8-bit AVR, we need<br />
<br />
* GNU Compiler Collection for AVR<br />
* GNU Binary Utilities for AVR<br />
* AVRDUDE programmer software<br />
<br />
while for 32-bit ARM development the following tools are recommended<br />
<br />
* GNU Compiler Collection for ARM<br />
* GNU Binary Utilities for ARM<br />
* OpenOCD for JTAG programming and debugging<br />
<br />
You have the choice to install different options of the development environment. Depending on this, additional tools may be required, as shown in the following table.<br />
<br />
{| class="wikitable"<br />
!width="25%"| Module<br />
!width="25%"| Provisions<br />
!width="25%"| Additional Requirements<br />
!width="25%"| Exclude with<br />
|-<br />
| Nut/OS Sources<br /><br />
'''(mandatory)'''<br />
|<br />
Target selection via shell script<br />
Configurable by editing C header files<br />
Tool for creating simple file system images<br />
| None<br />
| Always enabled<br />
|-<br />
| CLI Configurator<br /><br />
'''(recommended)'''<br />
|<br />
Multiple build and application trees<br />
Automated script based target configuration<br />
Batch build<br />
| Lua 5.1 libraries<br />
| <br />
|-<br />
| UROM Image Creator<br /><br />
'''(recommended)'''<br />
| Creates simple filesystem images<br />
| C compiler<br />
| --disable-crurom<br />
|-<br />
| GUI Configurator<br /><br />
wxWidgets version<br /><br />
(optional)<br />
|<br />
Easy to use configuration interface<br />
Multiple build and application trees<br />
Automated script based target configuration<br />
|<br />
Lua 5.1 libraries<br />
wxWidgets 2.9 libraries<br />
GNU C++ compiler<br />
| --disable-nutconf<br />
|-<br />
| GUI Configurator<br /><br />
Qt version<br /><br />
(optional)<br />
|<br />
Easy to use configuration interface<br />
Multiple build and application trees<br />
Automated script based target configuration<br />
|<br />
Lua 5.1 libraries<br />
Qt4 libraries<br />
GNU C++ compiler<br />
| --disable-qnutconf<br />
|-<br />
| GUI Discoverer<br /><br />
wxWidgets version<br /><br />
(optional)<br />
|<br />
Scans local and remote networks for Nut/OS nodes<br />
Remote configuration of Nut/OS nodes<br />
|<br />
wxWidgets 2.9.3 libraries<br />
GNU C++ compiler<br />
| --disable-nutdisc<br />
|-<br />
| GUI Discoverer<br /><br />
Qt version<br /><br />
(optional)<br />
|<br />
Scans local networks for Nut/OS nodes<br />
Remote configuration of Nut/OS nodes<br />
|<br />
Qt4 libraries<br />
GNU C++ compiler<br />
| Disabled by default<br />
|-<br />
| API Reference<br /><br />
(optional)<br />
| HTML document created from source code<br />
|<br />
Doxygen 1.4 or later<br />
GraphViz 2.2 or later<br />
| --disable-html-docs<br />
|}<br />
<br />
[http://www.lua.org/ Lua] is an embeddable scripting language, which is used here to specify the configuration rules.<br />
<br />
[http://www.wxwidgets.org/ wxWidgets] is a cross-platform C++ GUI framework.<br />
<br />
[http://www.doxygen.org/ Doxygen] and [http://www.graphviz.org/ GraphViz] are used to automatically create a Nut/OS API reference from the C source files.<br />
<br />
It's recommended to try the full installation first. If it fails for some reason, you may step down to a less complete environment.<br />
<br />
== Full Installation ==<br />
<br />
=== Build Essentials ===<br />
<br />
Most Debian distributions offer to install all basic tools for building Linux applications in one step:<br />
<br />
<pre class="coding">sudo apt-get install build-essential</pre><br />
If that doesn't work for you, we will show below, how to install them separately.<br />
<br />
Check the version of the GNU Compiler Collection installed on your PC. Note, that this compiler is needed to create binaries, which will run on Linux. Code for AVR or ARM targets is created by the cross compiler, which will be installed later.<br />
<br />
<pre class="coding">$ gcc --version<br />
gcc (GCC) 4.3.3<br />
$ g++ --version<br />
g++ (GCC) 4.3.3</pre><br />
Actually the version is not critical. Previous versions should work fine. Typically, newer releases of the GNU compiler are more strict about code compliance and may emit warnings or even error messages.<br />
<br />
To install or upgrade, use<br />
<br />
<pre class="coding">sudo apt-get install gcc g++</pre><br />
Next you need to make sure to have a recent version of the GNU autotools installed.<br />
<br />
<pre class="coding">$ autoconf --version<br />
autoconf (GNU Autoconf) 2.63<br />
$ automake --version<br />
automake (GNU automake) 1.10.2</pre><br />
To install or upgrade, use<br />
<pre class="coding">sudo apt-get install automake autoconf</pre><br />
=== wxWidgets ===<br />
<br />
The recent configuration of the Nut/OS tools requires at least wxWidgets version 2.9.3. It will definitely not work with earlier versions. At the time of this writing this version is not available as a binary package. You have to build it from the sources. This is a bit time consuming, but works straightforward.<br />
<br />
First, make sure that you have installed the GCC toolchain and the GTK 2.0 libraries.<br />
<br />
<pre class="coding">sudo apt-get install build-essential libgtk2.0-dev</pre><br />
Next, you can download and unpackk the wxWidgets 2.9.3 source code.<br />
<br />
<pre class="coding">wget -r -nd http://tenet.dl.sourceforge.net/project/wxwindows/2.9.3/wxWidgets-2.9.3.tar.bz2<br />
tar xjf wxWidgets-2.9.3.tar.bz2</pre><br />
To avoid later problems with shared libraries and other features, we prefer to build a very basic version. However, shared libraries and unicode builds may work for you. In any case, we recommend to create a build directory first.<br />
<br />
<pre class="coding">cd wxWidgets-2.9.3/<br />
mkdir build-GTK<br />
cd build-GTK<br />
../configure --with-gtk --disable-debug --disable-shared --disable-unicode</pre><br />
Building the libraries is done in a second step. Be prepared that this takes at least several minutes.<br />
<br />
<pre class="coding">make</pre><br />
As usual, the binaries are finally installed with<br />
<br />
<pre class="coding">sudo make install<br />
sudo ldconfig</pre><br />
You may now test the installation by trying the AUI sample.<br />
<br />
<pre class="coding">cd ../samples/aui<br />
make -f makefile.unx<br />
./auidemo</pre><br />
The last command should open a sample application window with dockable toolbars. This means the wxWidgets installation is working.<br />
<br />
=== wxPropertyGrid ===<br />
<br />
The Nut/OS Discoverer is based on a wxWidgets extension called wxPropertyGrid. For earlier versions of wxWidgets it was required to install it separately. Now it has become part of the official wxWidgets distribution. Nevertheless, we keep the related installation instructions for archival purposes.<br />
<br />
Like most wxWidgets extensions, wxPropertyGrid is available in source code and must be applied to the wxWidgets source code package.<br />
<br />
Create a temporary directory and change to it.<br />
<br />
<pre class="coding">mkdir ~/propgrid<br />
cd ~/propgrid</pre><br />
Next download and unpack the source code archive in that directory.<br />
<br />
<pre class="coding">wget http://ovh.dl.sourceforge.net/sourceforge/wxpropgrid/wxpropgrid-1.4.5-src.tar.gz<br />
tar xzf wxpropgrid-1.4.5-src.tar.gz</pre><br />
Now run the standard command sequence to apply wxPropertyGrid to your wxWidgets source tree.<br />
<br />
<pre class="coding">cd propgrid/<br />
./configure --disable-share<br />
make<br />
sudo make install</pre><br />
This should install the package in /usr/include/wx-2.8/wx or /usr/local/include/wx-2.8/wx. On our machine this didn't work properly. The wxPropertyGrid extension had been installed in /usr/local/include/wx/propgrid/ instead. Moving it manually to the right place helped.<br />
<br />
<pre class="coding">mv /usr/local/include/wx/propgrid/ /usr/local/include/wx-2.8/wx/propgrid/</pre><br />
=== Lua ===<br />
<br />
In the next step we are going to install the Lua language, which is used later by the Nut/OS Configurator to parse the configuration files.<br />
<br />
The Nut/OS Configurator had been tested with Lua 5.1 and may still run with either Lua 5.0 or even later versions. However, the configure script that is currently provided, will not accept anything else but version 5.1. Use the following command to install the binaries:<br />
<br />
<pre class="coding">sudo apt-get install lua5.1 liblua5.1-0 liblua5.1-0-dev</pre><br />
If it worked you can skip the rest of this chapter and continue with installing Doxygen and GraphViz.<br />
<br />
If no binary package is available for your Linux distribution, which is most unlikely by the way, you can build Lua from the source. The following explanation had been written some time ago for the version 5.0, when Lua was not as widespread as it is today. It may be of some help.<br />
<br />
Download lua-5.0.3.tar.gz from [http://www.lua.org www.lua.org] and unpack it.<br />
<br />
<pre class="coding">tar xzf lua-5.0.3.tar.gz<br />
cd lua-5.0.3/</pre><br />
The Lua source archive doesn't provide a configure script. Instead it comes with a prepared Makefile, which includes another file named config. This file allows to modify several build options. On our system the original file worked fine, but you may at least have a look to the contents.<br />
<br />
Building and installing is done in the usual way:<br />
<br />
<pre class="coding">make<br />
sudo make install</pre><br />
=== Doxygen And GraphViz ===<br />
<br />
For creating the Nut/OS API Reference Document, we need to install Doxygen and GraphViz.<br />
<br />
<pre class="coding">sudo apt-get install doxygen doxygen-doc graphviz</pre><br />
If something fails here: No big deal. The documents are also available [[api/|online]].<br />
<br />
=== Nut/OS ===<br />
<br />
Now we got everything on our Linux system to install the Nut/OS source package. Well, in fact the AVR or ARM toolchains are missing to build the Nut/OS libraries and sample applications. But this is done later with the Nut/OS Configurator and therefore the platform specific cross toolchains are not yet required.<br />
<br />
It is highly recommended to create a project directory first and then download the latest ethernut-x.y.z.tar.bz2 (or tar.gz) from the download section into this directory.<br />
<br />
<pre class="coding">mkdir ~/ethernut<br />
cd ~/ethernut<br />
wget http://www.ethernut.de/arc/ethernut-5.0.5.tar.gz<br />
tar xzf ethernut-5.0.5.tar.gz</pre><br />
We may later upgrade to a new version or we may concurrently work with different versions. Thus, it is most convenient to create a symbolic link before starting the ''configure'' script.<br />
<br />
<pre class="coding">ln -s ethernut-5.0.5 nut<br />
cd nut/<br />
./configure</pre><br />
Carefully check the output, specially the following lines:<br />
<br />
<pre class="coding">checking for doxygen... true<br />
checking for dot... true<br />
configure: nutconf tools enabled<br />
configure: nutconfgui is enabled<br />
configure: nutdisc enabled</pre><br />
If anything hasn't been enabled, refer to the addtional requirements given in the table in the first chapter of this document and make sure that they had been properly installed. However, even if not all requirements are fulfilled, you can still continue. But not all features of the development environment will be available.<br />
<br />
The next command will build tools and documentation and will take several minutes to finish.<br />
<br />
<pre class="coding">make</pre><br />
If the build fails because of wxWidgets, try<br />
<br />
<pre class="coding">./configure --disable-nutconf --disable-nutdisc<br />
make clean<br />
make</pre><br />
This will only build the Qt and the command line versions of the Configurator.<br />
<br />
By default<br />
<br />
<pre class="coding">sudo make install</pre><br />
should install five executables<br />
<br />
* crurom, UROM file system creator<br />
* nutconfigure, Nut/OS Configurator for the command line<br />
* qnutconf, full fledged Nut/OS Configurator GUI, based on Qt4<br />
* nutconf, same as above, but based on wxWidgets<br />
* nutdisc, Nut/OS Discoverer<br />
<br />
in a global directory, typically /usr/local/bin/.<br />
<br />
== Installation With Command Line Tools Only ==<br />
<br />
In case you experience problems with GTK+ or wxWidgets, or simply refuse to use GUI tools for building embedded applications, you can install a reduced version. Beside GUI gimmicks, you won't miss anything important.<br />
<br />
Install the same packages as described in the full installation, but completely skip the wxWidget part.<br />
<br />
After downloading and unpacking Nut/OS source code package, configure it with two additional parameters.<br />
<br />
<pre class="coding">cd ~/ethernut/nut/<br />
./configure --disable-nutconf-gui --disable-html-docs<br />
make<br />
sudo make install</pre><br />
== Minimal Installation ==<br />
<br />
Even if all fails, there is still hope: Try the bare minimum! In fact you can simply use the raw unpacked sources.<br />
<br />
Create a project directory and download the latest ethernut-x.y.z.tar.bz2 (or tar.gz) from the download section into this directory.<br />
<br />
<pre class="coding">mkdir ~/ethernut<br />
cd ~/ethernut<br />
wget -N http://www.ethernut.de/arc/ethernut-5.0.5.tar.gz</pre><br />
When downloaded, unpack the Ethernut source package.<br />
<br />
<pre class="coding">tar xzf ethernut-5.0.5.tar.gz</pre><br />
Now create a symbolic link to the unpacked sources, change to this new directory and run ''nutsetup'' to configure Nut/OS for your target board.<br />
<br />
<pre class="coding">ln -s ethernut-5.0.5 nut<br />
cd nut/<br />
./nutsetup</pre><br />
The nutsetup script will create a file named UserConf.mk used by make and will create a link of Makedefs, Makerules, app/Makedefs and app/Makerules to the platform specific files. For the AVR platform the link will point to Makedefs.avr-gcc, Makerules.avr-gcc, app/Makedefs.avr-gcc and app/Makerules.avr-gcc resp. For the Nut/OS emulation on UNIX, it will also create some wrapper header files in directory include/.<br />
<br />
After this, everything is ready to build Nut/OS in the source tree. We will explain this later.<br />
<br />
However, some applications, e.g. ''basemon'' or ''httpd'' require ''crurom'' to build an UROM file system image. Try<br />
<br />
<pre class="coding">./configure --disable-nutconf-tools --disable-html-docs<br />
make<br />
sudo make install</pre><br />
Even if this fails, you can still build most application samples.<br />
<br />
== Cross Toolchain ==<br />
<br />
To create any binaries for our AVR or ARM target system, we need to install the related cross toolchain.<br />
<br />
=== AVR Toolchain ===<br />
<br />
For the 8-bit AVR platform use<br />
<br />
<pre class="coding">sudo apt-get install binutils-avr gcc-avr avr-libc avrdude</pre><br />
=== ARM Toolchain ===<br />
<br />
Unfortunately there is no official binary package available. You may try to build the toolchain from the official sources.<br />
<br />
== Nut/OS Libraries ==<br />
<br />
The way we build Nut/OS libraries depends on the tools, which are available from the installation described above.<br />
<br />
=== Using the Configurator GUI ===<br />
<br />
Change to the Ethernut project directory and start the Configurator.<br />
<br />
<pre class="coding">cd ~/ethernut/<br />
nutconf</pre><br />
Now follow the [[../../pdf/enswm28e.pdf|Nut/OS Software Manual]] to build Nut/OS and the related sample applications.<br />
<br />
=== Using the Configurator CLI ===<br />
<br />
Change to the Ethernut project directory and enter the following command to display the usage help for the Configurator's command line interface.<br />
<br />
<pre class="coding">cd ~/ethernut/<br />
nutconfigure -?</pre><br />
<pre class="coding">Usage: nutconfigure OPTIONS ACTIONS<br />
OPTIONS:<br />
-a&lt;dir&gt; application directory (./nutapp)<br />
-b&lt;dir&gt; build directory (./nutbld)<br />
-c&lt;file&gt; configuration file (./nut/conf/ethernut21b.conf)<br />
-i&lt;dir&gt; first include path ()<br />
-j&lt;dir&gt; last include path ()<br />
-l&lt;dir&gt; library directory ()<br />
-m&lt;type&gt; target platform (avr-gcc)<br />
-p&lt;type&gt; programming adapter (avr-dude)<br />
-q quiet (verbose)<br />
-s&lt;dir&gt; source directory (./nut)<br />
-r&lt;file&gt; repository (./nut/conf/repository.nut)<br />
ACTIONS:<br />
create-buildtree<br />
create-apptree</pre><br />
The document [[../tools/commandline.html|Nut/OS development for purists]] explains the whole process.<br />
<br />
=== Building in the Source Tree ===<br />
<br />
'''Today, building in the source tree is seldom used, currently not maintained and considered broken.'''<br />
<br />
With the minimal installation it is necessary to build Nut/OS libraries and applications directly in the source tree. It is assumed, that you already ran the ''nutsetup'' script to configure Nut/OS for a specific target board.<br />
<br />
Change to the subdirectory ''lib'' within the source tree and run ''make''.<br />
<br />
<pre class="coding">cd ~/ethernut/nut/lib/<br />
make clean install</pre><br />
Although simple, most developers prefer to use the Configurator nowadays. Therefore, building in the source tree is not always properly maintained. If your build fails, it is probably caused by a missing or outdated source file entry in the related Makefile. You can easily fix this by updating the Makefile with a text editor. Just make sure that your editor will preserve tabs. We will give an example.<br />
<br />
The build for Ethernut 2.1 fails with the following error:<br />
<br />
<pre class="coding">make[1]: *** No rule to make target `httpdopt.o', needed by `libnutpro.a'. Stop.<br />
make[1]: Leaving directory `/home/harald/ethernut/ethernut-4.7.3/pro'<br />
make: *** [install] Error 2</pre><br />
Change to the directory where the problem occured (remember that we use the symbolic link ''nut'') and load the Makefile into an editor.<br />
<br />
<pre class="coding">cd ~/ethernut/nut/pro/<br />
vi Makefile</pre><br />
We can see, that ''httpdopt.c'' is in the Makefile, but no such file exists in the current directory. Instead a file named ''httpopt.c'' (without letter d) exists. After correcting the Makefile, the error is gone.<br />
<br />
Applications are build in the source tree in a similar way.<br />
<br />
<pre class="coding">cd ~/ethernut/nut/app/events/<br />
make clean all</pre><br />
== Getting Nut/OS from Subversion ==<br />
<br />
Instead of downloading the source package, you may retrieve the latest updates from the SVN repository.<br />
<br />
<pre class="coding">mkdir ~/ethernut<br />
cd ~/ethernut<br />
svn co https://ethernut.svn.sourceforge.net/svnroot/ethernut/branches/nut-4_8-branch ethernut-4.8<br />
ln -s ethernut-4.8 nut<br />
cd nut</pre><br />
If you want to try the latest code, use:<br />
<br />
<pre class="coding">cd ~/ethernut<br />
svn co https://ethernut.svn.sourceforge.net/svnroot/ethernut/trunk ethernut-trunk<br />
ln -s ethernut-trunk nut<br />
cd nut</pre><br />
A script named ''reconf'' had been prepared to run the autotools. Run it now.<br />
<br />
<pre class="coding">./reconf</pre><br />
The CVS repository will never contain any files, which can be created locally. This is also true for some default files used by automake. Thus, after checking out the module for the first time, ''reconf'' will fail. To fix this, run<br />
<br />
<pre class="coding">automake --add-missing</pre><br />
and then run ''./reconf'' again. We are now ready to configure, build and install the Nut/OS tools.<br />
<br />
<pre class="coding">./configure<br />
make<br />
sudo make install</pre><br />
To keep up with the latest changes, use the following commands.<br />
<br />
<pre class="coding">cd ~/ethernut/nut<br />
svn update</pre><br />
== Related Links ==<br />
<br />
[http://packages.debian.org/testing/devel/ packages.debian.org/testing/devel]<br /><br />
Devel section of Debian software packages in the testing distribution.<br />
<br />
[http://www.alphapogo.de www.alphapogo.de]<br /><br />
How to setup the GNU Arm toolchain on (K)Ubuntu Linux (in lax German).<br />
<br />
[http://wiki.debian.org/Crosstool wiki.debian.org/Crosstool]<br /><br />
Quick and dirty hack to bundle crosstool output into .tgz and .deb packages.<br />
<br />
[http://www.rowley.co.uk/arm/ www.rowley.co.uk/arm/]<br /><br />
Commercially supported toolchain (may not be suitable for Nut/OS yet).<br />
<br />
[http://www.inf.u-szeged.hu/gcc-arm/ www.inf.u-szeged.hu/gcc-arm/]<br /><br />
GCC ARM Improvement Project.<br />
<br />
[http://www.es-business.com/ethernut/eng/rhel4.php www.es-business.com/ethernut/eng/rhel4.php]<br /><br />
Nut/OS development on Red Hat Enterprise Linux 4 (RHEL4).<br />
<br />
[http://www.geisterstunde.org/drupal/?q=ethernut_gentoo www.geisterstunde.org/drupal/]<br /><br />
Ethernut Setup with Gentoo.<br />
<br />
[http://www.btnode.ethz.ch/Documentation/LinuxInstall www.btnode.ethz.ch/Documentation/LinuxInstall]<br /><br />
BTnut Development Tools - Linux Installation.<br />
<br />
[http://www.ethernut.de/nutwiki/Installing_NutOS_developement_environment_on_Debian_Etch Nut/OS on Debian Etch]<br /><br />
Some additional notes in the NutWiki.<br />
<br />
<br /><br />
<br /><br />
<br />
Good luck,<br /><br />
Harald Kipp<br /><br />
<br /><br />
Castrop-Rauxel, 21st of June 2009<br />
<br />
<br />
</div></div>Uwe