http://wiki.paparazziuav.org/w/api.php?action=feedcontributions&user=NeoFromMatrix&feedformat=atomPaparazziUAV - User contributions [en]2024-03-29T11:25:45ZUser contributionsMediaWiki 1.37.1http://wiki.paparazziuav.org/w/index.php?title=Installation/FromScratch&diff=23376Installation/FromScratch2016-11-06T21:09:18Z<p>NeoFromMatrix: /* Fedora 24 */ still need some ugly hacks to get it working...</p>
<hr />
<div><categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Installation</categorytree><br />
__TOC__<br />
<br />
'''Users of recent Debian/Ubuntu distributions are advised to use the binary packages as described in [[Installation/Linux]].'''<br />
<br />
<span style="color:#FF0000">'''WARNING! Only use if you are proficient in working with Linux!'''</span><br />
<br />
== Intro ==<br />
<br />
Users of other Linux flavors or anyone needing manual control of each individual package can install them independently. <br/><br />
The list of dependencies of the Debian package is located in the [https://github.com/paparazzi/paparazzi-portability-support/blob/master/debian/paparazzi-dev/debian/control <tt>debian/control</tt>] file and may help users of other distributions.<br />
<br />
Some corresponding source tarballs can be downloaded from [https://launchpad.net/~paparazzi-uav/+archive/ppa/+packages paparazzi-uav ppa] on launchpad. (maybe building the packages from source is more reliable in view of dependencies)<br />
<br />
For distributions using RPM packaging, the [http://packages.debian.org/unstable/source/alien alien] tool can be used to convert a .deb package into a .rpm package.<br />
<br />
As with all Wiki pages, also this page is a work in progress. Try to be a big help to the Paparazzi project and improve this page whenever you can. If you have a distribution different from Ubuntu which doesn't satisfy any other dependency and have instructions about compiling it, packaging it, feel free to add any reference on how to do that on this wikipage.<br />
<br />
== Goal ==<br />
<br />
The goal of this page is to clarify about which version of each piece of software has to be compiled, where to find that software, patches needed to make it compile on Linux, maybe even FreeBSD or OSX.<br />
<br />
== Fedora 19 ==<br />
<br />
To build paparazzi-uav on Fedora 19, you must install the next packages from the official repository:<br />
* ocaml<br />
* ocaml-findlib<br />
* ocaml-xml-light<br />
* ocaml-ocamlnet<br />
* ocaml-lablgtk-devel<br />
* libxml2-devel<br />
* SDL-devel<br />
* libusb-devel<br />
<br />
Paparazzi-uav needs to include some ocaml headers when it compiles the simulator, then please be sure that they are included. If not, edit sw/simulator/Makefile and add:<br />
<br />
CAML_CFLAGS = -I/usr/lib64/ocaml<br />
<br />
The following packages must be built from source code (they are not included in the official repository): <br />
* ivy-c <br />
* ivy-ocaml <br />
<br />
Paparazzi-uav was successfully compiled using ivy-c 3.14 (downloaded from SVN repository, revision #3602) and ivy-ocaml 1.2. Please note that the ivy-c version is an unstable version!<br />
<br />
Additionally, you need install the next RPMs to build ivy-c:<br />
* pcre-devel<br />
* libXt-devel<br />
* tcl-devel<br />
* glib2-devel<br />
<br />
Don't forget to set the environment variable PKG_CONFIG before building ivy-ocaml, e.g:<br />
<br />
$ export PKG_CONFIG=/usr/local/lib/pkgconfig<br />
<br />
== Fedora 24 ==<br />
NOTE: Built upon Fedora 19 instruction, unnecessary instructions may occour.<br />
<br />
1. Install dependencies:<br />
$ sudo dnf install ocaml ocaml-findlib ocaml-xml-light ocaml-ocamlnet ocaml-lablgtk-devel ocaml-camlp4-devel libxml2-devel SDL-devel libusb-devel pcre-devel libXt-devel tcl-devel tk-devel glib2-devel gsl-devel<br />
<br />
2. Edit the PKG_CONFIG_PATH variable in your ~/.bashrc file to accomondate /usr/local/lib/pkgconfig/ (default for ivy libs)<br />
<br />
3. Edit all the ivy specific .pc files in /usr/local/lib/pkgconfig, changing line 3 from "libdir=${exec_prefix}/lib" to "libdir=${exec_prefix}/lib64"<br />
<br />
4. Install ivy-python via pip and compile and istall ivy-c and ivy-ocaml from source as shown [[Installation/FromScratch#IVY]]<br />
<br />
Note: dependencies for compiling ivy-c and ivy-ocaml are already covered above (except toolchain!).<br />
<br />
5. Compile and install [[JSBSim|JSBsim from source]]<br />
<br />
Hacks: Link libivy and libJSBsim after compiling<br />
$ sudo ln -s /usr/local/lib64/libivy.so /usr/local/lib64/libivy.so.3 /usr/lib<br />
$ sudo ln -s /opt/jsbsim/lib/libJSBSim.so.0 /usr/lib<br />
$ sudo ldconfig<br />
<br />
== Arch Linux ==<br />
<br />
This is a dirty hacked together (not really according to "the Arch Way") install, but works on a fresh installed Archbang GNU/Linux.<br />
<br />
'''NOTE: following issues '''<br />
# Only written and tested for Archbang and Manjaro, not tested on vanilla Arch Linux yet. <br />
# It seems that the error "unbound module GnoCanvas" can be resolved by installing lablgtk2 via yaourt first and then conf-gnomecanvas over opam.<br />
# No symlink from liblglibivy.so.3 and liblglibivy.so.3 to libglibivy.so.3.15, so can't find these files.<br />
# If pkg-config can't find some .pc files, a pkg-config path might not be set and exported properly. Use "pkg-config --variable pc_path pkg-config" to check if the path containing the ''ivy-c.pc'', ''ivy-glib.pc'' and ''ivy-tcl.pc'' files is found.<br />
# "ocamlfind: Package `netclient' not found" -> seems that the opam packages need to be installed in a specific order... (try ocamlnet first, then lablgtk.2.16) <br />
<br />
'''Requirements:'''<br />
# Up to date system<br />
#* pacman -Syyu<br />
# Install Yaourt<br />
#*https://astrofloyd.wordpress.com/2015/01/17/installing-yaourt-on-arch-linux/<br />
<br />
'''Install Paparazzi:'''<br />
# Packages base-devel, yajl and general dependencies<br />
#: <pre># pacman -S base-devel yajl subversion git libusb pcre ocaml camlp4 tcl tk python python-pip sdl glade</pre><br />
# Check if the PKG_CONFIG_PATH points to ''/usr/local/lib/pkgconfig'', otherwise set and export it<br />
#: <pre>$ echo 'export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/' >> ~/.bashrc</pre><br />
# Build and install Ivy-C from Source<br />
#: <pre>$ svn checkout https://svn.tls.cena.fr/svn/ivy/ivy-c/trunk /home/$USER/temp/ivy-c &#10;$ cd /home/$USER/temp/ivy-c/src &#10;$ make &#10;$ sudo make install</pre><br />
# '''Dirty''' All the ivy libs are installed in ''/usr/local/lib64'' and not ''/usr/local/lib'' as the .pc files point to currently. <br/><br />
#:Change in the third line (libdir) in the ivy-c.pc, ivy-glib.pc and ivy-tcl.pc file from ''lib'' to ''lib64'' and the fourth line (includedir) from ''include'' to ''include/Ivy''<br />
# '''Dirty'''For libgivy, libivy and libtclivy (.so and .so.3 ending) is a link directing to the lib with .so.3.15 availaible, but not for libglibivy. <br/><br />
#Create these links for libglibivy<br />
#: <pre>$ sudo ln -s /usr/local/lib64/libglibivy.so.3.15 /usr/local/lib64/libglibivy.so &#10;$ sudo ln -s /usr/local/lib64/libglibivy.so.3.15 /usr/local/lib64/libglibivy.so.3</pre><br />
# Install opam (OCaml packet manager) via yaourt<br />
#: <pre>$ yaourt -S opam</pre><br />
# Initialize opam<br />
#: <pre>$ opam init &#10;$ f &#10;$ ~/.bashrc &#10;$ echo 'eval `opam config env`' >> ~/.bashrc</pre><br />
# Install and pin lablgtk.2.16.0 (2.18.0 will not work)<br />
#: <pre>$ opam install -v lablgtk.2.16.0 &#10;$ opam pin add lablgtk 2.16.0</pre><br />
# Install OCaml packets via opam<br />
#: <pre>$ opam install ocamlfind ocamlnet xml-light pcre ivy</pre><br />
#: If this fails at Ivy related parts check the notes on top of this guide.<br />
# Install ivy-python via pip<br />
#: <pre>$ sudo pip install ivy-python</pre><br />
# Install the Toolchain for Paparazzi (e.g. [https://aur.archlinux.org/packages/gcc-arm-none-eabi-bin/ gcc-arm-none-eabi-bin] from the AUR)<br />
#: <pre>$ sudo pacman -S gcc-arm-none-eabi-bin</pre><br />
<br />
Optional:<br />
<br />
# Install flashing utilities if needed<br />
$ yaourt stlink-git dfu-util<br />
# Install [[JSBSim]] for [[NPS]]<br />
<br />
[[Installation#Getting_the_Source_Code|Download]] and [[Installation#Launching_the_Software|build Paparazzi]]<br />
<br />
== Installing the Cross compiler toolchain ==<br />
<br />
There are currently two different toolchains available that can be used on Linux based systems with Paparazzi. For more information see [[Installation/Linux#ARM_embedded_toolchain]]<br />
<br />
== Installing OCaml packages using OPAM ==<br />
<br />
One possibility to install and manage OCaml packages is [http://opam.ocamlpro.com/ OPAM (OCaml Package Manager)]:<br/><br />
'''Please first check the official [http://opam.ocaml.org/doc/Install.html OPAM install guide] for the simplest method.'''<br/><br />
To install it from the latest git tree run:<br />
<nowiki>git clone https://github.com/OCamlPro/opam.git</nowiki><br />
cd opam<br />
./configure && make<br />
sudo make install<br />
<br />
opam init<br />
eval `opam config env`<br />
<br />
Update your shell environment as per opam init's instructions. E.g. add to your ''~/.profile'':<br />
eval `opam config env`<br />
<br />
Build and install OCaml libs:<br />
opam install ocamlfind xml-light pcre ocamlnet<br />
opam install -v lablgtk<br />
<br />
== IVY ==<br />
<br />
IVY is a simple protocol and a set of open-source libraries and programs that allows applications to broadcast information through text messages, with a subscription mechanism based on regular expressions. The project can be found at: http://www.eei.cena.fr/products/ivy/ <br />
<br />
In the paparazzi project, Ivy is used to send telemetry data to where ever you want.<br />
<br />
NOTE: Do not confuse this IVY with the Apache Ivy project. <br />
<br />
=== Ivy-python ===<br />
<br />
The ivy-python package makes it possible to use the IVY libraries from within the Python programming language. The ivy-python package is architecture independent, so it can be downloaded from the Ubuntu or Debian paparazzi repository.<br />
<br />
The easiest way to instally it on non Debian based systems is using [https://pip.pypa.io/ pip] to install the [https://pypi.python.org/pypi/ivy-python ivy-python package] from [https://pypi.python.org/pypi PyPi - the Python Package Index].<br />
pip install ivy-python<br />
<br />
Or install from the source repository via <br />
<br />
git clone https://gitlab.com/ivybus/ivy-python.git<br />
cd ivy-python<br />
./setup.py install<br />
<br />
=== Ivy-c ===<br />
<br />
To be able to use ivy-c, the libraries need to be installed. <br />
<br />
Required packages (Debian based):<br />
* tk-dev<br />
* libpcre3-dev<br />
* libxt-dev<br />
* pkg-config<br />
* libglib2.0-dev<br />
<br />
Download source, compile and install libraries:<br />
<br />
# mkdir -p /opt/ivy-c <br />
# cd /opt/ivy-c<br />
# svn co https://svn.tls.cena.fr/svn/ivy/ivy-c/trunk<br />
# cd /opt/ivy-c/trunk/src<br />
# make<br />
# make install<br />
<br />
It is possible you get errors of the test module when compiling, just ignore the messages, it is not important for the Paparazzi project. Contact the IVY team to help them also to resolve also the testing makefile issue.<br />
<br />
==== troubleshooting ====<br />
<br />
Error message:<br />
gcc -c -O2 -Wall -Wshadow -fPIC -I/usr/include/tcl8.4 -DTCL_CHANNEL_INTEGRATION ivytcl.c<br />
ivytcl.c:28:17: fatal error: tcl.h: No such file or directory<br />
<br />
The Makefile cannot read the tcl-dev version you have installed and assumes that version 8.4 is installed, but can't find the appropriate folder.<br/><br />
Edit the line 57 of the Makefile from TCLVERS=8.4 according to your installed version, or just delete the 8.4, both work.<br />
<br />
<br />
Can't find 64bit libs:<br />
Your ivy libs were probably installed to /usr/local/lib64 and you have to make symbolic links so that they will be found:<br />
$ sudo ln -s /usr/local/lib64/libivy.so /usr/local/lib64/libivy.so.3 /usr/lib<br />
or <br />
sudo ln -s /usr/local/lib64/libivy.so /usr/local/lib64/libivy.so.3 /usr/local/lib<br />
<br />
<br />
If you get an error relating to ivytestready.c, make the following changes:<br />
mkdir /opt/ivy-c/trunk/tools/Ivy<br />
cd /opt/ivy-c/trunk/tools/Ivy<br />
cp ../../src/ivy.h .<br />
cp ../../src/ivyloop.h .<br />
cp ../../src/ivysocket.h .<br />
cp ../../src/timer.h .<br />
cd ~/develop/ivy-c/trunk/src<br />
make<br />
<br />
This copies files from the src directory to the Ivy folder in tools which did not appear after running svn above.<br />
<br />
=== Ivy-OCaml ===<br />
<br />
ivy-ocaml provides OCaml bindings for ivy-c and is needed for most of the ground segment agents that are written in OCaml like [[Server]] and [[GCS]].<br />
<br />
Download source, compile and install libraries:<br />
<br />
# mkdir -p /opt/ivy-ocaml<br />
# cd /opt/ivy-ocaml<br />
# svn co https://svn.tls.cena.fr/svn/ivy/ivy-ocaml/trunk<br />
# cd /opt/ivy-ocaml/trunk<br />
# make<br />
# make install<br />
<br />
==== ivy-ocaml via OPAM ====<br />
Or use OPAM: While the source repository and debian package is named ''ivy-ocaml'', in OPAM it is only named ''ivy'' (since it is obviously for OCaml).<br />
<br />
$ opam update<br />
$ opam install ivy<br />
<br />
== LPC21ISP ==<br />
<br />
lpc21isp is only needed to serially flash the LPC2148 based autopilots (e.g. [[Lpc21BootloaderUpload bootloader]] for tiny, twog, umarim). LPC21ISP is an in-circuit programming (ISP) tool for the microcontroller used on the Paparazzi autopilot boards. The lpc21isp project is hosted on sourceforge and one can find the source packages and information at http://sourceforge.net/projects/lpc21isp/ <br />
<br />
Get the SVN version via<br />
<br />
$ mkdir -p /opt/lpc21isp<br />
$ cd /opt/lpc21isp<br />
$ svn co https://lpc21isp.svn.sourceforge.net/svnroot/lpc21isp lpc21<br />
<br />
To compile go into the source directory and then do<br />
<br />
$ cd lpc21<br />
$ make -f Makefile clean all<br />
<br />
To install<br />
<br />
$ exportline="PATH=$PATH:/opt/lpc21isp"<br />
$ if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi<br />
$ source ~/.profile<br />
<br />
== Paparazzi-dev Debian/Ubuntu packages ==<br />
<br />
For Ubuntu users, you can install the following packages from standard repository. You can just copy the line(s) and paste into your terminal. But do not copy the $ sign, this symbol is just added on this page to show that it is to be pasted at a normal terminal prompt.<br />
<br />
=== Whole lot in one ===<br />
<br />
sudo apt-get install ocaml libcamlimages-ocaml liblablgtk2-ocaml-dev liblablgtk2-gl-ocaml-dev \<br />
liblablgtk2-gnome-ocaml-dev libxml-light-ocaml-dev libocamlnet-ocaml-dev libpcre-ocaml \<br />
libpcre-ocaml-dev libgnomecanvas2-0 libgnomecanvas2-dev libglade2-0 libglade2-dev make build-essential \<br />
git gnuplot boa m4 libtool libftdi-dev libmpfr-dev tcl8.5-dev xutils-dev<br />
<br />
=== Ocaml and libraries ===<br />
<br />
Ocaml, short for Objective Caml is the most popular variant of the Caml language. The Paparazzi Ground Control Station (GCS) and some of it's tools are crafted in this language.<br />
<br />
* ocaml, ocaml-camlimages-devel, ocaml-lablgtk2-devel, ocaml-xml-light-devel, ocamlnet-ocaml-devel<br />
<br />
$ sudo apt-get install ocaml libcamlimages-ocaml liblablgtk2-ocaml-dev liblablgtk2-gl-ocaml-dev \<br />
liblablgtk2-gnome-ocaml-dev libxml-light-ocaml-dev libocamlnet-ocaml-dev<br />
<br />
=== Gnome canvas Library ===<br />
<br />
The GnomeCanvas is an engine for structured graphics that offers a rich imaging model, high performance rendering, and a powerful, high level API. This widget can be used for flexible display of graphics and for creating interactive user interface elements.<br />
<br />
$ sudo apt-get install libgnomecanvas2-0 libgnomecanvas2-dev<br />
<br />
=== USB Library ===<br />
<br />
The libusb project aims to create a library for use by user level applications to access USB devices regardless of OS. [http://www.libusb.org]<br />
<br />
$ sudo apt-get install libusb-dev<br />
<br />
=== Ocaml PCRE ===<br />
<br />
This OCaml-library interfaces the PCRE (Perl-compatibility regular expressions) C library. it can be used for matching regular expressions which are written in Perl style.<br />
<br />
$ sudo apt-get install libpcre-ocaml libpcre-ocaml-dev<br />
<br />
=== Glade Library ===<br />
<br />
Libglade is a library that performs a similar job to the C source output routines in the GLADE user interface builder. Whereas GLADE's output routines create C source code that must be compiled, libglade builds the interface from an XML file (GLADE's save format) at runtime. This can allow modifying the user interface without recompiling.<br />
<br />
$ sudo apt-get install libglade2-0 libglade2-dev<br />
<br />
=== Tcl/Tk ===<br />
<br />
$ sudo apt-get install tcl-dev<br />
<br />
Also the some utils are required to compile and install Ivy.<br />
<br />
$ sudo apt-get install xutils-dev<br />
<br />
=== Make ===<br />
<br />
GNU Make is an utility which controls the generation of executables and other target files of a program from the program's source files. <br />
<br />
$ sudo apt-get install make<br />
<br />
=== Build essential ===<br />
<br />
$ sudo apt-get install build-essential<br />
<br />
=== Libtool ===<br />
<br />
GNU libtool is a generic library support script. Libtool hides the complexity of using shared libraries behind a consistent, portable interface. Creating the files for Paparazzi software building becomes less cumbersome by using this tool.<br />
<br />
$ sudo apt-get install libtool<br />
<br />
=== libpcre3-dev ===<br />
<br />
Required for compiling Ivy-C.<br />
<br />
$ apt-get install libpcre3-dev<br />
<br />
=== Git Client ===<br />
<br />
Git is a version control system. Version control systems allow many individuals to collaborate on the Paparazzi source code. This is needed to retrieve the latest sourcecode from various packages and Paparazzi sourcecode itself.<br />
<br />
$ sudo apt-get install git<br />
<br />
=== Subversion ===<br />
<br />
Version control system, required for cloning the ivy packages.<br />
<br />
$ apt-get install subversion<br />
<br />
=== GNU Plot ===<br />
<br />
A command-line driven interactive plotting program. Unknow if it is used<br />
<br />
$ sudo apt-get install gnuplot<br />
<br />
=== Meld ===<br />
<br />
Meld is a graphical front end to the diff program. It provides a side-by-side view of the differences between two files. It is used by the Paparazzi Center when configuration changes are not yet saved and the option comes along where one either can keep or view changes made in aircraft- and other configuration files.<br />
<br />
$ sudo apt-get install meld<br />
<br />
=== FTDI library ===<br />
<br />
libftdi is a library that talks to FTDI's 232 type chips, including the popular bitbang mode, using libusb. A library to be able to use with a debugging Autopilot hardware boards.<br />
<br />
$ sudo apt-get install libftdi-dev <br />
<br />
=== MPFR library ===<br />
<br />
The MPFR library is a C library for multiple-precision floating-point computations with correct rounding. MPFR is based on the GMP multiple-precision library. The main goal of MPFR is to provide a library for multiple-precision floating-point computation which is both efficient and has a well-defined semantics.<br />
<br />
$ sudo apt-get install libmpfr-dev<br />
<br />
=== ImageMagick ===<br />
<br />
ImageMagick is a software suite to create, edit, and compose bitmap images. It can read, convert and write images in a variety of formats. Use ImageMagick to translate, flip, mirror, rotate, scale, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves. Being able to modify image based map pictures is a feature that may come in handy one time.<br />
<br />
$ sudo apt-get install imagemagick<br />
<br />
=== Optional on an older OS ===<br />
<br />
If you have an older OS distribution it never hurts to install the following...<br />
<br />
$ sudo apt-get install libx11-6 libx11-dev texinfo libncurses5 libncursesw5 libncursesw5-dev zlibc<br />
<br />
== Paparazzi Main sourcecode ==<br />
<br />
See the main [[Installation#Getting_the_Source_Code]] page<br />
<br />
TIP: <br />
If you get the File "pprz.mli", line 149, characters 78-89: Error: Unbound type constructor Ivy.binding<br />
...this happens when IVY libraries are not yet installed. How to do this, read the part on installing IVY on this page<br />
<br />
<br />
== Useful links ==<br />
<br />
https://launchpad.net/gcc-arm-embedded/<br />
<br />
https://github.com/paparazzi/paparazzi-portability-support<br />
<br />
http://wiki.ubuntuusers.de/GNU_arm-toolchain<br />
<br />
http://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/ARM-Options.html#ARM-Options<br />
<br />
http://mcuprogramming.com/forum/arm/gnu-arm-toolchain-installer/<br />
<br />
http://www.ethernut.de/en/documents/cross-toolchain-osx.html<br />
<br />
http://www.hermann-uwe.de/blog/building-an-arm-cross-toolchain-with-binutils-gcc-newlib-and-gdb-from-source<br />
<br />
[[Category:Software]] [[Category:Developer_Documentation]] [[Category:Installation]]</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=Installation/FromScratch&diff=23375Installation/FromScratch2016-11-06T20:23:34Z<p>NeoFromMatrix: /* Fedora 24 */ gsd-devel needed for jsbsim</p>
<hr />
<div><categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Installation</categorytree><br />
__TOC__<br />
<br />
'''Users of recent Debian/Ubuntu distributions are advised to use the binary packages as described in [[Installation/Linux]].'''<br />
<br />
<span style="color:#FF0000">'''WARNING! Only use if you are proficient in working with Linux!'''</span><br />
<br />
== Intro ==<br />
<br />
Users of other Linux flavors or anyone needing manual control of each individual package can install them independently. <br/><br />
The list of dependencies of the Debian package is located in the [https://github.com/paparazzi/paparazzi-portability-support/blob/master/debian/paparazzi-dev/debian/control <tt>debian/control</tt>] file and may help users of other distributions.<br />
<br />
Some corresponding source tarballs can be downloaded from [https://launchpad.net/~paparazzi-uav/+archive/ppa/+packages paparazzi-uav ppa] on launchpad. (maybe building the packages from source is more reliable in view of dependencies)<br />
<br />
For distributions using RPM packaging, the [http://packages.debian.org/unstable/source/alien alien] tool can be used to convert a .deb package into a .rpm package.<br />
<br />
As with all Wiki pages, also this page is a work in progress. Try to be a big help to the Paparazzi project and improve this page whenever you can. If you have a distribution different from Ubuntu which doesn't satisfy any other dependency and have instructions about compiling it, packaging it, feel free to add any reference on how to do that on this wikipage.<br />
<br />
== Goal ==<br />
<br />
The goal of this page is to clarify about which version of each piece of software has to be compiled, where to find that software, patches needed to make it compile on Linux, maybe even FreeBSD or OSX.<br />
<br />
== Fedora 19 ==<br />
<br />
To build paparazzi-uav on Fedora 19, you must install the next packages from the official repository:<br />
* ocaml<br />
* ocaml-findlib<br />
* ocaml-xml-light<br />
* ocaml-ocamlnet<br />
* ocaml-lablgtk-devel<br />
* libxml2-devel<br />
* SDL-devel<br />
* libusb-devel<br />
<br />
Paparazzi-uav needs to include some ocaml headers when it compiles the simulator, then please be sure that they are included. If not, edit sw/simulator/Makefile and add:<br />
<br />
CAML_CFLAGS = -I/usr/lib64/ocaml<br />
<br />
The following packages must be built from source code (they are not included in the official repository): <br />
* ivy-c <br />
* ivy-ocaml <br />
<br />
Paparazzi-uav was successfully compiled using ivy-c 3.14 (downloaded from SVN repository, revision #3602) and ivy-ocaml 1.2. Please note that the ivy-c version is an unstable version!<br />
<br />
Additionally, you need install the next RPMs to build ivy-c:<br />
* pcre-devel<br />
* libXt-devel<br />
* tcl-devel<br />
* glib2-devel<br />
<br />
Don't forget to set the environment variable PKG_CONFIG before building ivy-ocaml, e.g:<br />
<br />
$ export PKG_CONFIG=/usr/local/lib/pkgconfig<br />
<br />
== Fedora 24 ==<br />
NOTE: Built upon Fedora 19 instruction, unnecessary instructions may occour.<br />
<br />
1. Install dependencies:<br />
$ sudo dnf install ocaml ocaml-findlib ocaml-xml-light ocaml-ocamlnet ocaml-lablgtk-devel ocaml-camlp4-devel libxml2-devel SDL-devel libusb-devel pcre-devel libXt-devel tcl-devel tk-devel glib2-devel gsl-devel<br />
<br />
2. Edit the PKG_CONFIG_PATH variable in your ~/.bashrc file to accomondate /usr/local/lib/pkgconfig/ (default for ivy libs)<br />
<br />
3. Edit all the ivy specific .pc files in /usr/local/lib/pkgconfig, changing line 3 from "libdir=${exec_prefix}/lib" to "libdir=${exec_prefix}/lib64"<br />
<br />
4. Install ivy-python via pip and compile and istall ivy-c and ivy-ocaml from source as shown [[Installation/FromScratch#IVY]]<br />
<br />
Note: dependencies for compiling ivy-c and ivy-ocaml are already covered above (except toolchain!).<br />
<br />
== Arch Linux ==<br />
<br />
This is a dirty hacked together (not really according to "the Arch Way") install, but works on a fresh installed Archbang GNU/Linux.<br />
<br />
'''NOTE: following issues '''<br />
# Only written and tested for Archbang and Manjaro, not tested on vanilla Arch Linux yet. <br />
# It seems that the error "unbound module GnoCanvas" can be resolved by installing lablgtk2 via yaourt first and then conf-gnomecanvas over opam.<br />
# No symlink from liblglibivy.so.3 and liblglibivy.so.3 to libglibivy.so.3.15, so can't find these files.<br />
# If pkg-config can't find some .pc files, a pkg-config path might not be set and exported properly. Use "pkg-config --variable pc_path pkg-config" to check if the path containing the ''ivy-c.pc'', ''ivy-glib.pc'' and ''ivy-tcl.pc'' files is found.<br />
# "ocamlfind: Package `netclient' not found" -> seems that the opam packages need to be installed in a specific order... (try ocamlnet first, then lablgtk.2.16) <br />
<br />
'''Requirements:'''<br />
# Up to date system<br />
#* pacman -Syyu<br />
# Install Yaourt<br />
#*https://astrofloyd.wordpress.com/2015/01/17/installing-yaourt-on-arch-linux/<br />
<br />
'''Install Paparazzi:'''<br />
# Packages base-devel, yajl and general dependencies<br />
#: <pre># pacman -S base-devel yajl subversion git libusb pcre ocaml camlp4 tcl tk python python-pip sdl glade</pre><br />
# Check if the PKG_CONFIG_PATH points to ''/usr/local/lib/pkgconfig'', otherwise set and export it<br />
#: <pre>$ echo 'export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/' >> ~/.bashrc</pre><br />
# Build and install Ivy-C from Source<br />
#: <pre>$ svn checkout https://svn.tls.cena.fr/svn/ivy/ivy-c/trunk /home/$USER/temp/ivy-c &#10;$ cd /home/$USER/temp/ivy-c/src &#10;$ make &#10;$ sudo make install</pre><br />
# '''Dirty''' All the ivy libs are installed in ''/usr/local/lib64'' and not ''/usr/local/lib'' as the .pc files point to currently. <br/><br />
#:Change in the third line (libdir) in the ivy-c.pc, ivy-glib.pc and ivy-tcl.pc file from ''lib'' to ''lib64'' and the fourth line (includedir) from ''include'' to ''include/Ivy''<br />
# '''Dirty'''For libgivy, libivy and libtclivy (.so and .so.3 ending) is a link directing to the lib with .so.3.15 availaible, but not for libglibivy. <br/><br />
#Create these links for libglibivy<br />
#: <pre>$ sudo ln -s /usr/local/lib64/libglibivy.so.3.15 /usr/local/lib64/libglibivy.so &#10;$ sudo ln -s /usr/local/lib64/libglibivy.so.3.15 /usr/local/lib64/libglibivy.so.3</pre><br />
# Install opam (OCaml packet manager) via yaourt<br />
#: <pre>$ yaourt -S opam</pre><br />
# Initialize opam<br />
#: <pre>$ opam init &#10;$ f &#10;$ ~/.bashrc &#10;$ echo 'eval `opam config env`' >> ~/.bashrc</pre><br />
# Install and pin lablgtk.2.16.0 (2.18.0 will not work)<br />
#: <pre>$ opam install -v lablgtk.2.16.0 &#10;$ opam pin add lablgtk 2.16.0</pre><br />
# Install OCaml packets via opam<br />
#: <pre>$ opam install ocamlfind ocamlnet xml-light pcre ivy</pre><br />
#: If this fails at Ivy related parts check the notes on top of this guide.<br />
# Install ivy-python via pip<br />
#: <pre>$ sudo pip install ivy-python</pre><br />
# Install the Toolchain for Paparazzi (e.g. [https://aur.archlinux.org/packages/gcc-arm-none-eabi-bin/ gcc-arm-none-eabi-bin] from the AUR)<br />
#: <pre>$ sudo pacman -S gcc-arm-none-eabi-bin</pre><br />
<br />
Optional:<br />
<br />
# Install flashing utilities if needed<br />
$ yaourt stlink-git dfu-util<br />
# Install [[JSBSim]] for [[NPS]]<br />
<br />
[[Installation#Getting_the_Source_Code|Download]] and [[Installation#Launching_the_Software|build Paparazzi]]<br />
<br />
== Installing the Cross compiler toolchain ==<br />
<br />
There are currently two different toolchains available that can be used on Linux based systems with Paparazzi. For more information see [[Installation/Linux#ARM_embedded_toolchain]]<br />
<br />
== Installing OCaml packages using OPAM ==<br />
<br />
One possibility to install and manage OCaml packages is [http://opam.ocamlpro.com/ OPAM (OCaml Package Manager)]:<br/><br />
'''Please first check the official [http://opam.ocaml.org/doc/Install.html OPAM install guide] for the simplest method.'''<br/><br />
To install it from the latest git tree run:<br />
<nowiki>git clone https://github.com/OCamlPro/opam.git</nowiki><br />
cd opam<br />
./configure && make<br />
sudo make install<br />
<br />
opam init<br />
eval `opam config env`<br />
<br />
Update your shell environment as per opam init's instructions. E.g. add to your ''~/.profile'':<br />
eval `opam config env`<br />
<br />
Build and install OCaml libs:<br />
opam install ocamlfind xml-light pcre ocamlnet<br />
opam install -v lablgtk<br />
<br />
== IVY ==<br />
<br />
IVY is a simple protocol and a set of open-source libraries and programs that allows applications to broadcast information through text messages, with a subscription mechanism based on regular expressions. The project can be found at: http://www.eei.cena.fr/products/ivy/ <br />
<br />
In the paparazzi project, Ivy is used to send telemetry data to where ever you want.<br />
<br />
NOTE: Do not confuse this IVY with the Apache Ivy project. <br />
<br />
=== Ivy-python ===<br />
<br />
The ivy-python package makes it possible to use the IVY libraries from within the Python programming language. The ivy-python package is architecture independent, so it can be downloaded from the Ubuntu or Debian paparazzi repository.<br />
<br />
The easiest way to instally it on non Debian based systems is using [https://pip.pypa.io/ pip] to install the [https://pypi.python.org/pypi/ivy-python ivy-python package] from [https://pypi.python.org/pypi PyPi - the Python Package Index].<br />
pip install ivy-python<br />
<br />
Or install from the source repository via <br />
<br />
git clone https://gitlab.com/ivybus/ivy-python.git<br />
cd ivy-python<br />
./setup.py install<br />
<br />
=== Ivy-c ===<br />
<br />
To be able to use ivy-c, the libraries need to be installed. <br />
<br />
Required packages (Debian based):<br />
* tk-dev<br />
* libpcre3-dev<br />
* libxt-dev<br />
* pkg-config<br />
* libglib2.0-dev<br />
<br />
Download source, compile and install libraries:<br />
<br />
# mkdir -p /opt/ivy-c <br />
# cd /opt/ivy-c<br />
# svn co https://svn.tls.cena.fr/svn/ivy/ivy-c/trunk<br />
# cd /opt/ivy-c/trunk/src<br />
# make<br />
# make install<br />
<br />
It is possible you get errors of the test module when compiling, just ignore the messages, it is not important for the Paparazzi project. Contact the IVY team to help them also to resolve also the testing makefile issue.<br />
<br />
==== troubleshooting ====<br />
<br />
Error message:<br />
gcc -c -O2 -Wall -Wshadow -fPIC -I/usr/include/tcl8.4 -DTCL_CHANNEL_INTEGRATION ivytcl.c<br />
ivytcl.c:28:17: fatal error: tcl.h: No such file or directory<br />
<br />
The Makefile cannot read the tcl-dev version you have installed and assumes that version 8.4 is installed, but can't find the appropriate folder.<br/><br />
Edit the line 57 of the Makefile from TCLVERS=8.4 according to your installed version, or just delete the 8.4, both work.<br />
<br />
<br />
Can't find 64bit libs:<br />
Your ivy libs were probably installed to /usr/local/lib64 and you have to make symbolic links so that they will be found:<br />
$ sudo ln -s /usr/local/lib64/libivy.so /usr/local/lib64/libivy.so.3 /usr/lib<br />
or <br />
sudo ln -s /usr/local/lib64/libivy.so /usr/local/lib64/libivy.so.3 /usr/local/lib<br />
<br />
<br />
If you get an error relating to ivytestready.c, make the following changes:<br />
mkdir /opt/ivy-c/trunk/tools/Ivy<br />
cd /opt/ivy-c/trunk/tools/Ivy<br />
cp ../../src/ivy.h .<br />
cp ../../src/ivyloop.h .<br />
cp ../../src/ivysocket.h .<br />
cp ../../src/timer.h .<br />
cd ~/develop/ivy-c/trunk/src<br />
make<br />
<br />
This copies files from the src directory to the Ivy folder in tools which did not appear after running svn above.<br />
<br />
=== Ivy-OCaml ===<br />
<br />
ivy-ocaml provides OCaml bindings for ivy-c and is needed for most of the ground segment agents that are written in OCaml like [[Server]] and [[GCS]].<br />
<br />
Download source, compile and install libraries:<br />
<br />
# mkdir -p /opt/ivy-ocaml<br />
# cd /opt/ivy-ocaml<br />
# svn co https://svn.tls.cena.fr/svn/ivy/ivy-ocaml/trunk<br />
# cd /opt/ivy-ocaml/trunk<br />
# make<br />
# make install<br />
<br />
==== ivy-ocaml via OPAM ====<br />
Or use OPAM: While the source repository and debian package is named ''ivy-ocaml'', in OPAM it is only named ''ivy'' (since it is obviously for OCaml).<br />
<br />
$ opam update<br />
$ opam install ivy<br />
<br />
== LPC21ISP ==<br />
<br />
lpc21isp is only needed to serially flash the LPC2148 based autopilots (e.g. [[Lpc21BootloaderUpload bootloader]] for tiny, twog, umarim). LPC21ISP is an in-circuit programming (ISP) tool for the microcontroller used on the Paparazzi autopilot boards. The lpc21isp project is hosted on sourceforge and one can find the source packages and information at http://sourceforge.net/projects/lpc21isp/ <br />
<br />
Get the SVN version via<br />
<br />
$ mkdir -p /opt/lpc21isp<br />
$ cd /opt/lpc21isp<br />
$ svn co https://lpc21isp.svn.sourceforge.net/svnroot/lpc21isp lpc21<br />
<br />
To compile go into the source directory and then do<br />
<br />
$ cd lpc21<br />
$ make -f Makefile clean all<br />
<br />
To install<br />
<br />
$ exportline="PATH=$PATH:/opt/lpc21isp"<br />
$ if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi<br />
$ source ~/.profile<br />
<br />
== Paparazzi-dev Debian/Ubuntu packages ==<br />
<br />
For Ubuntu users, you can install the following packages from standard repository. You can just copy the line(s) and paste into your terminal. But do not copy the $ sign, this symbol is just added on this page to show that it is to be pasted at a normal terminal prompt.<br />
<br />
=== Whole lot in one ===<br />
<br />
sudo apt-get install ocaml libcamlimages-ocaml liblablgtk2-ocaml-dev liblablgtk2-gl-ocaml-dev \<br />
liblablgtk2-gnome-ocaml-dev libxml-light-ocaml-dev libocamlnet-ocaml-dev libpcre-ocaml \<br />
libpcre-ocaml-dev libgnomecanvas2-0 libgnomecanvas2-dev libglade2-0 libglade2-dev make build-essential \<br />
git gnuplot boa m4 libtool libftdi-dev libmpfr-dev tcl8.5-dev xutils-dev<br />
<br />
=== Ocaml and libraries ===<br />
<br />
Ocaml, short for Objective Caml is the most popular variant of the Caml language. The Paparazzi Ground Control Station (GCS) and some of it's tools are crafted in this language.<br />
<br />
* ocaml, ocaml-camlimages-devel, ocaml-lablgtk2-devel, ocaml-xml-light-devel, ocamlnet-ocaml-devel<br />
<br />
$ sudo apt-get install ocaml libcamlimages-ocaml liblablgtk2-ocaml-dev liblablgtk2-gl-ocaml-dev \<br />
liblablgtk2-gnome-ocaml-dev libxml-light-ocaml-dev libocamlnet-ocaml-dev<br />
<br />
=== Gnome canvas Library ===<br />
<br />
The GnomeCanvas is an engine for structured graphics that offers a rich imaging model, high performance rendering, and a powerful, high level API. This widget can be used for flexible display of graphics and for creating interactive user interface elements.<br />
<br />
$ sudo apt-get install libgnomecanvas2-0 libgnomecanvas2-dev<br />
<br />
=== USB Library ===<br />
<br />
The libusb project aims to create a library for use by user level applications to access USB devices regardless of OS. [http://www.libusb.org]<br />
<br />
$ sudo apt-get install libusb-dev<br />
<br />
=== Ocaml PCRE ===<br />
<br />
This OCaml-library interfaces the PCRE (Perl-compatibility regular expressions) C library. it can be used for matching regular expressions which are written in Perl style.<br />
<br />
$ sudo apt-get install libpcre-ocaml libpcre-ocaml-dev<br />
<br />
=== Glade Library ===<br />
<br />
Libglade is a library that performs a similar job to the C source output routines in the GLADE user interface builder. Whereas GLADE's output routines create C source code that must be compiled, libglade builds the interface from an XML file (GLADE's save format) at runtime. This can allow modifying the user interface without recompiling.<br />
<br />
$ sudo apt-get install libglade2-0 libglade2-dev<br />
<br />
=== Tcl/Tk ===<br />
<br />
$ sudo apt-get install tcl-dev<br />
<br />
Also the some utils are required to compile and install Ivy.<br />
<br />
$ sudo apt-get install xutils-dev<br />
<br />
=== Make ===<br />
<br />
GNU Make is an utility which controls the generation of executables and other target files of a program from the program's source files. <br />
<br />
$ sudo apt-get install make<br />
<br />
=== Build essential ===<br />
<br />
$ sudo apt-get install build-essential<br />
<br />
=== Libtool ===<br />
<br />
GNU libtool is a generic library support script. Libtool hides the complexity of using shared libraries behind a consistent, portable interface. Creating the files for Paparazzi software building becomes less cumbersome by using this tool.<br />
<br />
$ sudo apt-get install libtool<br />
<br />
=== libpcre3-dev ===<br />
<br />
Required for compiling Ivy-C.<br />
<br />
$ apt-get install libpcre3-dev<br />
<br />
=== Git Client ===<br />
<br />
Git is a version control system. Version control systems allow many individuals to collaborate on the Paparazzi source code. This is needed to retrieve the latest sourcecode from various packages and Paparazzi sourcecode itself.<br />
<br />
$ sudo apt-get install git<br />
<br />
=== Subversion ===<br />
<br />
Version control system, required for cloning the ivy packages.<br />
<br />
$ apt-get install subversion<br />
<br />
=== GNU Plot ===<br />
<br />
A command-line driven interactive plotting program. Unknow if it is used<br />
<br />
$ sudo apt-get install gnuplot<br />
<br />
=== Meld ===<br />
<br />
Meld is a graphical front end to the diff program. It provides a side-by-side view of the differences between two files. It is used by the Paparazzi Center when configuration changes are not yet saved and the option comes along where one either can keep or view changes made in aircraft- and other configuration files.<br />
<br />
$ sudo apt-get install meld<br />
<br />
=== FTDI library ===<br />
<br />
libftdi is a library that talks to FTDI's 232 type chips, including the popular bitbang mode, using libusb. A library to be able to use with a debugging Autopilot hardware boards.<br />
<br />
$ sudo apt-get install libftdi-dev <br />
<br />
=== MPFR library ===<br />
<br />
The MPFR library is a C library for multiple-precision floating-point computations with correct rounding. MPFR is based on the GMP multiple-precision library. The main goal of MPFR is to provide a library for multiple-precision floating-point computation which is both efficient and has a well-defined semantics.<br />
<br />
$ sudo apt-get install libmpfr-dev<br />
<br />
=== ImageMagick ===<br />
<br />
ImageMagick is a software suite to create, edit, and compose bitmap images. It can read, convert and write images in a variety of formats. Use ImageMagick to translate, flip, mirror, rotate, scale, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves. Being able to modify image based map pictures is a feature that may come in handy one time.<br />
<br />
$ sudo apt-get install imagemagick<br />
<br />
=== Optional on an older OS ===<br />
<br />
If you have an older OS distribution it never hurts to install the following...<br />
<br />
$ sudo apt-get install libx11-6 libx11-dev texinfo libncurses5 libncursesw5 libncursesw5-dev zlibc<br />
<br />
== Paparazzi Main sourcecode ==<br />
<br />
See the main [[Installation#Getting_the_Source_Code]] page<br />
<br />
TIP: <br />
If you get the File "pprz.mli", line 149, characters 78-89: Error: Unbound type constructor Ivy.binding<br />
...this happens when IVY libraries are not yet installed. How to do this, read the part on installing IVY on this page<br />
<br />
<br />
== Useful links ==<br />
<br />
https://launchpad.net/gcc-arm-embedded/<br />
<br />
https://github.com/paparazzi/paparazzi-portability-support<br />
<br />
http://wiki.ubuntuusers.de/GNU_arm-toolchain<br />
<br />
http://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/ARM-Options.html#ARM-Options<br />
<br />
http://mcuprogramming.com/forum/arm/gnu-arm-toolchain-installer/<br />
<br />
http://www.ethernut.de/en/documents/cross-toolchain-osx.html<br />
<br />
http://www.hermann-uwe.de/blog/building-an-arm-cross-toolchain-with-binutils-gcc-newlib-and-gdb-from-source<br />
<br />
[[Category:Software]] [[Category:Developer_Documentation]] [[Category:Installation]]</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=Installation/FromScratch&diff=23374Installation/FromScratch2016-11-06T20:12:39Z<p>NeoFromMatrix: /* Fedora 24 */ added initial instruction for fedora 24</p>
<hr />
<div><categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Installation</categorytree><br />
__TOC__<br />
<br />
'''Users of recent Debian/Ubuntu distributions are advised to use the binary packages as described in [[Installation/Linux]].'''<br />
<br />
<span style="color:#FF0000">'''WARNING! Only use if you are proficient in working with Linux!'''</span><br />
<br />
== Intro ==<br />
<br />
Users of other Linux flavors or anyone needing manual control of each individual package can install them independently. <br/><br />
The list of dependencies of the Debian package is located in the [https://github.com/paparazzi/paparazzi-portability-support/blob/master/debian/paparazzi-dev/debian/control <tt>debian/control</tt>] file and may help users of other distributions.<br />
<br />
Some corresponding source tarballs can be downloaded from [https://launchpad.net/~paparazzi-uav/+archive/ppa/+packages paparazzi-uav ppa] on launchpad. (maybe building the packages from source is more reliable in view of dependencies)<br />
<br />
For distributions using RPM packaging, the [http://packages.debian.org/unstable/source/alien alien] tool can be used to convert a .deb package into a .rpm package.<br />
<br />
As with all Wiki pages, also this page is a work in progress. Try to be a big help to the Paparazzi project and improve this page whenever you can. If you have a distribution different from Ubuntu which doesn't satisfy any other dependency and have instructions about compiling it, packaging it, feel free to add any reference on how to do that on this wikipage.<br />
<br />
== Goal ==<br />
<br />
The goal of this page is to clarify about which version of each piece of software has to be compiled, where to find that software, patches needed to make it compile on Linux, maybe even FreeBSD or OSX.<br />
<br />
== Fedora 19 ==<br />
<br />
To build paparazzi-uav on Fedora 19, you must install the next packages from the official repository:<br />
* ocaml<br />
* ocaml-findlib<br />
* ocaml-xml-light<br />
* ocaml-ocamlnet<br />
* ocaml-lablgtk-devel<br />
* libxml2-devel<br />
* SDL-devel<br />
* libusb-devel<br />
<br />
Paparazzi-uav needs to include some ocaml headers when it compiles the simulator, then please be sure that they are included. If not, edit sw/simulator/Makefile and add:<br />
<br />
CAML_CFLAGS = -I/usr/lib64/ocaml<br />
<br />
The following packages must be built from source code (they are not included in the official repository): <br />
* ivy-c <br />
* ivy-ocaml <br />
<br />
Paparazzi-uav was successfully compiled using ivy-c 3.14 (downloaded from SVN repository, revision #3602) and ivy-ocaml 1.2. Please note that the ivy-c version is an unstable version!<br />
<br />
Additionally, you need install the next RPMs to build ivy-c:<br />
* pcre-devel<br />
* libXt-devel<br />
* tcl-devel<br />
* glib2-devel<br />
<br />
Don't forget to set the environment variable PKG_CONFIG before building ivy-ocaml, e.g:<br />
<br />
$ export PKG_CONFIG=/usr/local/lib/pkgconfig<br />
<br />
== Fedora 24 ==<br />
NOTE: Built upon Fedora 19 instruction, unnecessary instructions may occour.<br />
<br />
1. Install dependencies:<br />
$ sudo dnf install ocaml ocaml-findlib ocaml-xml-light ocaml-ocamlnet ocaml-lablgtk-devel ocaml-camlp4-devel libxml2-devel SDL-devel libusb-devel pcre-devel libXt-devel tcl-devel tk-devel glib2-devel<br />
<br />
2. Edit the PKG_CONFIG_PATH variable in your ~/.bashrc file to accomondate /usr/local/lib/pkgconfig/ (default for ivy libs)<br />
<br />
3. Edit all the ivy specific .pc files in /usr/local/lib/pkgconfig, changing line 3 from "libdir=${exec_prefix}/lib" to "libdir=${exec_prefix}/lib64"<br />
<br />
4. Install ivy-python via pip and compile and istall ivy-c and ivy-ocaml from source as shown [[Installation/FromScratch#IVY]]<br />
<br />
Note: dependencies for compiling ivy-c and ivy-ocaml are already covered above (except toolchain!).<br />
<br />
== Arch Linux ==<br />
<br />
This is a dirty hacked together (not really according to "the Arch Way") install, but works on a fresh installed Archbang GNU/Linux.<br />
<br />
'''NOTE: following issues '''<br />
# Only written and tested for Archbang and Manjaro, not tested on vanilla Arch Linux yet. <br />
# It seems that the error "unbound module GnoCanvas" can be resolved by installing lablgtk2 via yaourt first and then conf-gnomecanvas over opam.<br />
# No symlink from liblglibivy.so.3 and liblglibivy.so.3 to libglibivy.so.3.15, so can't find these files.<br />
# If pkg-config can't find some .pc files, a pkg-config path might not be set and exported properly. Use "pkg-config --variable pc_path pkg-config" to check if the path containing the ''ivy-c.pc'', ''ivy-glib.pc'' and ''ivy-tcl.pc'' files is found.<br />
# "ocamlfind: Package `netclient' not found" -> seems that the opam packages need to be installed in a specific order... (try ocamlnet first, then lablgtk.2.16) <br />
<br />
'''Requirements:'''<br />
# Up to date system<br />
#* pacman -Syyu<br />
# Install Yaourt<br />
#*https://astrofloyd.wordpress.com/2015/01/17/installing-yaourt-on-arch-linux/<br />
<br />
'''Install Paparazzi:'''<br />
# Packages base-devel, yajl and general dependencies<br />
#: <pre># pacman -S base-devel yajl subversion git libusb pcre ocaml camlp4 tcl tk python python-pip sdl glade</pre><br />
# Check if the PKG_CONFIG_PATH points to ''/usr/local/lib/pkgconfig'', otherwise set and export it<br />
#: <pre>$ echo 'export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/' >> ~/.bashrc</pre><br />
# Build and install Ivy-C from Source<br />
#: <pre>$ svn checkout https://svn.tls.cena.fr/svn/ivy/ivy-c/trunk /home/$USER/temp/ivy-c &#10;$ cd /home/$USER/temp/ivy-c/src &#10;$ make &#10;$ sudo make install</pre><br />
# '''Dirty''' All the ivy libs are installed in ''/usr/local/lib64'' and not ''/usr/local/lib'' as the .pc files point to currently. <br/><br />
#:Change in the third line (libdir) in the ivy-c.pc, ivy-glib.pc and ivy-tcl.pc file from ''lib'' to ''lib64'' and the fourth line (includedir) from ''include'' to ''include/Ivy''<br />
# '''Dirty'''For libgivy, libivy and libtclivy (.so and .so.3 ending) is a link directing to the lib with .so.3.15 availaible, but not for libglibivy. <br/><br />
#Create these links for libglibivy<br />
#: <pre>$ sudo ln -s /usr/local/lib64/libglibivy.so.3.15 /usr/local/lib64/libglibivy.so &#10;$ sudo ln -s /usr/local/lib64/libglibivy.so.3.15 /usr/local/lib64/libglibivy.so.3</pre><br />
# Install opam (OCaml packet manager) via yaourt<br />
#: <pre>$ yaourt -S opam</pre><br />
# Initialize opam<br />
#: <pre>$ opam init &#10;$ f &#10;$ ~/.bashrc &#10;$ echo 'eval `opam config env`' >> ~/.bashrc</pre><br />
# Install and pin lablgtk.2.16.0 (2.18.0 will not work)<br />
#: <pre>$ opam install -v lablgtk.2.16.0 &#10;$ opam pin add lablgtk 2.16.0</pre><br />
# Install OCaml packets via opam<br />
#: <pre>$ opam install ocamlfind ocamlnet xml-light pcre ivy</pre><br />
#: If this fails at Ivy related parts check the notes on top of this guide.<br />
# Install ivy-python via pip<br />
#: <pre>$ sudo pip install ivy-python</pre><br />
# Install the Toolchain for Paparazzi (e.g. [https://aur.archlinux.org/packages/gcc-arm-none-eabi-bin/ gcc-arm-none-eabi-bin] from the AUR)<br />
#: <pre>$ sudo pacman -S gcc-arm-none-eabi-bin</pre><br />
<br />
Optional:<br />
<br />
# Install flashing utilities if needed<br />
$ yaourt stlink-git dfu-util<br />
# Install [[JSBSim]] for [[NPS]]<br />
<br />
[[Installation#Getting_the_Source_Code|Download]] and [[Installation#Launching_the_Software|build Paparazzi]]<br />
<br />
== Installing the Cross compiler toolchain ==<br />
<br />
There are currently two different toolchains available that can be used on Linux based systems with Paparazzi. For more information see [[Installation/Linux#ARM_embedded_toolchain]]<br />
<br />
== Installing OCaml packages using OPAM ==<br />
<br />
One possibility to install and manage OCaml packages is [http://opam.ocamlpro.com/ OPAM (OCaml Package Manager)]:<br/><br />
'''Please first check the official [http://opam.ocaml.org/doc/Install.html OPAM install guide] for the simplest method.'''<br/><br />
To install it from the latest git tree run:<br />
<nowiki>git clone https://github.com/OCamlPro/opam.git</nowiki><br />
cd opam<br />
./configure && make<br />
sudo make install<br />
<br />
opam init<br />
eval `opam config env`<br />
<br />
Update your shell environment as per opam init's instructions. E.g. add to your ''~/.profile'':<br />
eval `opam config env`<br />
<br />
Build and install OCaml libs:<br />
opam install ocamlfind xml-light pcre ocamlnet<br />
opam install -v lablgtk<br />
<br />
== IVY ==<br />
<br />
IVY is a simple protocol and a set of open-source libraries and programs that allows applications to broadcast information through text messages, with a subscription mechanism based on regular expressions. The project can be found at: http://www.eei.cena.fr/products/ivy/ <br />
<br />
In the paparazzi project, Ivy is used to send telemetry data to where ever you want.<br />
<br />
NOTE: Do not confuse this IVY with the Apache Ivy project. <br />
<br />
=== Ivy-python ===<br />
<br />
The ivy-python package makes it possible to use the IVY libraries from within the Python programming language. The ivy-python package is architecture independent, so it can be downloaded from the Ubuntu or Debian paparazzi repository.<br />
<br />
The easiest way to instally it on non Debian based systems is using [https://pip.pypa.io/ pip] to install the [https://pypi.python.org/pypi/ivy-python ivy-python package] from [https://pypi.python.org/pypi PyPi - the Python Package Index].<br />
pip install ivy-python<br />
<br />
Or install from the source repository via <br />
<br />
git clone https://gitlab.com/ivybus/ivy-python.git<br />
cd ivy-python<br />
./setup.py install<br />
<br />
=== Ivy-c ===<br />
<br />
To be able to use ivy-c, the libraries need to be installed. <br />
<br />
Required packages (Debian based):<br />
* tk-dev<br />
* libpcre3-dev<br />
* libxt-dev<br />
* pkg-config<br />
* libglib2.0-dev<br />
<br />
Download source, compile and install libraries:<br />
<br />
# mkdir -p /opt/ivy-c <br />
# cd /opt/ivy-c<br />
# svn co https://svn.tls.cena.fr/svn/ivy/ivy-c/trunk<br />
# cd /opt/ivy-c/trunk/src<br />
# make<br />
# make install<br />
<br />
It is possible you get errors of the test module when compiling, just ignore the messages, it is not important for the Paparazzi project. Contact the IVY team to help them also to resolve also the testing makefile issue.<br />
<br />
==== troubleshooting ====<br />
<br />
Error message:<br />
gcc -c -O2 -Wall -Wshadow -fPIC -I/usr/include/tcl8.4 -DTCL_CHANNEL_INTEGRATION ivytcl.c<br />
ivytcl.c:28:17: fatal error: tcl.h: No such file or directory<br />
<br />
The Makefile cannot read the tcl-dev version you have installed and assumes that version 8.4 is installed, but can't find the appropriate folder.<br/><br />
Edit the line 57 of the Makefile from TCLVERS=8.4 according to your installed version, or just delete the 8.4, both work.<br />
<br />
<br />
Can't find 64bit libs:<br />
Your ivy libs were probably installed to /usr/local/lib64 and you have to make symbolic links so that they will be found:<br />
$ sudo ln -s /usr/local/lib64/libivy.so /usr/local/lib64/libivy.so.3 /usr/lib<br />
or <br />
sudo ln -s /usr/local/lib64/libivy.so /usr/local/lib64/libivy.so.3 /usr/local/lib<br />
<br />
<br />
If you get an error relating to ivytestready.c, make the following changes:<br />
mkdir /opt/ivy-c/trunk/tools/Ivy<br />
cd /opt/ivy-c/trunk/tools/Ivy<br />
cp ../../src/ivy.h .<br />
cp ../../src/ivyloop.h .<br />
cp ../../src/ivysocket.h .<br />
cp ../../src/timer.h .<br />
cd ~/develop/ivy-c/trunk/src<br />
make<br />
<br />
This copies files from the src directory to the Ivy folder in tools which did not appear after running svn above.<br />
<br />
=== Ivy-OCaml ===<br />
<br />
ivy-ocaml provides OCaml bindings for ivy-c and is needed for most of the ground segment agents that are written in OCaml like [[Server]] and [[GCS]].<br />
<br />
Download source, compile and install libraries:<br />
<br />
# mkdir -p /opt/ivy-ocaml<br />
# cd /opt/ivy-ocaml<br />
# svn co https://svn.tls.cena.fr/svn/ivy/ivy-ocaml/trunk<br />
# cd /opt/ivy-ocaml/trunk<br />
# make<br />
# make install<br />
<br />
==== ivy-ocaml via OPAM ====<br />
Or use OPAM: While the source repository and debian package is named ''ivy-ocaml'', in OPAM it is only named ''ivy'' (since it is obviously for OCaml).<br />
<br />
$ opam update<br />
$ opam install ivy<br />
<br />
== LPC21ISP ==<br />
<br />
lpc21isp is only needed to serially flash the LPC2148 based autopilots (e.g. [[Lpc21BootloaderUpload bootloader]] for tiny, twog, umarim). LPC21ISP is an in-circuit programming (ISP) tool for the microcontroller used on the Paparazzi autopilot boards. The lpc21isp project is hosted on sourceforge and one can find the source packages and information at http://sourceforge.net/projects/lpc21isp/ <br />
<br />
Get the SVN version via<br />
<br />
$ mkdir -p /opt/lpc21isp<br />
$ cd /opt/lpc21isp<br />
$ svn co https://lpc21isp.svn.sourceforge.net/svnroot/lpc21isp lpc21<br />
<br />
To compile go into the source directory and then do<br />
<br />
$ cd lpc21<br />
$ make -f Makefile clean all<br />
<br />
To install<br />
<br />
$ exportline="PATH=$PATH:/opt/lpc21isp"<br />
$ if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi<br />
$ source ~/.profile<br />
<br />
== Paparazzi-dev Debian/Ubuntu packages ==<br />
<br />
For Ubuntu users, you can install the following packages from standard repository. You can just copy the line(s) and paste into your terminal. But do not copy the $ sign, this symbol is just added on this page to show that it is to be pasted at a normal terminal prompt.<br />
<br />
=== Whole lot in one ===<br />
<br />
sudo apt-get install ocaml libcamlimages-ocaml liblablgtk2-ocaml-dev liblablgtk2-gl-ocaml-dev \<br />
liblablgtk2-gnome-ocaml-dev libxml-light-ocaml-dev libocamlnet-ocaml-dev libpcre-ocaml \<br />
libpcre-ocaml-dev libgnomecanvas2-0 libgnomecanvas2-dev libglade2-0 libglade2-dev make build-essential \<br />
git gnuplot boa m4 libtool libftdi-dev libmpfr-dev tcl8.5-dev xutils-dev<br />
<br />
=== Ocaml and libraries ===<br />
<br />
Ocaml, short for Objective Caml is the most popular variant of the Caml language. The Paparazzi Ground Control Station (GCS) and some of it's tools are crafted in this language.<br />
<br />
* ocaml, ocaml-camlimages-devel, ocaml-lablgtk2-devel, ocaml-xml-light-devel, ocamlnet-ocaml-devel<br />
<br />
$ sudo apt-get install ocaml libcamlimages-ocaml liblablgtk2-ocaml-dev liblablgtk2-gl-ocaml-dev \<br />
liblablgtk2-gnome-ocaml-dev libxml-light-ocaml-dev libocamlnet-ocaml-dev<br />
<br />
=== Gnome canvas Library ===<br />
<br />
The GnomeCanvas is an engine for structured graphics that offers a rich imaging model, high performance rendering, and a powerful, high level API. This widget can be used for flexible display of graphics and for creating interactive user interface elements.<br />
<br />
$ sudo apt-get install libgnomecanvas2-0 libgnomecanvas2-dev<br />
<br />
=== USB Library ===<br />
<br />
The libusb project aims to create a library for use by user level applications to access USB devices regardless of OS. [http://www.libusb.org]<br />
<br />
$ sudo apt-get install libusb-dev<br />
<br />
=== Ocaml PCRE ===<br />
<br />
This OCaml-library interfaces the PCRE (Perl-compatibility regular expressions) C library. it can be used for matching regular expressions which are written in Perl style.<br />
<br />
$ sudo apt-get install libpcre-ocaml libpcre-ocaml-dev<br />
<br />
=== Glade Library ===<br />
<br />
Libglade is a library that performs a similar job to the C source output routines in the GLADE user interface builder. Whereas GLADE's output routines create C source code that must be compiled, libglade builds the interface from an XML file (GLADE's save format) at runtime. This can allow modifying the user interface without recompiling.<br />
<br />
$ sudo apt-get install libglade2-0 libglade2-dev<br />
<br />
=== Tcl/Tk ===<br />
<br />
$ sudo apt-get install tcl-dev<br />
<br />
Also the some utils are required to compile and install Ivy.<br />
<br />
$ sudo apt-get install xutils-dev<br />
<br />
=== Make ===<br />
<br />
GNU Make is an utility which controls the generation of executables and other target files of a program from the program's source files. <br />
<br />
$ sudo apt-get install make<br />
<br />
=== Build essential ===<br />
<br />
$ sudo apt-get install build-essential<br />
<br />
=== Libtool ===<br />
<br />
GNU libtool is a generic library support script. Libtool hides the complexity of using shared libraries behind a consistent, portable interface. Creating the files for Paparazzi software building becomes less cumbersome by using this tool.<br />
<br />
$ sudo apt-get install libtool<br />
<br />
=== libpcre3-dev ===<br />
<br />
Required for compiling Ivy-C.<br />
<br />
$ apt-get install libpcre3-dev<br />
<br />
=== Git Client ===<br />
<br />
Git is a version control system. Version control systems allow many individuals to collaborate on the Paparazzi source code. This is needed to retrieve the latest sourcecode from various packages and Paparazzi sourcecode itself.<br />
<br />
$ sudo apt-get install git<br />
<br />
=== Subversion ===<br />
<br />
Version control system, required for cloning the ivy packages.<br />
<br />
$ apt-get install subversion<br />
<br />
=== GNU Plot ===<br />
<br />
A command-line driven interactive plotting program. Unknow if it is used<br />
<br />
$ sudo apt-get install gnuplot<br />
<br />
=== Meld ===<br />
<br />
Meld is a graphical front end to the diff program. It provides a side-by-side view of the differences between two files. It is used by the Paparazzi Center when configuration changes are not yet saved and the option comes along where one either can keep or view changes made in aircraft- and other configuration files.<br />
<br />
$ sudo apt-get install meld<br />
<br />
=== FTDI library ===<br />
<br />
libftdi is a library that talks to FTDI's 232 type chips, including the popular bitbang mode, using libusb. A library to be able to use with a debugging Autopilot hardware boards.<br />
<br />
$ sudo apt-get install libftdi-dev <br />
<br />
=== MPFR library ===<br />
<br />
The MPFR library is a C library for multiple-precision floating-point computations with correct rounding. MPFR is based on the GMP multiple-precision library. The main goal of MPFR is to provide a library for multiple-precision floating-point computation which is both efficient and has a well-defined semantics.<br />
<br />
$ sudo apt-get install libmpfr-dev<br />
<br />
=== ImageMagick ===<br />
<br />
ImageMagick is a software suite to create, edit, and compose bitmap images. It can read, convert and write images in a variety of formats. Use ImageMagick to translate, flip, mirror, rotate, scale, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves. Being able to modify image based map pictures is a feature that may come in handy one time.<br />
<br />
$ sudo apt-get install imagemagick<br />
<br />
=== Optional on an older OS ===<br />
<br />
If you have an older OS distribution it never hurts to install the following...<br />
<br />
$ sudo apt-get install libx11-6 libx11-dev texinfo libncurses5 libncursesw5 libncursesw5-dev zlibc<br />
<br />
== Paparazzi Main sourcecode ==<br />
<br />
See the main [[Installation#Getting_the_Source_Code]] page<br />
<br />
TIP: <br />
If you get the File "pprz.mli", line 149, characters 78-89: Error: Unbound type constructor Ivy.binding<br />
...this happens when IVY libraries are not yet installed. How to do this, read the part on installing IVY on this page<br />
<br />
<br />
== Useful links ==<br />
<br />
https://launchpad.net/gcc-arm-embedded/<br />
<br />
https://github.com/paparazzi/paparazzi-portability-support<br />
<br />
http://wiki.ubuntuusers.de/GNU_arm-toolchain<br />
<br />
http://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/ARM-Options.html#ARM-Options<br />
<br />
http://mcuprogramming.com/forum/arm/gnu-arm-toolchain-installer/<br />
<br />
http://www.ethernut.de/en/documents/cross-toolchain-osx.html<br />
<br />
http://www.hermann-uwe.de/blog/building-an-arm-cross-toolchain-with-binutils-gcc-newlib-and-gdb-from-source<br />
<br />
[[Category:Software]] [[Category:Developer_Documentation]] [[Category:Installation]]</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=Installation/FromScratch&diff=20398Installation/FromScratch2015-10-10T21:57:03Z<p>NeoFromMatrix: /* Arch Linux */ added jsbsim</p>
<hr />
<div><categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Installation</categorytree><br />
__TOC__<br />
<br />
'''Users of recent Debian/Ubuntu distributions are advised to use the binary packages as described in [[Installation/Linux]].'''<br />
<br />
<span style="color:#FF0000">'''WARNING! Only use if you are proficient in working with Linux!'''</span><br />
<br />
== Intro ==<br />
<br />
Users of other Linux flavors or anyone needing manual control of each individual package can install them independently. <br/><br />
The list of dependencies of the Debian package is located in the [https://github.com/paparazzi/paparazzi-portability-support/blob/master/debian/paparazzi-dev/debian/control <tt>debian/control</tt>] file and may help users of other distributions.<br />
<br />
Some corresponding source tarballs can be downloaded from [https://launchpad.net/~paparazzi-uav/+archive/ppa/+packages paparazzi-uav ppa] on launchpad. (maybe building the packages from source is more reliable in view of dependencies)<br />
<br />
For distributions using RPM packaging, the [http://packages.debian.org/unstable/source/alien alien] tool can be used to convert a .deb package into a .rpm package.<br />
<br />
As with all Wiki pages, also this page is a work in progress. Try to be a big help to the Paparazzi project and improve this page whenever you can. If you have a distribution different from Ubuntu which doesn't satisfy any other dependency and have instructions about compiling it, packaging it, feel free to add any reference on how to do that on this wikipage.<br />
<br />
== Goal ==<br />
<br />
The goal of this page is to clarify about which version of each piece of software has to be compiled, where to find that software, patches needed to make it compile on Linux, maybe even FreeBSD or OSX.<br />
<br />
== Fedora 19 ==<br />
<br />
To build paparazzi-uav on Fedora 19, you must install the next packages from the official repository:<br />
* ocaml<br />
* ocaml-findlib<br />
* ocaml-xml-light<br />
* ocaml-ocamlnet<br />
* ocaml-lablgtk-devel<br />
* libxml2-devel<br />
* SDL-devel<br />
* libusb-devel<br />
<br />
Paparazzi-uav needs to include some ocaml headers when it compiles the simulator, then please be sure that they are included. If not, edit sw/simulator/Makefile and add:<br />
<br />
CAML_CFLAGS = -I/usr/lib64/ocaml<br />
<br />
The following packages must be built from source code (they are not included in the official repository): <br />
* ivy-c <br />
* ivy-ocaml <br />
<br />
Paparazzi-uav was successfully compiled using ivy-c 3.14 (downloaded from SVN repository, revision #3602) and ivy-ocaml 1.2. Please note that the ivy-c version is an unstable version!<br />
<br />
Additionally, you need install the next RPMs to build ivy-c:<br />
* pcre-devel<br />
* libXt-devel<br />
* tcl-devel<br />
* glib2-devel<br />
<br />
Don't forget to set the environment variable PKG_CONFIG before building ivy-ocaml, e.g:<br />
<br />
$ export PKG_CONFIG=/usr/local/lib/pkgconfig<br />
<br />
== Arch Linux ==<br />
<br />
This is a dirty hacked together (not really according to "the Arch Way") install, but works on a fresh installed Archbang GNU/Linux.<br />
<br />
'''NOTE: following issues '''<br />
# Only written and tested for Archbang and Manjaro, not tested on vanilla Arch Linux yet. <br />
# It seems that the error "unbound module GnoCanvas" can be resolved by installing lablgtk2 via yaourt first and then conf-gnomecanvas over opam.<br />
# No symlink from liblglibivy.so.3 and liblglibivy.so.3 to libglibivy.so.3.15, so can't find these files.<br />
# If pkg-config can't find some .pc files, a pkg-config path might not be set and exported properly. Use "pkg-config --variable pc_path pkg-config" to check if the path containing the ''ivy-c.pc'', ''ivy-glib.pc'' and ''ivy-tcl.pc'' files is found.<br />
# "ocamlfind: Package `netclient' not found" -> seems that the opam packages need to be installed in a specific order... (try ocamlnet first, then lablgtk.2.16) <br />
<br />
'''Requirements:'''<br />
# Up to date system<br />
#* pacman -Syyu<br />
# Install Yaourt<br />
#*https://astrofloyd.wordpress.com/2015/01/17/installing-yaourt-on-arch-linux/<br />
<br />
'''Install Paparazzi:'''<br />
# Packages base-devel, yajl and general dependencies<br />
#: <pre># pacman -S base-devel yajl subversion git libusb pcre ocaml camlp4 tcl tk python python-pip sdl glade</pre><br />
# Check if the PKG_CONFIG_PATH points to ''/usr/local/lib/pkgconfig'', otherwise set and export it<br />
#: <pre>$ echo 'export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/' >> ~/.bashrc</pre><br />
# Build and install Ivy-C from Source<br />
#: <pre>$ svn checkout https://svn.tls.cena.fr/svn/ivy/ivy-c/trunk /home/$USER/temp/ivy-c &#10;$ cd /home/$USER/temp/ivy-c/src &#10;$ make &#10;$ sudo make install</pre><br />
# '''Dirty''' All the ivy libs are installed in ''/usr/local/lib64'' and not ''/usr/local/lib'' as the .pc files point to currently. <br/><br />
#:Change in the third line (libdir) in the ivy-c.pc, ivy-glib.pc and ivy-tcl.pc file from ''lib'' to ''lib64'' and the fourth line (includedir) from ''include'' to ''include/Ivy''<br />
# '''Dirty'''For libgivy, libivy and libtclivy (.so and .so.3 ending) is a link directing to the lib with .so.3.15 availaible, but not for libglibivy. <br/><br />
#Create these links for libglibivy<br />
#: <pre>$ sudo ln -s /usr/local/lib64/libglibivy.so.3.15 /usr/local/lib64/libglibivy.so &#10;$ sudo ln -s /usr/local/lib64/libglibivy.so.3.15 /usr/local/lib64/libglibivy.so.3</pre><br />
# Install opam (OCaml packet manager) via yaourt<br />
#: <pre>$ yaourt -S opam</pre><br />
# Initialize opam<br />
#: <pre>$ opam init &#10;$ f &#10;$ ~/.bashrc &#10;$ echo 'eval `opam config env`' >> ~/.bashrc</pre><br />
# Install and pin lablgtk.2.16.0 (2.18.0 will not work)<br />
#: <pre>$ opam install -v lablgtk.2.16.0 &#10;$ opam pin add lablgtk 2.16.0</pre><br />
# Install OCaml packets via opam<br />
#: <pre>$ opam install ocamlfind ocamlnet xml-light pcre ivy</pre><br />
#: If this fails at Ivy related parts check the notes on top of this guide.<br />
# Install ivy-python via pip<br />
#: <pre>$ sudo pip install ivy-python</pre><br />
# Install the Toolchain for Paparazzi (e.g. [https://aur.archlinux.org/packages/gcc-arm-none-eabi-bin/ gcc-arm-none-eabi-bin] from the AUR)<br />
#: <pre>$ sudo pacman -S gcc-arm-none-eabi-bin</pre><br />
<br />
Optional:<br />
<br />
# Install flashing utilities if needed<br />
$ yaourt stlink-git dfu-util<br />
# Install [[JSBSim]] for [[NPS]]<br />
<br />
[[Installation#Getting_the_Source_Code|Download]] and [[Installation#Launching_the_Software|build Paparazzi]]<br />
<br />
== Installing the Cross compiler toolchain ==<br />
<br />
There are currently two different toolchains available that can be used on Linux based systems with Paparazzi. For more information see [[Installation/Linux#ARM_embedded_toolchain]]<br />
<br />
== Installing OCaml packages using OPAM ==<br />
<br />
One possibility to install and manage OCaml packages is [http://opam.ocamlpro.com/ OPAM (OCaml Package Manager)]:<br/><br />
'''Please first check the official [http://opam.ocaml.org/doc/Install.html OPAM install guide] for the simplest method.'''<br/><br />
To install it from the latest git tree run:<br />
<nowiki>git clone https://github.com/OCamlPro/opam.git</nowiki><br />
cd opam<br />
./configure && make<br />
sudo make install<br />
<br />
opam init<br />
eval `opam config env`<br />
<br />
Update your shell environment as per opam init's instructions. E.g. add to your ''~/.profile'':<br />
eval `opam config env`<br />
<br />
Build and install OCaml libs:<br />
opam install ocamlfind xml-light pcre ocamlnet<br />
opam install -v lablgtk<br />
<br />
== IVY ==<br />
<br />
IVY is a simple protocol and a set of open-source libraries and programs that allows applications to broadcast information through text messages, with a subscription mechanism based on regular expressions. The project can be found at: http://www.eei.cena.fr/products/ivy/ <br />
<br />
In the paparazzi project, Ivy is used to send telemetry data to where ever you want.<br />
<br />
NOTE: Do not confuse this IVY with the Apache Ivy project. <br />
<br />
=== Ivy-python ===<br />
<br />
The ivy-python package makes it possible to use the IVY libraries from within the Python programming language. The ivy-python package is architecture independent, so it can be downloaded from the Ubuntu or Debian paparazzi repository.<br />
<br />
The easiest way to instally it on non Debian based systems is using [https://pip.pypa.io/ pip] to install the [https://pypi.python.org/pypi/ivy-python ivy-python package] from [https://pypi.python.org/pypi PyPi - the Python Package Index].<br />
pip install ivy-python<br />
<br />
Or install from the source repository via <br />
<br />
git clone https://gitlab.com/ivybus/ivy-python.git<br />
cd ivy-python<br />
./setup.py install<br />
<br />
=== Ivy-c ===<br />
<br />
To be able to use ivy-c, the libraries need to be installed. <br />
<br />
Required packages (Debian based):<br />
* tk-dev<br />
* libpcre3-dev<br />
* libxt-dev<br />
* pkg-config<br />
* libglib2.0-dev<br />
<br />
Download source, compile and install libraries:<br />
<br />
# mkdir -p /opt/ivy-c <br />
# cd /opt/ivy-c<br />
# svn co https://svn.tls.cena.fr/svn/ivy/ivy-c/trunk<br />
# cd /opt/ivy-c/trunk/src<br />
# make<br />
# make install<br />
<br />
It is possible you get errors of the test module when compiling, just ignore the messages, it is not important for the Paparazzi project. Contact the IVY team to help them also to resolve also the testing makefile issue.<br />
<br />
==== troubleshooting ====<br />
<br />
Error message:<br />
gcc -c -O2 -Wall -Wshadow -fPIC -I/usr/include/tcl8.4 -DTCL_CHANNEL_INTEGRATION ivytcl.c<br />
ivytcl.c:28:17: fatal error: tcl.h: No such file or directory<br />
<br />
The Makefile cannot read the tcl-dev version you have installed and assumes that version 8.4 is installed, but can't find the appropriate folder.<br/><br />
Edit the line 57 of the Makefile from TCLVERS=8.4 according to your installed version, or just delete the 8.4, both work.<br />
<br />
<br />
Can't find 64bit libs:<br />
Your ivy libs were probably installed to /usr/local/lib64 and you have to make symbolic links so that they will be found:<br />
$ sudo ln -s /usr/local/lib64/libivy.so /usr/local/lib64/libivy.so.3 /usr/lib<br />
or <br />
sudo ln -s /usr/local/lib64/libivy.so /usr/local/lib64/libivy.so.3 /usr/local/lib<br />
<br />
<br />
If you get an error relating to ivytestready.c, make the following changes:<br />
mkdir /opt/ivy-c/trunk/tools/Ivy<br />
cd /opt/ivy-c/trunk/tools/Ivy<br />
cp ../../src/ivy.h .<br />
cp ../../src/ivyloop.h .<br />
cp ../../src/ivysocket.h .<br />
cp ../../src/timer.h .<br />
cd ~/develop/ivy-c/trunk/src<br />
make<br />
<br />
This copies files from the src directory to the Ivy folder in tools which did not appear after running svn above.<br />
<br />
=== Ivy-OCaml ===<br />
<br />
ivy-ocaml provides OCaml bindings for ivy-c and is needed for most of the ground segment agents that are written in OCaml like [[Server]] and [[GCS]].<br />
<br />
Download source, compile and install libraries:<br />
<br />
# mkdir -p /opt/ivy-ocaml<br />
# cd /opt/ivy-ocaml<br />
# svn co https://svn.tls.cena.fr/svn/ivy/ivy-ocaml/trunk<br />
# cd /opt/ivy-ocaml/trunk<br />
# make<br />
# make install<br />
<br />
==== ivy-ocaml via OPAM ====<br />
Or use OPAM: While the source repository and debian package is named ''ivy-ocaml'', in OPAM it is only named ''ivy'' (since it is obviously for OCaml).<br />
<br />
$ opam update<br />
$ opam install ivy<br />
<br />
== LPC21ISP ==<br />
<br />
lpc21isp is only needed to serially flash the LPC2148 based autopilots (e.g. [[Lpc21BootloaderUpload bootloader]] for tiny, twog, umarim). LPC21ISP is an in-circuit programming (ISP) tool for the microcontroller used on the Paparazzi autopilot boards. The lpc21isp project is hosted on sourceforge and one can find the source packages and information at http://sourceforge.net/projects/lpc21isp/ <br />
<br />
Get the SVN version via<br />
<br />
$ mkdir -p /opt/lpc21isp<br />
$ cd /opt/lpc21isp<br />
$ svn co https://lpc21isp.svn.sourceforge.net/svnroot/lpc21isp lpc21<br />
<br />
To compile go into the source directory and then do<br />
<br />
$ cd lpc21<br />
$ make -f Makefile clean all<br />
<br />
To install<br />
<br />
$ exportline="PATH=$PATH:/opt/lpc21isp"<br />
$ if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi<br />
$ source ~/.profile<br />
<br />
== Paparazzi-dev Debian/Ubuntu packages ==<br />
<br />
For Ubuntu users, you can install the following packages from standard repository. You can just copy the line(s) and paste into your terminal. But do not copy the $ sign, this symbol is just added on this page to show that it is to be pasted at a normal terminal prompt.<br />
<br />
=== Whole lot in one ===<br />
<br />
sudo apt-get install ocaml libcamlimages-ocaml liblablgtk2-ocaml-dev liblablgtk2-gl-ocaml-dev \<br />
liblablgtk2-gnome-ocaml-dev libxml-light-ocaml-dev libocamlnet-ocaml-dev libpcre-ocaml \<br />
libpcre-ocaml-dev libgnomecanvas2-0 libgnomecanvas2-dev libglade2-0 libglade2-dev make build-essential \<br />
git gnuplot boa m4 libtool libftdi-dev libmpfr-dev tcl8.5-dev xutils-dev<br />
<br />
=== Ocaml and libraries ===<br />
<br />
Ocaml, short for Objective Caml is the most popular variant of the Caml language. The Paparazzi Ground Control Station (GCS) and some of it's tools are crafted in this language.<br />
<br />
* ocaml, ocaml-camlimages-devel, ocaml-lablgtk2-devel, ocaml-xml-light-devel, ocamlnet-ocaml-devel<br />
<br />
$ sudo apt-get install ocaml libcamlimages-ocaml liblablgtk2-ocaml-dev liblablgtk2-gl-ocaml-dev \<br />
liblablgtk2-gnome-ocaml-dev libxml-light-ocaml-dev libocamlnet-ocaml-dev<br />
<br />
=== Gnome canvas Library ===<br />
<br />
The GnomeCanvas is an engine for structured graphics that offers a rich imaging model, high performance rendering, and a powerful, high level API. This widget can be used for flexible display of graphics and for creating interactive user interface elements.<br />
<br />
$ sudo apt-get install libgnomecanvas2-0 libgnomecanvas2-dev<br />
<br />
=== USB Library ===<br />
<br />
The libusb project aims to create a library for use by user level applications to access USB devices regardless of OS. [http://www.libusb.org]<br />
<br />
$ sudo apt-get install libusb-dev<br />
<br />
=== Ocaml PCRE ===<br />
<br />
This OCaml-library interfaces the PCRE (Perl-compatibility regular expressions) C library. it can be used for matching regular expressions which are written in Perl style.<br />
<br />
$ sudo apt-get install libpcre-ocaml libpcre-ocaml-dev<br />
<br />
=== Glade Library ===<br />
<br />
Libglade is a library that performs a similar job to the C source output routines in the GLADE user interface builder. Whereas GLADE's output routines create C source code that must be compiled, libglade builds the interface from an XML file (GLADE's save format) at runtime. This can allow modifying the user interface without recompiling.<br />
<br />
$ sudo apt-get install libglade2-0 libglade2-dev<br />
<br />
=== Tcl/Tk ===<br />
<br />
$ sudo apt-get install tcl-dev<br />
<br />
Also the some utils are required to compile and install Ivy.<br />
<br />
$ sudo apt-get install xutils-dev<br />
<br />
=== Make ===<br />
<br />
GNU Make is an utility which controls the generation of executables and other target files of a program from the program's source files. <br />
<br />
$ sudo apt-get install make<br />
<br />
=== Build essential ===<br />
<br />
$ sudo apt-get install build-essential<br />
<br />
=== Libtool ===<br />
<br />
GNU libtool is a generic library support script. Libtool hides the complexity of using shared libraries behind a consistent, portable interface. Creating the files for Paparazzi software building becomes less cumbersome by using this tool.<br />
<br />
$ sudo apt-get install libtool<br />
<br />
=== libpcre3-dev ===<br />
<br />
Required for compiling Ivy-C.<br />
<br />
$ apt-get install libpcre3-dev<br />
<br />
=== Git Client ===<br />
<br />
Git is a version control system. Version control systems allow many individuals to collaborate on the Paparazzi source code. This is needed to retrieve the latest sourcecode from various packages and Paparazzi sourcecode itself.<br />
<br />
$ sudo apt-get install git<br />
<br />
=== Subversion ===<br />
<br />
Version control system, required for cloning the ivy packages.<br />
<br />
$ apt-get install subversion<br />
<br />
=== GNU Plot ===<br />
<br />
A command-line driven interactive plotting program. Unknow if it is used<br />
<br />
$ sudo apt-get install gnuplot<br />
<br />
=== Meld ===<br />
<br />
Meld is a graphical front end to the diff program. It provides a side-by-side view of the differences between two files. It is used by the Paparazzi Center when configuration changes are not yet saved and the option comes along where one either can keep or view changes made in aircraft- and other configuration files.<br />
<br />
$ sudo apt-get install meld<br />
<br />
=== FTDI library ===<br />
<br />
libftdi is a library that talks to FTDI's 232 type chips, including the popular bitbang mode, using libusb. A library to be able to use with a debugging Autopilot hardware boards.<br />
<br />
$ sudo apt-get install libftdi-dev <br />
<br />
=== MPFR library ===<br />
<br />
The MPFR library is a C library for multiple-precision floating-point computations with correct rounding. MPFR is based on the GMP multiple-precision library. The main goal of MPFR is to provide a library for multiple-precision floating-point computation which is both efficient and has a well-defined semantics.<br />
<br />
$ sudo apt-get install libmpfr-dev<br />
<br />
=== ImageMagick ===<br />
<br />
ImageMagick is a software suite to create, edit, and compose bitmap images. It can read, convert and write images in a variety of formats. Use ImageMagick to translate, flip, mirror, rotate, scale, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves. Being able to modify image based map pictures is a feature that may come in handy one time.<br />
<br />
$ sudo apt-get install imagemagick<br />
<br />
=== Optional on an older OS ===<br />
<br />
If you have an older OS distribution it never hurts to install the following...<br />
<br />
$ sudo apt-get install libx11-6 libx11-dev texinfo libncurses5 libncursesw5 libncursesw5-dev zlibc<br />
<br />
== Paparazzi Main sourcecode ==<br />
<br />
See the main [[Installation#Getting_the_Source_Code]] page<br />
<br />
TIP: <br />
If you get the File "pprz.mli", line 149, characters 78-89: Error: Unbound type constructor Ivy.binding<br />
...this happens when IVY libraries are not yet installed. How to do this, read the part on installing IVY on this page<br />
<br />
<br />
== Useful links ==<br />
<br />
https://launchpad.net/gcc-arm-embedded/<br />
<br />
https://github.com/paparazzi/paparazzi-portability-support<br />
<br />
http://wiki.ubuntuusers.de/GNU_arm-toolchain<br />
<br />
http://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/ARM-Options.html#ARM-Options<br />
<br />
http://mcuprogramming.com/forum/arm/gnu-arm-toolchain-installer/<br />
<br />
http://www.ethernut.de/en/documents/cross-toolchain-osx.html<br />
<br />
http://www.hermann-uwe.de/blog/building-an-arm-cross-toolchain-with-binutils-gcc-newlib-and-gdb-from-source<br />
<br />
[[Category:Software]] [[Category:Developer_Documentation]] [[Category:Installation]]</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=Modems&diff=20391Modems2015-10-05T20:20:59Z<p>NeoFromMatrix: ham licence courses available at the metalab in vienna</p>
<hr />
<div>The Paparazzi autopilots generally feature a TTL serial port to interface with any common radio modem. The bidirectional link provides real-time telemetry and in-flight tuning and navigation commands. The system is also capable overlaying the appropriate protocols to communicate thru non-transparent devices such as the Coronis Wavecard or Maxstream API-enabled products, allowing for hardware addressing for multiple aircraft or future enhancements such as data-relaying, inter-aircraft communication, RSSI signal monitoring and automatic in-flight modem power adjustment. Below is a list of some of the common modems used with Paparazzi, for details on configuring your modem see the [[Airframe_Configuration#Telemetry_.28Modem.29|Airframe Configuration]] and [[XBee_configuration|XBee Configuration]] pages.<br />
<br />
==General comparison==<br />
'''This is ONLY a comparison between modules (found on this page) which work acceptably'''<br />
<br />
All modules listed here work without issue and are generally available.<br />
{| border="1" cellspacing="0" style="text-align:center" cellpadding="2%" <br />
| align="center" style="background:#f0f0f0;"|'''Feature'''<br />
| align="center" style="background:#f0f0f0;"|'''[[Modems#Digi_XBee_Pro_DigiMesh_.2F_802.15.4_.28.22Series_1.22.29|XBee Series 1]]'''<br />
| align="center" style="background:#f0f0f0;"|'''[[Modems#Digi_XBee_Pro_DigiMesh_.2F_802.15.4_.28.22Series_1.22.29|XBee Pro Series 1]]'''<br />
| align="center" style="background:#f0f0f0;"|'''[[Modems#Digi_XBee_Pro_ZB_.2F_ZNet_2.5_.28.22Series_2.22.29|XBee Series 2]]'''<br />
| align="center" style="background:#f0f0f0;"|'''[[Modems#Digi_XBee_Pro_ZB_.2F_ZNet_2.5_.28.22Series_2.22.29|XBee Pro Series 2]]'''<br />
| align="center" style="background:#f0f0f0;"|'''[[Modems#Digi_XBee_868LP|XBee 868LP]]'''<br />
| align="center" style="background:#f0f0f0;"|'''[[Modems#Digi_XBee_Pro_900HP|XBee Pro 900HP]]'''<br />
| align="center" style="background:#f0f0f0;"|'''[[Modems#Digi_XBee_Pro_XSC_900MHz|XBee Pro XSC 900]]'''<br />
| align="center" style="background:#f0f0f0;"|'''[[Modems#Digi_9XTend|Digi 9XTend]]'''<br />
| align="center" style="background:#f0f0f0;"|'''[[Modems#SiLabs_Si1000_SoC_based_modems|SiLabs Si1000]]'''<br />
| align="center" style="background:#f0f0f0;"|'''[[Modems#AC4790-200|Aerocom AC4790-200]]'''<br />
| align="center" style="background:#f0f0f0;"|'''[[Modems#AC4790-1000|Aerocom AC4790-1000]]'''<br />
| align="center" style="background:#f0f0f0;"|'''[[Modems#Laird_RM024|Laird RM024 50mW]]'''<br />
| align="center" style="background:#f0f0f0;"|'''[[Modems#Laird_RM024|Laird RM024 125mW]]'''<br />
| align="center" style="background:#f0f0f0;"|'''[[Modems#RN-41_Bluetooth_module.28Sparkfun.27s_WRL-08497.29|RN-41 Bluetooth]]'''<br />
|-<br />
| style="background:#f0f0f0;"|'''frequency'''||2,4GHz||2,4GHz||2,4GHz||2,4GHz||868MHz||900MHz||900MHz||900MHz, 2.4GHz||240-960MHz||900MHz||900MHz||2,4GHz||2,4GHz||2,4GHz<br />
|-<br />
| style="background:#f0f0f0;"|'''output power'''||1mW||63mW (US) 10 mW (Int'l)||2mW||63mW||5mW||250mW||250mW||1mW-1W||max 100mW||5-200mW||5-1000mW||2,5-50mW||2,5-125mW||32mW<br />
|-<br />
| style="background:#f0f0f0;"|'''RF speed'''||250kbps||250kbps||250kbps||250kbps||10kbps, 80kbps||10 or 200kbps||10, 20kbps||9.6, 115.2kbps|| ||76.8kbps||76.8kbps||280, 500kbps||280, 500kbps||300kbps<br />
|-<br />
| style="background:#f0f0f0;"|'''antenna'''||chip, wire, rpsma, u.fl||chip, wire, rpsma, u.fl||chip, wire, rpsma, u.fl||chip, wire, rpsma, u.fl||external required||wire, rpsma, u.fl||wire, rpsma, u.fl||rpsma, MMCX||external required||MMCX, internal Antenna||MMCX||u.fl, chip, both||u.fl, chip, both||pcb trace<br />
|-<br />
| style="background:#f0f0f0;"|'''pinout'''||XBee||XBee||XBee||XBee||SMD||XBee||XBee||20 pin 2,54mm/USB||SMD (42 pin LGA)||20 pin mini connector||20 pin mini connector||XBee/SMD||XBee/SMD||SMD<br />
|-<br />
| style="background:#f0f0f0;"|'''price'''||16€||26€||14€||28€||18€||32€||32€||150€||4€||52€||64€||30€||30€||20€<br />
|-<br />
| style="background:#f0f0f0;"|'''for Country'''||Worldwide||Worldwide||Worldwide||Worldwide||Europe||North America, Australia||North America, Australia||Worldwide||Worldwide||North America, Australia||North America, Australia||Europe||North America||Worldwide<br />
|}<br />
<br />
== Frequencies ==<br />
<br />
Analog and digital signals (video and data/modem) can not be transmitted over the same frequency band since the analog signal will "block" the digital one. (Attention ! the common 2.4 or 5.8GHz frequencies have multiple channels, if the analog and digital transmitter/receiver modules are set up to different channels/frequencies, they should work (even on 2.4GHz)).<br />
<br />
You may want to inform yourself about your countries laws ! Different countries allow different frequencies at different power. <br/><br />
Sending on a wrong frequency or with too much power may end in a serious lawsuit !<br />
<br />
Digi: [http://www.digi.com/technology/rfmodems/agencyapprovals Government Agency Certifications]<br />
<br />
== HAM / CEPT Licence ==<br />
<br />
If possible, consider making a HAM radio (amateur radio) licence. (e.g. CEPT, depends on yur locality)<br />
<br />
You will learn about the radio technology, operational technology and legislation.<br/><br />
With a HAM radio licence, you can also use other frequencies or transmit on a higher power. (e.g. In some countries, the 5.8GHz video transmission is for non licenced people restricted to 10mW!)<br/><br />
<br />
'''Licence Pros'''<br />
* You will be informed well about the (local and international) legislations.<br />
* You can transmit on a higher power (depends on frequency).<br />
* You will learn a lot about the techniques and be more than a standard "consumer" of radio electronic products.<br />
* It will be easier to find faults in your radio systems.<br />
* You can built (if you want) high gain/focused antennas which can gice you a better signal, wider range and won't disturb anyone else. <br />
* Well educated prople respecting the legislation just looks much better in looks to UAV's :)<br />
<br />
'''Licence Cons'''<br />
* You will need to learn for the test (can be compared with a diverce licence).<br />
* The certificate and books will cost about 70€ (total, can vary !).<br />
* Maybe some costs (per year) for your call sign.<br />
<br />
=== CEPT Licence in Austria ===<br />
<br />
A short description about getting the CEPT 1 (not the CEPT Novice !) licence in Austria.<br />
<br />
You will need the appropriate books which cost 50€ (70€ if you want them with the ask catalog and answers which can be helpful) and rough 18€ for the exam and certificate. The ÖVSV offers also some courses, but you can also learn everything with the books.<br />
<br />
The are (regularly?) HAM licence courses at the https://metalab.at/ in Vienna.<br />
<br />
To be continued...<br />
<br />
=== Links ===<br />
<br />
[http://www.oevsv.at/ Austrian ÖVSV]<br/><br />
[http://www.darc.de/ German DARC]<br />
<br />
== Digi XBee modules ==<br />
<br />
Digi (formerly Maxstream) offers an increasing variety of Zigbee protocol modems well suited for Paparazzi in 2.4 GHz, 900MHz and 868Mhz frequencies. The "Pro" series are long range, up to 40km! Standard series are slightly smaller/lighter/lower power consumption and very short range. All versions are all pin compatible and weigh around 2 grams with wire antennas. All Digi modems can be operated in transparent mode (as a serial line replacement) or in "API mode" with hardware addressing, managed networking, and RSSI (signal strength) data with the Paparazzi "Xbee" option. <br />
<br />
Four antenna options are offered: RP-SMA, U-FL, wire antenna, chip antenna<br />
<br />
* XBee (PRO) ZB (the current series)<br />
* XBee (PRO) ZNet 2.5 (formerly Series 2) (only legacy -> use XBee-PRO ZB)<br />
The XBee & XBee-PRO ZB share hardware (ember stack) with XBee & XBee-PRO ZNet 2.5. As a result, modules can be "converted" from one platform to another by loading different firmware onto a given module.<br />
<br />
These two also share the same hardware and can be converted from one to another by flashing a different firmware:<br />
* XBee-PRO 802.15.4 (formerly Series 1)<br />
* XBee-PRO DigiMesh 2.4<br />
<br />
'''Note: Modules based on Freescale chipset (formerly Series 1) are not compatible with Ember chipset based modules (Series 2).'''<br />
<br />
If only point to point or point to multipoint communication is required 802.15.4 will do the job. These are designed for high data rates and low latency.<br/><br />
Modules with Zigbee firmware are needed for mesh functionality(communication between the UAV's)<br />
<br />
See the [[XBee_configuration|XBee Configuration]] page. This [http://pixhawk.ethz.ch/tutorials/how_to_configure_xbee tutorial] is also good to configure and get started with XBee Pro.<br />
<br />
=== Module Comparison ===<br />
{|border="1"<br />
|-valign="top"<br />
||'''Module'''||'''Point-to-Multipoint'''||'''ZigBee/Mesh'''||'''Chipset'''|||'''Software stack'''||'''Frequency'''||'''TX Power normal/PRO'''||'''Notes'''<br />
|-<br />
|'''XBee ZB'''<br />
|<br />
|yes<br />
|Ember<br />
|EmberZNet PRO 3.1 (ZigBee 2007)<br />
|2.4 GHz<br />
|2mW/50mW<br />
|coordinator needed<br />
|-<br />
|'''XBee ZNet 2.5'''<br />
|<br />
|yes<br />
|Ember<br />
|EmberZNet 2.5 ZigBee<br />
|2.4 GHz<br />
|2mW/50mW<br />
|(only legacy -> use XBee-PRO ZB) coordinator needed<br />
|-<br />
|'''XBee DigiMesh 2.4'''<br />
|<br />
|yes<br />
|Freescale<br />
|<br />
|2.4 GHz<br />
|<br />
|all nodes equal (no special coordinators/routers/end-devices)<br />
|-<br />
|'''XBee 802.15.4'''<br />
|yes<br />
|<br />
|Freescale<br />
|<br />
|2.4 GHz<br />
|<br />
|<br />
|-<br />
|'''XBee-PRO 868'''<br />
|yes<br />
|<br />
|?<br />
|<br />
|868 MHz<br />
|500mW<br />
|Only High Power Frequency allowed in the UK. 2.4GHz limited to 10mW<br />
|}<br />
<br />
<br />
==== Pinout ====<br />
<br />
[[Image:Maxstream_Xbee_pinout.jpg|left|thumb|Maxstream XBee pinout]]<br />
<br style="clear:both"><br />
<br />
{|border="1"<br />
|-valign="top"<br />
||''Xbee 20-pin Header''||''Name''||''Notes''||''Suggested Color''||<br />
|-<br />
|1<br />
| +3.3v<br />
| Power<br />
|Red<br />
|-<br />
|2<br />
|DOUT<br />
|Tx output - connect to Autopilot Rx<br />
|Green<br />
|-<br />
|3<br />
|DIN<br />
|Rx input - connect to Autopilot Tx<br />
|Blue<br />
|-<br />
|10<br />
|GND<br />
| Ground<br />
|Black<br />
|}<br />
<br />
The image view is from above, top, thus NOT at the side where the connector pins come out<br />
<br />
Note : DTR and RTS need to be wired for upgrading firmware<br />
<br />
=== GCS Adaptation ===<br />
<br />
There are several vendors of hardware to connect the ground XBee radio modem to the GCS computer.<br/><br />
More information about general USB-Serial adapters can be found on the [[Serial_Adapter]] page.<br />
<br />
====Adafruit====<br />
<br />
[[Image:xbeeadapter_LRG.jpg|thumb|left|Adafruit XBee adapter board]][[Image:xbeeadapterftdi_LRG.jpg|thumb|Adafruit XBee adapter with FTDI cable]]<br />
[http://www.adafruit.com/index.php?main_page=product_info&cPath=29&products_id=126 Adafruit] offers a great adapter board kit for the Xbee modules that includes a 5-3.3V voltage regulator, power and activity LEDs, and pins to connect directly to your FTDI cable for $10! Some assembly required.<br />
<br />
<br style="clear:both"><br />
<br />
====Droids====<br />
<br />
[[Image:XBee_Simple_Board.jpg|thumb|left|XBee Simple Board]]<br />
<br />
[[Image:XBee_USB_Board.jpg|thumb|left|XBee USB Board]]<br />
<br />
[http://www.droids.it/cmsvb4/content.php?143-990.001-XBee-Simple-Board XBee Simple Board]<br />
<br />
Simple breakout board with voltage regulator.<br />
<br />
[http://www.droids.it/cmsvb4/content.php?152-990.002-XBee-USB-Board XBee USB Board]<br />
<br />
Adapter with FTDI chip for direct usb connection.<br />
<br />
<br style="clear:both"><br />
<br />
====PPZUAV====<br />
<br />
[[Image:FTDI_Utility_Board.jpg|thumb|left|FTDI Utility Board 1.0]]<br />
<br />
[https://www.ppzuav.com/osc/product_info.php?products_id=111 ppzuav.com product link]<br/><br />
More information at the [[Serial_Adapter#FTDI_utility_Board]] page.<br />
<br />
FTDI Utility Board 1.0 with FTDI232RL<br/><br />
On board XBEE connector and molex picoblade connectors. <br />
<br />
<br style="clear:both"><br />
<br />
====Sparkfun====<br />
<br />
[[Image:XBee_Explorer_USB.jpg|thumb|left|XBee Explorer USB]]<br />
<br />
[http://www.sparkfun.com/products/8687 sparkfun.com]<br />
<br />
XBee Explorer USB with FTDI232RL<br />
<br />
<br style="clear:both"><br />
<br />
=== Digi XBee Pro DigiMesh / 802.15.4 ("Series 1") ===<br />
*Note: Products based on XBee ZNet 2.5 (formerly Series 2) modules do not communicate with products based on XBee DigiMesh / 802.15.4 (formerly Series 1) modules.<br />
<br />
These relatively cheap and light modules implement the [http://www.zigbee.org/en/index.asp ZigBee/IEEE 802.15.4] norm. They allow up to 1.6km (1 mile) range (Paparazzi tested to 2.5km (1.5 miles)). The main drawback of using such 2.4Ghz modules for datalink is that it will interfere with the 2.4Ghz analog video transmitters and a inevitable decrease in range when in proximity to any wifi devices. For the plane, get the whip antenna version if you are not planning to build a custom antenna.<br />
<br />
{|<br />
|-valign="top"<br />
|[[Image:Xbee_Pro_USB_RF_Modem.jpg|thumb|left|XBee Pro USB Stand-alone Modem (XBP24-PKC-001-UA)]]<br />
|<br />
* Frequency Band 2.4GHz<br />
* Output Power 100mW (Xbee Pro)<br />
* Sensitivity -100 dBm <br />
* RF Data Rate Up to 250 Kbps<br />
* Interface data rate Up to 115.2 Kbps<br />
* Power Draw (typical) 214 mA TX / 55 mA RX <br />
* Supply Voltage 3.3v<br />
* Range (typical, depends on antenna & environment) Up to 1500m line-of-sight <br />
* Dimensions 24 x 33mm<br />
* Weight 4 grams<br />
* Interface 20-pin mini connector <br />
* Chip antenna, ¼ monopole integrated whip antenna or a U.FL antenna connector (3 versions)<br />
* Price: 16€, Pro 26€<br />
|<br />
[[Image:XBee_pro.jpg|thumb|left|XBee Pro OEM Modem]]<br />
|}<br />
Mouser: [http://au.mouser.com/Search/ProductDetail.aspx?qs=sGAEpiMZZMtJacPDJcUJYzVn8vIv7g2fIpf5DCzJqko%3d 888-XBP24-PKC-001-UA]<br><br />
NOTE: If you wish to use this unit with another XBee type other than the 802.15.4 (i.e. XBee-PRO ZB) then purchase a modem with the U.fl connector.<br />
<br />
==== Documentation ====<br />
<br />
* [http://www.maxstream.net/products/xbee/xbee-pro-oem-rf-module-zigbee.php product page]<br />
* [http://www.maxstream.net/products/xbee/datasheet_XBee_OEM_RF-Modules.pdf datasheet]<br />
* [http://www.maxstream.net/products/xbee/product-manual_XBee_OEM_RF-Modules.pdf user manual]<br />
* To program your Xbee you need X-CTU you can download it [http://www.digi.com/support/productdetl.jsp?pid=3352&osvid=57&tp=5&s=316 here]. (only windows)<br />
* explanation on X-CTU [http://www.ladyada.net/make/xbee/configure.html here].<br />
* [http://ftp1.digi.com/support/firmware/update/xbee/ Drivers for XB24 and XBP24 modules]<br />
<br />
=== Digi XBee Pro ZB / ZNet 2.5 ("Series 2") ===<br />
<br />
The low-power XBee ZB and extended-range XBee-PRO ZB use the ZigBee PRO Feature Set for advanced mesh networking.<br />
<br />
{|<br />
|-valign="top"<br />
|[[Image:XBee_Pro_2SB.jpg|thumb|left|Digi XBee Pro ZB]]<br />
|<br />
* Low-cost, low-power mesh networking<br />
* Interoperability with ZigBee PRO Feature Set devices from other vendors*<br />
* Support for larger, more dense mesh networks<br />
* 128-bit AES encryption<br />
* Frequency agility<br />
* Over-the-air firmware updates (change firmware remotely)<br />
* ISM 2.4 GHz operating frequency<br />
* XBee: 2 mW (+3 dBm) power output (up to 400 ft RF LOS range)<br />
* XBee-PRO: 50 mW (+17 dBm) power output (up to 1 mile RF LOS range)<br />
* RPSMA connector, U.FL connector, Chip antenna, or Wired Whip antenna<br />
* price : 14€, Pro 28€<br />
|<br />
|}<br />
These are available from Mouser:<br><br />
[http://au.mouser.com/Search/Refine.aspx?Keyword=888-XBP24-Z7WIT-004 888-XBP24-Z7WIT-004] XBee-PRO ZB with whip antenna<br><br />
[http://au.mouser.com/Search/Refine.aspx?Keyword=XBP24-Z7SIT-004 888-XBP24-Z7SIT-004] XBee-PRO ZB with RPSMA<br />
<br />
See [[XBee_configuration|XBee Configuration]] for setup.<br />
<br />
==== Documentation ====<br />
* [http://www.digi.com/products/wireless/zigbee-mesh/xbee-zb-module.jsp http://www.digi.com/products/wireless/zigbee-mesh/xbee-zb-module.jsp]<br />
<br />
=== Digi XBee Pro 868 ===<br />
<br />
'''WARNING - THESE MODEMS HAVE A 10% DUTY CYCLE, AND CURRENTLY HAVE SEVERE ISSUES WITH PAPARAZZI'''<br />
<br />
868MHz is a limited band. Please read the [[868MHz Issues]]<br />
<br />
XBee-PRO 868 modules are long range embedded RF modules for European applications. Purpose-built for exceptional RF performance, XBee-PRO 868 modules are ideal for applications with challenging RF environments, such as urban deployments, or where devices are several kilometers apart.<br />
<br />
<br />
{|<br />
|-valign="top"<br />
|[[Image:xbeeproxsc-rpsma.jpg|thumb|left|Maxstream XBee Pro 868]]<br />
|<br />
* 868 MHz short range device (SRD) G3 band for Europe<br />
* Software selectable Transmit Power<br />
* 40 km RF LOS w/ dipole antennas<br />
* 80 km RF LOS w/ high gain antennas (TX Power reduced)<br />
* Simple to use peer-to-peer/point-to-mulitpoint topology<br />
* 128-bit AES encryption<br />
* 500 mW EIRP<br />
* 24 kbps RF data rate<br />
* price : ~70 USD<br />
|<br />
|}<br />
<br />
See [[XBee_configuration#XBee_Pro_868_MHZ|XBee Configuration]] for setup.<br />
<br />
==== Documentation ====<br />
* [http://www.digi.com/products/wireless/point-multipoint/xbee-pro-868.jsp http://www.digi.com/products/wireless/point-multipoint/xbee-pro-868.jsp]<br />
<br />
=== Digi XBee 868LP ===<br />
<br />
XBee 868LP modules are a low-power 868 MHz RF module for use in Europe. The range is shorter than it's brother the XBee PRO-868, but it can use the 868 G4 band with hopping which does not have restrictions on it's duty cycle. This is a big advantage if one want to have a good stream of telemetry data<br />
<br />
{|<br />
|-valign="top"<br />
|[[Image:868lp.jpg|thumb|left|XBee 868LP]]<br />
|<br />
* 868 MHz short range device (SRD) G4 band for Europe<br />
* 4 km RF LOS w/ u.fl antennas<br />
* 5 mW EIRP<br />
* 10 or 80 kbps RF data rate<br />
* price : 18€<br />
|<br />
|}<br />
<br />
==== Documentation ====<br />
* [http://www.digi.com/products/wireless-wired-embedded-solutions/zigbee-rf-modules/zigbee-mesh-module/xbee-868lp#overview http://www.digi.com/products/wireless-wired-embedded-solutions/zigbee-rf-modules/zigbee-mesh-module/xbee-868lp#overview]<br />
<br />
==== Trial ====<br />
<br />
With a quickly crafted and not optimal positioned antenna on the airframe we managed to get the advertised 4000 meter range. Data throughput was not high and the Iridium Telemetry XML configuration document was therefore used. All in all, cheap, easy to setup, pin compatible with regular modules and quite a range and usable in Europe without hassle.<br />
<br />
=== Digi XBee Pro 900HP ===<br />
* Frequency band 900Mhz<br />
* RF rate 10 or 200 kbps<br />
* up to 250mW output power<br />
* 5 to 8 gramm<br />
* price: 32€<br />
<br />
==== Documentation ====<br />
[http://ftp1.digi.com/support/documentation/90002173_H.pdf http://ftp1.digi.com/support/documentation/90002173_H.pdf]<br />
<br />
=== Digi XBee Pro XSC 900MHz ===<br />
<br />
Maxstream has recently announced a promising new line of modems combining the small size and low cost of their popular Xbee line with the long range and 2.4 GHz video compatibility of their high end 900 MHz models. Sounds like the perfect modem for anyone who can use 900 MHz. Give them a try and post your results here!<br />
{|<br />
|-valign="top"<br />
|[[Image:xbeeproxsc-rpsma.jpg|thumb|left|Maxstream XBee Pro XSC]]<br />
|<br />
* Frequency Band 900 MHz<br />
* Output Power 100 mW (+20 dBm)<br />
* Sensitivity -100 dBm <br />
* RF Rate: 10 or 20 kbps<br />
* Range (typical, depends on antenna & environment) Up to 24km (15 miles) line-of-sight <br />
* Interface 20-pin mini connector (Xbee compatible pinout)<br />
* RPSMA, integrated whip antenna or U.FL antenna connector (3 versions)<br />
* price : 32€<br />
|<br />
|}<br />
<br />
==== Documentation ====<br />
* [http://www.digi.com/products/wireless/point-multipoint/xbee-pro-xsc.jsp http://www.digi.com/products/wireless/point-multipoint/xbee-pro-xsc.jsp]<br />
<br />
==== Trials ====<br />
Tested one today and it worked great. Going to try a multiUAV test with it soon<br />
--Danstah<br />
<br><br />
<br><br />
MultiUAV tests concluded this is probably not the best module to use. Even though it says you can change the baudrate inside x-ctu that is not the case, it is fixed at 9600 bps. This is a great modem however for single UAV's and I do recommend.<br />
--Danstah<br />
<br><br />
<br><br />
Why would the European (868 MHz) be good to 24kbps and this only to 9600? When I was altering my XBees (2.4Ghz Pro's) I had this problem altering baud rates until I read you have to send a "commit and reboot" type command after setting the baud rate. Could this be the case? --GR<br />
<br />
=== Digi 9XTend ===<br />
<br />
These larger units have been tested on the 900Mhz band, but are also available in 2.4Ghz. They are a bit on the heavy side, about 20 grams, but give good performance at range. They have adjustable transmit power settings from 100mW to 1W. Testing has shown range up to 5.6km (3.5 Miles) with XTend set to 100mW with small 3.1dB dipole antenna.<br />
<br />
{|<br />
|-valign="top"<br />
|<br />
[[Image:XTend_USB_RF_Modem.jpg|frame|left|9XTend USB Modem]]<br />
|<br />
* Frequency Band 900Mhz and 2.4Ghz (2 versions)<br />
* Output Power 1mW to 1W software selectable<br />
* Sensitivity -110 dBm (@ 9600 bps)<br />
* RF Data Rate 9.6 or 115.2 Kbps<br />
* Interface data rate up to 230.4 Kbps<br />
* Power Draw (typical) 730 mA TX / 80 mA RX <br />
* Supply Voltage 2.8 to 5.5v<br />
* Range (typical, depends on antenna & environment) Up to 64km line-of-sight <br />
* Dimensions 36 x 60 x 5mm<br />
* Weight 18 grams<br />
* Interface 20-pin mini connector or USB<br />
* RF connector RPSMA (Reverse-polarity SMA) or MMCX (2 versions)<br />
* price : 150€<br />
|<br />
[[Image:Xtend_module.jpg|frame|left|9XTend OEM Modem]]<br />
|}<br />
<br />
==== Pinout ====<br />
<br />
[[Image:Maxstream_9XTend_Pinout.gif|thumb|left|Maxstream 9XTend Pinout]]<br />
<br />
{| border="1"<br />
|-valign="top"<br />
||'''''9XTend 20-pin Header'''''||'''''Name'''''||'''''Tiny Serial-1 Header'''''||'''''Notes'''''<br />
|-<br />
||1||GND||1 (GND)||Ground <br />
|-<br />
||2||VCC||2 (5V)||5V power (150mA - 730mA Supplied from servo bus or other 5V source)<br />
|-<br />
||5||RX||8 (TX)||3-5V TTL data input - connect to Tiny TX<br />
|-<br />
||6||TX||7 (RX)||5V TTL data output - connect to Tiny RX<br />
|-<br />
||7||Shutdown||2||This pin must be connected to the 5V bus for normal operation<br />
|}<br />
Notes:<br><br />
* 9XTend can run on voltages as low as 2.8V but users are strongly advised against connecting any modem (especially high power models) to the sensitive 3.3V bus supplying the autopilot processor and sensors.<br />
<br style="clear:both"><br />
<br />
==== Documentation ====<br />
<br />
* [http://www.maxstream.net/products/xtend/oem-rf-module.php product page]<br />
* [http://www.maxstream.net/products/xtend/datasheet_XTend_OEM_RF-Module.pdf datasheet]<br />
* [http://www.maxstream.net/products/xtend/product-manual_XTend_OEM_RF-Module.pdf user manual]<br />
<br />
==== Configuration ====<br />
<br />
These modems need to be carefully configured based on your usage scenario to obtain the best possible range and link quality. In addition, it is always good to make sure the firmware is up to date.<br />
<br />
Some typical configurations that may work well, but can still depend your particular situation, are given below. For further details, be sure to consult the XTend users manual. Your application may need a different or modified configuration. The radiomodems do not need identical settings and can in fact be optimized with different settings. A good example is delays and retries: if each radio has the same number of retries and no delay, when a collision occurs each will continuously try to re-transmit, locking up the transmission for some time with no resolution or successful packet delivery. Instead, it is best to set the module whose data should have a lower latency to have no delay and a lower number of retries, while the other module has a delay set (RN > 0) and a greater number of retries. See acknowledged mode example below.<br />
<br />
* Acknowledged Polling Mode ('''Recommended'''):<br />
** This causes one radio to be the base and the other(s) to be the remote(s). It eliminates collisions because remotes do not send data unless requested by the base. It can work in acknowledged mode (RR>0), basic reliable mode (MT>0) or in basic mode (no acknowledgement or multiple packets). It is recommended that the lower latency and/or higher data rate side be configured as the base (i.e. if you are sending lots of telemetry then the air module configured as the base is probably a good idea, but if you are using datalink joystick control, the ground side might be better as the base. It may require some experimentation).<br />
* Acknowledged Point-to-(Multi)Point Mode:<br />
** Each radio sends a packet and requests and acknowledgement that the packet was sent from the receiving side. The retries and delays must be set appropriately to ensure packet collisions are dealt with appropriately. It can also work without acknowledgements in basic reliable mode (MT>0) without any acknowledgements (RR=0, MT=0). Some experimentation may be required.<br />
<br />
{| border="1"<br />
|-valign="top"<br />
||'''''Setting Name'''''||colspan="2"|'''''Acknowledged Mode'''''||colspan="2"|'''''Polling Mode (Acknowledged)'''''||'''''Notes'''''<br />
|-<br />
|| ||'''''Airside Module'''''||'''''Groundside Module'''''||'''''Base Module'''''||'''''Remote Module'''''||<br />
|-<br />
||BD||6||6||6||6||Adjust to match your configured autopilot and ground station baud rates (default for these is 57600bps)<br />
|-<br />
||DT||default||default||0x02||0x01||Can be adjusted if consistency maintained across addressing functionalities (see manual)<br />
|-<br />
||MD||default||default||3 (0x03)||4 (0x04)||<br />
|-<br />
||MT||0||0||0||0||Use this to enable Basic Reliable transmission, link bandwidth requirement increases (see manual)<br />
|-<br />
||MY||default||default||0x01||0x02||Can be adjusted if consistency maintained across addressing functionalities (see manual)<br />
|-<br />
||PB||default||default||0x02||default||Can be adjusted if consistency maintained across addressing functionalities (see manual)<br />
|-<br />
||PD||default||default||default||default||Can be adjusted to increase polling request rate and DI buffer flush timeout (see manual)<br />
|-<br />
||PE||default||default||0x02||default||Can be adjusted if consistency maintained across addressing functionalities (see manual)<br />
|-<br />
||PL||default||default||default||default||''Transmit power level should be reduced for lab testing!!''<br />
|-<br />
||RN||0 (0x00)||8 (0x08)||default||default||<br />
|-<br />
||RR||6 (0x06)||12 (0x0C)||6 (0x06)||12 (0x0C)||<br />
|}<br />
<br />
'''Note:''' All settings are assumed to be default except those listed. Those listed are in decimal unless hex 0x prefix included. Depending on your firmware version, slight modifications may be necessary.<br />
<br />
Here is some additional information and alternative instructions to configure the polling mode from the Digi site: [http://www.digi.com/support/kbase/kbaseresultdetl?id=2178 Polling Mode for the 9XTend Radio Modem]<br />
<br />
== SiLabs Si1000 SoC based modems ==<br />
<br />
The Si1000 radio System on Chip (SOC) produced by SiLabs is found in a number of radio modules, for example the cheap and widely used HopeRf module. There is [https://github.com/tridge/SiK open source firmware] for these radios which makes them suitable for use in MAVs. <br />
<br />
The latest SiK firmware supports also mesh topologies.<br />
<br />
Online documentation for the Sik firmware shows how to configure it for various jurisdictions. The firmware supports 433 MHz, 470 MHz, 868 MHz and 900 MHz radios. The new RFD868 also orks in the European spectrum licences (868 MHz) <br />
<br />
Note: When using a SiK firmware radio with paparazzi, you should set "ATS6=0" (MavLink packing off) and configure paparazzi for transparent serial mode. Better still create a special module to na=make full use of the RFDxxx modem<br />
<br />
[http://www.rfdesign.com.au/index.php/rfd900 This module] is well proven and supports antenna diversity. A combination of 6dbi Yagi plus a dipole on the ground station, with a pair of orthogonality oriented dioples in the airframe, has been extensively tested and proven reliable at >8km range (theoretical range of > ~40km).<br />
<br />
Alternatively, for shorter range a pair of cheap generic HopeRF-based modems [http://rctimer.com/index.php?gOo=goods_details.dwt&goodsid=815 such as these]<br />
<br />
The RFD900 can be paired with cheap generic (single front-end) modules, if for example you use a small short range airframe with a ground station that's also used for long range operations.<br />
<br />
== Laird (ex Aerocom) ==<br />
Lairds's API mode is already implemented but some system integration is required. Full API more with addressed packets works well and was tested with AC4790-1x1 5mW low power modules. Maximim range achieved with a whip quater-wave antenna was 1Km.<br />
<br />
How to use this modem on ground station side? [http://paparazzi.enac.fr/wiki/index.php/User:SilaS#SDK-AC4868-250_ground_modem_part]<br />
<br />
See folder paparazzi3 / trunk / sw / aerocomm. It has all the required files to use this modem on the airborne and ground station side. The link.ml file is a direct replacement of the "main" link.ml file of the ground sttaion and will be merged into it in the future.. or you can do it as well.<br />
<br />
<br />
{|<br />
|<br />
=== AC4790-200 ===<br />
* Frequency 902-928MHz (North America, Australia, etc).<br />
* Output Power 5-200mW<br />
* Sensitivity (@ full RF data rate) -110dB<br />
* RF Data Rate up to 76.8 Kbps<br />
* INterface Data Rate Up to Up to 115.2 Kbps <br />
* Power Draw (typical) 68 mA<br />
* Supply Voltage 3.3v & 5.5V<br />
* Range (typical, depends on antenna & environment) Up to 6.4 kilometers line-of-sight <br />
* Dimensions 42 x 48 x 5mm <br />
* Weight < 20 grams<br />
* Interface 20-pin mini connector <br />
* Antenna MMCX jack Connector or internal<br />
* price : 52€<br />
|<br />
[[Image:ac4868_transceiver.jpg|thumb|left|AC4868 OEM Modem]]<br />
|<br />
|-<br />
|<br />
=== AC4790-1000 ===<br />
* Frequency 902-928MHz (North America, Australia, etc).<br />
* Output Power 5-1000mW<br />
* Sensitivity (@ full RF data rate) -99dB<br />
* RF Data Rate up to 76.8 Kbps<br />
* INterface Data Rate Up to Up to 115.2 Kbps <br />
* Power Draw (typical) 650 mA<br />
* Supply Voltage 3.3V only<br />
* Range (typical, depends on antenna & environment) Up to 32 kilometers with high-gain antenna<br />
* Dimensions 42 x 48 x 5mm <br />
* Weight < 20 grams<br />
* Interface 20-pin mini connector <br />
* Antenna MMCX jack Connector<br />
* price : 64€<br />
|}<br />
<br />
=== Pinout ===<br />
<br />
[[Image:Aerocomm_AC4868_pinout.jpg|thumb|left|Laird AC4868 modem pinout]]<br />
[[Image:Aerocomm_AC4490-200_wired.jpg|thumb|left|Laird AC4490 wiring example]]<br />
<br style="clear:both"><br />
<br />
{| border="1"<br />
|+ Wiring the Laird AC4868 to the Tiny<br />
|-valign="top"<br />
||'''''AC4868 20-pin Header'''''||'''''Name'''''||'''''Color'''''||'''''Tiny v1.1 Serial-1'''''||'''''Tiny v2.11 Serial'''''||'''''Notes'''''<br />
|-<br />
||2||Tx||green||7||7||''(Note 1)''<br />
|-<br />
||3||Rx||blue||8||8||''(Note 1)''<br />
|-<br />
||5||GND||black||1||1|| -<br />
|-<br />
||10+11||VCC||red||2||3||+3.3v ''(Note 2)''<br />
|-<br />
||17||C/D||white||3||?||Low = Command High = Data<br />
|}<br />
''Note 1 : names are specified with respect to the AEROCOMM module''<br />
<br />
''Note 2 : AC4790-1000 needs pins 10 and 11 jumped to work properly''<br />
<br />
<br />
<br />
=== Laird RM024 ===<br />
[[Image:Laird_LT2510_RM024-P125-C-01-side.jpg|thumb|RM024 P125]]<br />
[[Image:Lt2510_prm123.jpg|thumb|LT2510 Modem]]<br />
The RM024 replaces the discontinued LT2510 (they are backwards compatible).<br />
<br />
General features:<br />
* Frequency Band 2.4GHz<br />
* Output Power 2,5mW - 125mW<br />
* Sensitivity -98dbm @ 280kbps/-94 dBm @ 500kbps<br />
* RF Data Rate 280/500 kbps<br />
* UART up to 460800 baud<br />
* Power Draw 90mA - 180mA TX / 10mA RX<br />
* Supply Voltage 3.3v<br />
* Range up to 4000m<br />
* Dimensions 26 x 33 x 4mm<br />
* Weight 4 grams<br />
* Interface 20-pin mini connector (smd solder pad or XBee compatible pin header)<br />
* Chip antenna, U.FL antenna connector or both<br />
* Price: 29-31€ @ mouser (SMD / XBEE header)<br />
<br />
Two different mounting/pinuts are available:<br/><br />
* smd version: can be soldered on a pcb<br/><br />
* pin header: standard XBEE pinout (this is the SMD version mounted on a seperate pcb with male pin headers)<br />
<br />
Available in two different output power versions:<br />
{|border="1"<br />
|-valign="top"<br />
||''value''||''50mW version''||''125mW version''<br />
|-<br />
|output power<br />
| 2,5 mW - 50 mW<br />
| 2,5 mW - 125 mW<br />
|-<br />
|output power dbm<br />
|4 dbm - 17 dbm<br />
|4 dbm - 21 dbm<br />
|-<br />
|TX drain<br />
|90mA<br />
|<180mA<br />
|-<br />
|max range (280kbps with 2 dbi antenna)<br />
|2400m<br />
|4000m<br />
|-<br />
|approval<br />
|CE for EU, FCC/IC for USA,<br />
Canada PRM122/123 also for Japan<br />
|FCC/IC for USA, Canada <br />
|}<br />
<br />
The RM024 uses frequency hopping (FHSS) which needs a client/server model. That means that one modem (most appropriately the ground station modem) needs to be set to server mode. It will transmit a beacon message and have all client modems synchronize to that in a time and frequency hopping scheme manner. For that all modems need to have the same channel (in fact the hopping scheme) and system-id. Clients can be set to auto-channel and auto-system-id to follow any/the first visible server.<br />
<br />
====Documentation====<br />
[http://www.lairdtech.com/WorkArea/DownloadAsset.aspx?id=2147488576 RM024 User Manual]<br/><br />
[http://www.lairdtech.com/WorkArea/linkit.aspx?LinkIdentifier=id&ItemID=4379 LT2510 User Manual]<br/><br />
[http://www.lairdtech.com/zips/Developer_Kit.zip Windows configuration tool]<br />
<br />
'''Setup'''<br />
<br />
Look at the [[Laird_RM024_setup page]]<br />
<br />
== Bluetooth ==<br />
These modems do not give you a great range but Bluetooth can be found in a lot of recent laptops built-in. Maybe not useful for fixed wing aircrafts it might be used for in-the-shop testing or quadcopters. Make sure you get a recent Class 1 EDR 2.0 stick if you buy one for your computer.<br />
{|<br />
|<br />
=== RN-41 Bluetooth module(Sparkfun's WRL-08497) ===<br />
* Frequency Band 2.4GHz<br />
* Output Power 32 mW <br />
* RF Data Rate up to ~300 kbps in SPP<br />
* Interface Data Rate up to 921 kbps <br />
* Power Draw (typical) 50 mA TX / 40 mA RX <br />
* Supply Voltage 3.3v<br />
* Range (typical, depends on antenna & environment) 100 meters line-of-sight <br />
* Dimensions 26 x 13 x 2mm <br />
* Weight ~1.5 grams<br />
* Interface solder connector <br />
* price : 20€<br />
|<br />
[[Image:roving_nw_wiring.jpg|thumb|Roving Networks modem wiring]]<br />
|-<br />
|<br />
<br />
To connect to it, get the MAC address of the bluetooth modem<br />
<br />
me@mybox:~$ hcitool scan<br />
Scanning ...<br />
00:06:66:00:53:AD FireFly-53AD<br />
<br />
either make a virtual connection to a Bluetooth serial port each time you connect<br />
<br />
sudo rfcomm bind 0 00:06:66:00:53:AD<br />
<br />
or configure it once in /etc/bluetooth/rfcomm.conf<br />
<br />
rfcomm0 {<br />
bind yes;<br />
device 00:06:66:00:53:AD;<br />
}<br />
<br />
now you can use Bluetooth as '''/dev/rfcomm0''' with the Paparazzi 'link'. You might need to restart 'link' in case you get out of range and it disconnects (tbd). Set the Tiny serial speed to 115200 as the modules come preconfigured to that.<br />
|}<br />
<br />
== ESP8266 WiFi Module ==<br />
<br />
[[File:ESP8266.jpg|thumbnail|left|ESP8266 WiFi module]]<br />
Connect directly to the autopilot from your computers built-in WiFi connection. No additional devices are required. This chip was sucesfully tested in the lab, but no test flights have been performed yet.<br />
<br />
The chip was flashed with [https://github.com/beckdac/ESP8266-transparent-bridge transparent bridge firwmware] using [https://github.com/themadinventor/esptool esptool]. When connected trough WiFi, you can use telnet to set the baud rate.<br />
<br />
telnet 192.168.4.1<br />
+++AT BAUD 57000<br />
<br />
To use with paparazzi GCS, the TCP signals need to be tunneled to a virtual serial device. This was accomplished with socat<br />
<br />
socat -d -d PTY,link=/dev/mywifi TCP:192.168.4.1:23<br />
<br />
<br />
<br style="clear:both"><br />
<br />
== Telemetry via Video Transmitter==<br />
<br />
[[Image:video_tx_small.jpg|thumb|2.4GHz Video Transmitter]]<br />
In order for the UAV to transmit video from an onboard camera, an analog video transmitter can be used. These vary in power, and thus range, and run normally on 2.4Ghz. Small UAVs can get about 600m of range from the 50mW version, and extended range can be achieved using units up to 1W. Weight for these units varies from a couple grams to about 30 for the 1W with shielding. Please check for your countries regulations on 2.4Ghz transmission, as each is different. <br />
<br />
It is possible to use the audio channel to send simple telemetry data to the groundstation. Uploading telemetry not possible via analog audio transmitter only.<br />
<br style="clear:both"><br />
<br />
<br />
== Antennas ==<br />
<br />
Here are some examples of lightweight and efficient 868MHz antennas developped by the RF laboratory at ENAC.<br />
[[Image:868mhz_twinstar_antenna_1.jpg|thumb|left|868MHz copper foil antenna attached to the aircraft tail]] <br />
[[Image:868mhz_twinstar_antenna_2.jpg|thumb|left|868MHz copper foil antenna bottom view]] <br />
[[Image:868mhz_ground_antenna.jpg|thumb|left|868MHz ground antenna]] <br />
<br style="clear:both"><br />
<br />
This wiki page might give some ideas about antennas: http://en.wikipedia.org/wiki/Dipole_antenna<br />
<br />
[[Category:Hardware]]</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=User:NeoFromMatrix&diff=20300User:NeoFromMatrix2015-08-28T20:44:31Z<p>NeoFromMatrix: /* Eclipse ChibiOS/RT J-Link */</p>
<hr />
<div>__TOC__<br />
<br />
== Eclipse ChibiOS/RT J-Link ==<br />
<br />
<br />
Dependencies:<br />
* [[Installation/Linux#ARM_embedded_toolchain|ARM_embedded_toolchain]]<br />
* Java Runtime Enviroment (for Eclipse itself)<br />
* [https://www.segger.com/jlink-software.html SEGGERS Software and documentation pack] (add it to your $PATH)<br />
<br />
How to set up:<br />
# Download Eclipse CDT (bit version must match Java RE version)<br />
# Install Eclipse Plugins <br />
#* "C/C++ GDB Hardware Debugging" Plugin (required for e.g. Blackmagic Probe)<br />
#* "GNU ARM J-Link Debugging Support" Plugin (makes J-Link config very easy)<br />
#** Add "http://gnuarmeclipse.sourceforge.net/updates" as repository in Eclipse<br />
#Optional Plugins<br />
#* "EmbSysRegView" from the Eclipse Marketplace<br />
#* "ChibiOS/RT Eclipse Tools" Plugin (add "http://www.chibios.org/eclipse/chibistudio/" as repository)<br />
# SEGGER J-Link setup<br />
#* Run -> Debug Configurations... -> "New launch configuration" in the "GDB SEGGER J-Link Debugging" section<br />
#* Main tab<br />
#* Enter new name for the debug configuration<br />
#* Set the Project<br />
#* Set the C/C++ Application (*.elf file of the project)<br />
## Debugger tab<br />
#* Set Device name (e.g. "STM32F103RE")<br />
# Embedded Systems Register View setup<br />
#* Window -> Preferences -> C/C++ -> Debug -> EmbSys Register View<br />
#* Architecture (e.g. cortex-m3)<br />
#* Vendor (e.g. STMico)<br />
#* Chip (e.g. STM32F10X_HD)<br />
# Coding style help [http://docs.paparazziuav.org/latest/styleguide.html Paparazzi Code Style]<br />
## Window -> Preferences -> General -> Editors -> Text editors<br />
##* Set "Displayed Tab width" to 2<br />
##* Enable "Show whitespace characters"<br />
## Window -> Preferences -> C/C++ -> Code Style -> Formatter<br />
##* Create a new profile (K&R as template)<br />
##* Set Tab policy to Spaces only<br />
##* Set Indentation and Tab size to 2<br />
<br />
<br />
Notes:<br />
* Window -> Preferences -> -C/C++ -> Code Analysis, Unchecked "Field cannot be resolved" "Symbol is not resolved" since they produced useless errors<br />
** These are also disabled in ChibiStudio.<br />
* Make sure to use the matching debug config or the elf from another project will be loaded....<br />
<br />
== Airframes ==<br />
<br />
=== Cheap Bird ===<br />
<br />
Hardware<br />
* Frame:Cheap Bird V1<br />
* Motors: Hobbyking Donkey ST2204 1550 kV<br />
* Props:<br />
* ESC: <br />
<br />
Electronics<br />
* Autopilot: STM32F4 Discovery Daughterboard THT V1.0<br />
* GPS: Hobbyking Ulox Neo-6M<br />
* IMU: Drotek 10dof<br />
* Modem: Laird RM024<br />
<br />
Config:<br />
* Airframe:<br />
* Flight Plan:<br />
* Settings:<br />
* Radio:<br />
* Telemetry:</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=Installation/FromScratch&diff=20297Installation/FromScratch2015-08-28T10:44:05Z<p>NeoFromMatrix: /* Arch Linux */ format, information edited</p>
<hr />
<div><categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Installation</categorytree><br />
__TOC__<br />
<br />
'''Users of recent Debian/Ubuntu distributions are advised to use the binary packages as described in [[Installation/Linux]].'''<br />
<br />
<span style="color:#FF0000">'''WARNING! Only use if you are proficient in working with Linux!'''</span><br />
<br />
== Intro ==<br />
<br />
Users of other Linux flavors or anyone needing manual control of each individual package can install them independently. <br/><br />
The list of dependencies of the Debian package is located in the [https://github.com/paparazzi/paparazzi-portability-support/blob/master/debian/paparazzi-dev/debian/control <tt>debian/control</tt>] file and may help users of other distributions.<br />
<br />
Some corresponding source tarballs can be downloaded from [https://launchpad.net/~paparazzi-uav/+archive/ppa/+packages paparazzi-uav ppa] on launchpad. (maybe building the packages from source is more reliable in view of dependencies)<br />
<br />
For distributions using RPM packaging, the [http://packages.debian.org/unstable/source/alien alien] tool can be used to convert a .deb package into a .rpm package.<br />
<br />
As with all Wiki pages, also this page is a work in progress. Try to be a big help to the Paparazzi project and improve this page whenever you can. If you have a distribution different from Ubuntu which doesn't satisfy any other dependency and have instructions about compiling it, packaging it, feel free to add any reference on how to do that on this wikipage.<br />
<br />
== Goal ==<br />
<br />
The goal of this page is to clarify about which version of each piece of software has to be compiled, where to find that software, patches needed to make it compile on Linux, maybe even FreeBSD or OSX.<br />
<br />
== Fedora 19 ==<br />
<br />
To build paparazzi-uav on Fedora 19, you must install the next packages from the official repository:<br />
* ocaml<br />
* ocaml-findlib<br />
* ocaml-xml-light<br />
* ocaml-ocamlnet<br />
* ocaml-lablgtk-devel<br />
* libxml2-devel<br />
* SDL-devel<br />
* libusb-devel<br />
<br />
Paparazzi-uav needs to include some ocaml headers when it compiles the simulator, then please be sure that they are included. If not, edit sw/simulator/Makefile and add:<br />
<br />
CAML_CFLAGS = -I/usr/lib64/ocaml<br />
<br />
The following packages must be built from source code (they are not included in the official repository): <br />
* ivy-c <br />
* ivy-ocaml <br />
<br />
Paparazzi-uav was successfully compiled using ivy-c 3.14 (downloaded from SVN repository, revision #3602) and ivy-ocaml 1.2. Please note that the ivy-c version is an unstable version!<br />
<br />
Additionally, you need install the next RPMs to build ivy-c:<br />
* pcre-devel<br />
* libXt-devel<br />
* tcl-devel<br />
* glib2-devel<br />
<br />
Don't forget to set the environment variable PKG_CONFIG before building ivy-ocaml, e.g:<br />
<br />
$ export PKG_CONFIG=/usr/local/lib/pkgconfig<br />
<br />
== Arch Linux ==<br />
<br />
This is a dirty hacked together (not really according to "the Arch Way") install, but works on a fresh installed Archbang GNU/Linux.<br />
<br />
'''NOTE: following issues '''<br />
# Only written and tested for Archbang and Manjaro, not tested on vanilla Arch Linux yet. <br />
# It seems that the error "unbound module GnoCanvas" can be resolved by installing lablgtk2 via yaourt first and then conf-gnomecanvas over opam.<br />
# No symlink from liblglibivy.so.3 and liblglibivy.so.3 to libglibivy.so.3.15, so can't find these files.<br />
# If pkg-config can't find some .pc files, a pkg-config path might not be set and exported properly. Use "pkg-config --variable pc_path pkg-config" to check if the path containing the ''ivy-c.pc'', ''ivy-glib.pc'' and ''ivy-tcl.pc'' files is found.<br />
# "ocamlfind: Package `netclient' not found" -> seems that the opam packages need to be installed in a specific order... (try ocamlnet first, then lablgtk.2.16) <br />
<br />
'''Requirements:'''<br />
# Up to date system<br />
#* pacman -Syyu<br />
# Install Yaourt<br />
#*https://astrofloyd.wordpress.com/2015/01/17/installing-yaourt-on-arch-linux/<br />
<br />
'''Install Paparazzi:'''<br />
# Packages base-devel, yajl and general dependencies<br />
#: <pre># pacman -S base-devel yajl subversion git libusb pcre ocaml camlp4 tcl tk python python-pip sdl glade</pre><br />
# Check if the PKG_CONFIG_PATH points to ''/usr/local/lib/pkgconfig'', otherwise set and export it<br />
#: <pre>$ echo 'export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/' >> ~/.bashrc</pre><br />
# Build and install Ivy-C from Source<br />
#: <pre>$ svn checkout https://svn.tls.cena.fr/svn/ivy/ivy-c/trunk /home/$USER/temp/ivy-c &#10;$ cd /home/$USER/temp/ivy-c/src &#10;$ make &#10;$ sudo make install</pre><br />
# '''Dirty''' All the ivy libs are installed in ''/usr/local/lib64'' and not ''/usr/local/lib'' as the .pc files point to currently. <br/><br />
#:Change in the third line (libdir) in the ivy-c.pc, ivy-glib.pc and ivy-tcl.pc file from ''lib'' to ''lib64'' and the fourth line (includedir) from ''include'' to ''include/Ivy''<br />
# '''Dirty'''For libgivy, libivy and libtclivy (.so and .so.3 ending) is a link directing to the lib with .so.3.15 availaible, but not for libglibivy. <br/><br />
#Create these links for libglibivy<br />
#: <pre>$ sudo ln -s /usr/local/lib64/libglibivy.so.3.15 /usr/local/lib64/libglibivy.so &#10;$ sudo ln -s /usr/local/lib64/libglibivy.so.3.15 /usr/local/lib64/libglibivy.so.3</pre><br />
# Install opam (OCaml packet manager) via yaourt<br />
#: <pre>$ yaourt -S opam</pre><br />
# Initialize opam<br />
#: <pre>$ opam init &#10;$ f &#10;$ ~/.bashrc &#10;$ echo 'eval `opam config env`' >> ~/.bashrc</pre><br />
# Install and pin lablgtk.2.16.0 (2.18.0 will not work)<br />
#: <pre>$ opam install -v lablgtk.2.16.0 &#10;$ opam pin add lablgtk 2.16.0</pre><br />
# Install OCaml packets via opam<br />
#: <pre>$ opam install ocamlfind ocamlnet xml-light pcre ivy</pre><br />
#: If this fails at Ivy related parts check the notes on top of this guide.<br />
# Install ivy-python via pip<br />
#: <pre>$ sudo pip install ivy-python</pre><br />
# Install the Toolchain for Paparazzi (e.g. [https://aur.archlinux.org/packages/gcc-arm-none-eabi-bin/ gcc-arm-none-eabi-bin] from the AUR)<br />
#: <pre>$ sudo pacman -S gcc-arm-none-eabi-bin</pre><br />
<br />
Optional:<br />
<br />
# Install flashing utilities if needed<br />
$ yaourt stlink-git dfu-util<br />
<br />
[[Installation#Getting_the_Source_Code|Download]] and [[Installation#Launching_the_Software|build Paparazzi]]<br />
<br />
== Installing the Cross compiler toolchain ==<br />
<br />
There are currently two different toolchains available that can be used on Linux based systems with Paparazzi. For more information see [[Installation/Linux#ARM_embedded_toolchain]]<br />
<br />
== Installing OCaml packages using OPAM ==<br />
<br />
One possibility to install and manage OCaml packages is [http://opam.ocamlpro.com/ OPAM (OCaml Package Manager)]:<br/><br />
'''Please first check the official [http://opam.ocaml.org/doc/Install.html OPAM install guide] for the simplest method.'''<br/><br />
To install it from the latest git tree run:<br />
<nowiki>git clone https://github.com/OCamlPro/opam.git</nowiki><br />
cd opam<br />
./configure && make<br />
sudo make install<br />
<br />
opam init<br />
eval `opam config env`<br />
<br />
Update your shell environment as per opam init's instructions. E.g. add to your ''~/.profile'':<br />
eval `opam config env`<br />
<br />
Build and install OCaml libs:<br />
opam install ocamlfind xml-light pcre ocamlnet<br />
opam install -v lablgtk<br />
<br />
== IVY ==<br />
<br />
IVY is a simple protocol and a set of open-source libraries and programs that allows applications to broadcast information through text messages, with a subscription mechanism based on regular expressions. The project can be found at: http://www.eei.cena.fr/products/ivy/ <br />
<br />
In the paparazzi project, Ivy is used to send telemetry data to where ever you want.<br />
<br />
NOTE: Do not confuse this IVY with the Apache Ivy project. <br />
<br />
=== Ivy-python ===<br />
<br />
The ivy-python package makes it possible to use the IVY libraries from within the Python programming language. The ivy-python package is architecture independent, so it can be downloaded from the Ubuntu or Debian paparazzi repository.<br />
<br />
The easiest way to instally it on non Debian based systems is using [https://pip.pypa.io/ pip] to install the [https://pypi.python.org/pypi/ivy-python ivy-python package] from [https://pypi.python.org/pypi PyPi - the Python Package Index].<br />
pip install ivy-python<br />
<br />
Or install from the source repository via <br />
<br />
git clone https://gitlab.com/ivybus/ivy-python.git<br />
cd ivy-python<br />
./setup.py install<br />
<br />
=== Ivy-c ===<br />
<br />
To be able to use ivy-c, the libraries need to be installed. <br />
<br />
Required packages (Debian based):<br />
* tk-dev<br />
* libpcre3-dev<br />
* libxt-dev<br />
* pkg-config<br />
* libglib2.0-dev<br />
<br />
Download source, compile and install libraries:<br />
<br />
# mkdir -p /opt/ivy-c <br />
# cd /opt/ivy-c<br />
# svn co https://svn.tls.cena.fr/svn/ivy/ivy-c/trunk<br />
# cd /opt/ivy-c/trunk/src<br />
# make<br />
# make install<br />
<br />
It is possible you get errors of the test module when compiling, just ignore the messages, it is not important for the Paparazzi project. Contact the IVY team to help them also to resolve also the testing makefile issue.<br />
<br />
==== troubleshooting ====<br />
<br />
Error message:<br />
gcc -c -O2 -Wall -Wshadow -fPIC -I/usr/include/tcl8.4 -DTCL_CHANNEL_INTEGRATION ivytcl.c<br />
ivytcl.c:28:17: fatal error: tcl.h: No such file or directory<br />
<br />
The Makefile cannot read the tcl-dev version you have installed and assumes that version 8.4 is installed, but can't find the appropriate folder.<br/><br />
Edit the line 57 of the Makefile from TCLVERS=8.4 according to your installed version, or just delete the 8.4, both work.<br />
<br />
<br />
Can't find 64bit libs:<br />
Your ivy libs were probably installed to /usr/local/lib64 and you have to make symbolic links so that they will be found:<br />
$ sudo ln -s /usr/local/lib64/libivy.so /usr/local/lib64/libivy.so.3 /usr/lib<br />
or <br />
sudo ln -s /usr/local/lib64/libivy.so /usr/local/lib64/libivy.so.3 /usr/local/lib<br />
<br />
<br />
If you get an error relating to ivytestready.c, make the following changes:<br />
mkdir /opt/ivy-c/trunk/tools/Ivy<br />
cd /opt/ivy-c/trunk/tools/Ivy<br />
cp ../../src/ivy.h .<br />
cp ../../src/ivyloop.h .<br />
cp ../../src/ivysocket.h .<br />
cp ../../src/timer.h .<br />
cd ~/develop/ivy-c/trunk/src<br />
make<br />
<br />
This copies files from the src directory to the Ivy folder in tools which did not appear after running svn above.<br />
<br />
=== Ivy-OCaml ===<br />
<br />
ivy-ocaml provides OCaml bindings for ivy-c and is needed for most of the ground segment agents that are written in OCaml like [[Server]] and [[GCS]].<br />
<br />
Download source, compile and install libraries:<br />
<br />
# mkdir -p /opt/ivy-ocaml<br />
# cd /opt/ivy-ocaml<br />
# svn co https://svn.tls.cena.fr/svn/ivy/ivy-ocaml/trunk<br />
# cd /opt/ivy-ocaml/trunk<br />
# make<br />
# make install<br />
<br />
==== ivy-ocaml via OPAM ====<br />
Or use OPAM: While the source repository and debian package is named ''ivy-ocaml'', in OPAM it is only named ''ivy'' (since it is obviously for OCaml).<br />
<br />
$ opam update<br />
$ opam install ivy<br />
<br />
== LPC21ISP ==<br />
<br />
lpc21isp is only needed to serially flash the LPC2148 based autopilots (e.g. [[Lpc21BootloaderUpload bootloader]] for tiny, twog, umarim). LPC21ISP is an in-circuit programming (ISP) tool for the microcontroller used on the Paparazzi autopilot boards. The lpc21isp project is hosted on sourceforge and one can find the source packages and information at http://sourceforge.net/projects/lpc21isp/ <br />
<br />
Get the SVN version via<br />
<br />
$ mkdir -p /opt/lpc21isp<br />
$ cd /opt/lpc21isp<br />
$ svn co https://lpc21isp.svn.sourceforge.net/svnroot/lpc21isp lpc21<br />
<br />
To compile go into the source directory and then do<br />
<br />
$ cd lpc21<br />
$ make -f Makefile clean all<br />
<br />
To install<br />
<br />
$ exportline="PATH=$PATH:/opt/lpc21isp"<br />
$ if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi<br />
$ source ~/.profile<br />
<br />
== Paparazzi-dev Debian/Ubuntu packages ==<br />
<br />
For Ubuntu users, you can install the following packages from standard repository. You can just copy the line(s) and paste into your terminal. But do not copy the $ sign, this symbol is just added on this page to show that it is to be pasted at a normal terminal prompt.<br />
<br />
=== Whole lot in one ===<br />
<br />
sudo apt-get install ocaml libcamlimages-ocaml liblablgtk2-ocaml-dev liblablgtk2-gl-ocaml-dev \<br />
liblablgtk2-gnome-ocaml-dev libxml-light-ocaml-dev libocamlnet-ocaml-dev libpcre-ocaml \<br />
libpcre-ocaml-dev libgnomecanvas2-0 libgnomecanvas2-dev libglade2-0 libglade2-dev make build-essential \<br />
git gnuplot boa m4 libtool libftdi-dev libmpfr-dev tcl8.5-dev xutils-dev<br />
<br />
=== Ocaml and libraries ===<br />
<br />
Ocaml, short for Objective Caml is the most popular variant of the Caml language. The Paparazzi Ground Control Station (GCS) and some of it's tools are crafted in this language.<br />
<br />
* ocaml, ocaml-camlimages-devel, ocaml-lablgtk2-devel, ocaml-xml-light-devel, ocamlnet-ocaml-devel<br />
<br />
$ sudo apt-get install ocaml libcamlimages-ocaml liblablgtk2-ocaml-dev liblablgtk2-gl-ocaml-dev \<br />
liblablgtk2-gnome-ocaml-dev libxml-light-ocaml-dev libocamlnet-ocaml-dev<br />
<br />
=== Gnome canvas Library ===<br />
<br />
The GnomeCanvas is an engine for structured graphics that offers a rich imaging model, high performance rendering, and a powerful, high level API. This widget can be used for flexible display of graphics and for creating interactive user interface elements.<br />
<br />
$ sudo apt-get install libgnomecanvas2-0 libgnomecanvas2-dev<br />
<br />
=== USB Library ===<br />
<br />
The libusb project aims to create a library for use by user level applications to access USB devices regardless of OS. [http://www.libusb.org]<br />
<br />
$ sudo apt-get install libusb-dev<br />
<br />
=== Ocaml PCRE ===<br />
<br />
This OCaml-library interfaces the PCRE (Perl-compatibility regular expressions) C library. it can be used for matching regular expressions which are written in Perl style.<br />
<br />
$ sudo apt-get install libpcre-ocaml libpcre-ocaml-dev<br />
<br />
=== Glade Library ===<br />
<br />
Libglade is a library that performs a similar job to the C source output routines in the GLADE user interface builder. Whereas GLADE's output routines create C source code that must be compiled, libglade builds the interface from an XML file (GLADE's save format) at runtime. This can allow modifying the user interface without recompiling.<br />
<br />
$ sudo apt-get install libglade2-0 libglade2-dev<br />
<br />
=== Tcl/Tk ===<br />
<br />
$ sudo apt-get install tcl-dev<br />
<br />
Also the some utils are required to compile and install Ivy.<br />
<br />
$ sudo apt-get install xutils-dev<br />
<br />
=== Make ===<br />
<br />
GNU Make is an utility which controls the generation of executables and other target files of a program from the program's source files. <br />
<br />
$ sudo apt-get install make<br />
<br />
=== Build essential ===<br />
<br />
$ sudo apt-get install build-essential<br />
<br />
=== Libtool ===<br />
<br />
GNU libtool is a generic library support script. Libtool hides the complexity of using shared libraries behind a consistent, portable interface. Creating the files for Paparazzi software building becomes less cumbersome by using this tool.<br />
<br />
$ sudo apt-get install libtool<br />
<br />
=== libpcre3-dev ===<br />
<br />
Required for compiling Ivy-C.<br />
<br />
$ apt-get install libpcre3-dev<br />
<br />
=== Git Client ===<br />
<br />
Git is a version control system. Version control systems allow many individuals to collaborate on the Paparazzi source code. This is needed to retrieve the latest sourcecode from various packages and Paparazzi sourcecode itself.<br />
<br />
$ sudo apt-get install git<br />
<br />
=== Subversion ===<br />
<br />
Version control system, required for cloning the ivy packages.<br />
<br />
$ apt-get install subversion<br />
<br />
=== GNU Plot ===<br />
<br />
A command-line driven interactive plotting program. Unknow if it is used<br />
<br />
$ sudo apt-get install gnuplot<br />
<br />
=== Meld ===<br />
<br />
Meld is a graphical front end to the diff program. It provides a side-by-side view of the differences between two files. It is used by the Paparazzi Center when configuration changes are not yet saved and the option comes along where one either can keep or view changes made in aircraft- and other configuration files.<br />
<br />
$ sudo apt-get install meld<br />
<br />
=== FTDI library ===<br />
<br />
libftdi is a library that talks to FTDI's 232 type chips, including the popular bitbang mode, using libusb. A library to be able to use with a debugging Autopilot hardware boards.<br />
<br />
$ sudo apt-get install libftdi-dev <br />
<br />
=== MPFR library ===<br />
<br />
The MPFR library is a C library for multiple-precision floating-point computations with correct rounding. MPFR is based on the GMP multiple-precision library. The main goal of MPFR is to provide a library for multiple-precision floating-point computation which is both efficient and has a well-defined semantics.<br />
<br />
$ sudo apt-get install libmpfr-dev<br />
<br />
=== ImageMagick ===<br />
<br />
ImageMagick is a software suite to create, edit, and compose bitmap images. It can read, convert and write images in a variety of formats. Use ImageMagick to translate, flip, mirror, rotate, scale, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves. Being able to modify image based map pictures is a feature that may come in handy one time.<br />
<br />
$ sudo apt-get install imagemagick<br />
<br />
=== Optional on an older OS ===<br />
<br />
If you have an older OS distribution it never hurts to install the following...<br />
<br />
$ sudo apt-get install libx11-6 libx11-dev texinfo libncurses5 libncursesw5 libncursesw5-dev zlibc<br />
<br />
== Paparazzi Main sourcecode ==<br />
<br />
See the main [[Installation#Getting_the_Source_Code]] page<br />
<br />
TIP: <br />
If you get the File "pprz.mli", line 149, characters 78-89: Error: Unbound type constructor Ivy.binding<br />
...this happens when IVY libraries are not yet installed. How to do this, read the part on installing IVY on this page<br />
<br />
<br />
== Useful links ==<br />
<br />
https://launchpad.net/gcc-arm-embedded/<br />
<br />
https://github.com/paparazzi/paparazzi-portability-support<br />
<br />
http://wiki.ubuntuusers.de/GNU_arm-toolchain<br />
<br />
http://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/ARM-Options.html#ARM-Options<br />
<br />
http://mcuprogramming.com/forum/arm/gnu-arm-toolchain-installer/<br />
<br />
http://www.ethernut.de/en/documents/cross-toolchain-osx.html<br />
<br />
http://www.hermann-uwe.de/blog/building-an-arm-cross-toolchain-with-binutils-gcc-newlib-and-gdb-from-source<br />
<br />
[[Category:Software]] [[Category:Developer_Documentation]] [[Category:Installation]]</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=User:NeoFromMatrix&diff=20291User:NeoFromMatrix2015-08-27T19:35:33Z<p>NeoFromMatrix: created personal page, eclipse setup, cheap bird copter started</p>
<hr />
<div>__TOC__<br />
<br />
== Eclipse ChibiOS/RT J-Link ==<br />
<br />
<br />
Dependencies:<br />
* [[Installation/Linux#ARM_embedded_toolchain|ARM_embedded_toolchain]]<br />
* Java Runtime Enviroment (for Eclipse itself)<br />
* [https://www.segger.com/jlink-software.html SEGGERS Software and documentation pack] (add it to your $PATH)<br />
<br />
How to set up:<br />
# Download Eclipse CDT (bit version must match Java RE version)<br />
# Install Eclipse Plugins <br />
#* "C/C++ GDB Hardware Debugging" Plugin (required for e.g. Blackmagic Probe)<br />
#* "GNU ARM J-Link Debugging Support" Plugin (makes J-Link config very easy)<br />
#** Add "http://gnuarmeclipse.sourceforge.net/updates" as repository in Eclipse<br />
#Optional Plugins<br />
#* "EmbSysRegView" from the Eclipse Marketplace<br />
#* "ChibiOS/RT Eclipse Tools" Plugin (add "http://www.chibios.org/eclipse/chibistudio/" as repository)<br />
# SEGGER J-Link setup<br />
#* Run -> Debug Configurations... -> "New launch configuration" in the "GDB SEGGER J-Link Debugging" section<br />
#* Main tab<br />
#* Enter new name for the debug configuration<br />
#* Set the Project<br />
#* Set the C/C++ Application (*.elf file of the project)<br />
## Debugger tab<br />
#* Set Device name (e.g. "STM32F103RE")<br />
# Embedded Systems Register View setup<br />
#* Window -> Preferences -> C/C++ -> Debug -> EmbSys Register View<br />
#* Architecture (e.g. cortex-m3)<br />
#* Vendor (e.g. STMico)<br />
#* Chip (e.g. STM32F10X_HD)<br />
<br />
Notes:<br />
* Window -> Preferences -> -C/C++ -> Code Analysis, Unchecked "Field cannot be resolved" "Symbol is not resolved" since they produced useless errors<br />
** These are also disabled in ChibiStudio.<br />
* Make sure to use the matching debug config or the elf from another project will be loaded....<br />
<br />
<br />
== Airframes ==<br />
<br />
=== Cheap Bird ===<br />
<br />
Hardware<br />
* Frame:Cheap Bird V1<br />
* Motors: Hobbyking Donkey ST2204 1550 kV<br />
* Props:<br />
* ESC: <br />
<br />
Electronics<br />
* Autopilot: STM32F4 Discovery Daughterboard THT V1.0<br />
* GPS: Hobbyking Ulox Neo-6M<br />
* IMU: Drotek 10dof<br />
* Modem: Laird RM024<br />
<br />
Config:<br />
* Airframe:<br />
* Flight Plan:<br />
* Settings:<br />
* Radio:<br />
* Telemetry:</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=Installation/FromScratch&diff=20236Installation/FromScratch2015-08-17T18:56:36Z<p>NeoFromMatrix: /* Arch Linux */</p>
<hr />
<div><categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Installation</categorytree><br />
__TOC__<br />
<br />
'''Users of recent Debian/Ubuntu distributions are advised to use the binary packages as described in [[Installation/Linux]].'''<br />
<br />
<span style="color:#FF0000">'''WARNING! Only use if you are proficient in working with Linux!'''</span><br />
<br />
== Intro ==<br />
<br />
Users of other Linux flavors or anyone needing manual control of each individual package can install them independently. <br/><br />
The list of dependencies of the Debian package is located in the [https://github.com/paparazzi/paparazzi-portability-support/blob/master/debian/paparazzi-dev/debian/control <tt>debian/control</tt>] file and may help users of other distributions.<br />
<br />
Some corresponding source tarballs can be downloaded from [https://launchpad.net/~paparazzi-uav/+archive/ppa/+packages paparazzi-uav ppa] on launchpad. (maybe building the packages from source is more reliable in view of dependencies)<br />
<br />
For distributions using RPM packaging, the [http://packages.debian.org/unstable/source/alien alien] tool can be used to convert a .deb package into a .rpm package.<br />
<br />
As with all Wiki pages, also this page is a work in progress. Try to be a big help to the Paparazzi project and improve this page whenever you can. If you have a distribution different from Ubuntu which doesn't satisfy any other dependency and have instructions about compiling it, packaging it, feel free to add any reference on how to do that on this wikipage.<br />
<br />
== Goal ==<br />
<br />
The goal of this page is to clarify about which version of each piece of software has to be compiled, where to find that software, patches needed to make it compile on Linux, maybe even FreeBSD or OSX.<br />
<br />
== Fedora 19 ==<br />
<br />
To build paparazzi-uav on Fedora 19, you must install the next packages from the official repository:<br />
* ocaml<br />
* ocaml-findlib<br />
* ocaml-xml-light<br />
* ocaml-ocamlnet<br />
* ocaml-lablgtk-devel<br />
* libxml2-devel<br />
* SDL-devel<br />
* libusb-devel<br />
<br />
Paparazzi-uav needs to include some ocaml headers when it compiles the simulator, then please be sure that they are included. If not, edit sw/simulator/Makefile and add:<br />
<br />
CAML_CFLAGS = -I/usr/lib64/ocaml<br />
<br />
The following packages must be built from source code (they are not included in the official repository): <br />
* ivy-c <br />
* ivy-ocaml <br />
<br />
Paparazzi-uav was successfully compiled using ivy-c 3.14 (downloaded from SVN repository, revision #3602) and ivy-ocaml 1.2. Please note that the ivy-c version is an unstable version!<br />
<br />
Additionally, you need install the next RPMs to build ivy-c:<br />
* pcre-devel<br />
* libXt-devel<br />
* tcl-devel<br />
* glib2-devel<br />
<br />
Don't forget to set the environment variable PKG_CONFIG before building ivy-ocaml, e.g:<br />
<br />
$ export PKG_CONFIG=/usr/local/lib/pkgconfig<br />
<br />
== Arch Linux ==<br />
<br />
This is a dirty hacked together (not really according to "the Arch Way") install, but works on a fresh installed Archbang GNU/Linux.<br />
<br />
'''NOTE: following issues '''<br />
# Only written and tested for Archbang and Manjaro, not tested on vanilla Arch Linux yet. <br />
# It seems that the error "unbound module GnoCanvas" can be resolved with installing lablgtk2 via yaourt and then conf-gnomecanvas over opam.<br />
# No symlink from liblglibivy.so.3 and liblglibivy.so.3 to libglibivy.so.3.15, so can't find these files.<br />
# If pkg-config can't find some .pc files, the required path for these might not be set and exported properly. Use "pkg-config --variable pc_path pkg-config" to check if the path containing the ''ivy-c.pc'', ''ivy-glib.pc'' and ''ivy-tcl.pc'' files are found.<br />
# "ocamlfind: Package `netclient' not found" -> seems that the opam packages need to be installed in a specific order... (try ocamlnet first, then lablgtk.2.16) <br />
<br />
1. Update the system<br />
# pacman -Syyu<br />
<br />
2. Install base-devel, yajl and general dependencies<br />
# pacman -S base-devel yajl subversion git libusb pcre ocaml camlp4 tcl tk python python-pip sdl glade<br />
<br />
3. Check if the PKG_CONFIG_PATH points to ''/usr/local/lib/pkgconfig'', otherwise set and export it<br />
$ echo 'export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/' >> ~/.bashrc<br />
<br />
4. Install Yaourt<br />
<br />
https://astrofloyd.wordpress.com/2015/01/17/installing-yaourt-on-arch-linux/<br />
<br />
5. Build and install Ivy-C from Source<br />
$ svn checkout https://svn.tls.cena.fr/svn/ivy/ivy-c/trunk /home/$USER/temp/ivy-c<br />
$ cd /home/$USER/temp/ivy-c/src<br />
$ make<br />
$ sudo make install<br />
<br />
6. '''Dirty''' All the ivy libs are installed in ''/usr/local/lib64'' and not ''/usr/local/lib'' as the .pc files point to currently. <br/><br />
Change in the third line (libdir) in the ivy-c.pc, ivy-glib.pc and ivy-tcl.pc file from ''lib'' to ''lib64'' and the fourth line (includedir) from ''include'' to ''include/Ivy''<br />
<br />
7. '''Dirty'''For libgivy, libivy and libtclivy (.so and .so.3 ending) is a link directing to the lib with .so.3.15 availaible, but not for libglibivy. <br/><br />
Create these links for libglibivy<br />
# ln -s /usr/local/lib64/libglibivy.so.3.15 /usr/local/lib64/libglibivy.so<br />
# ln -s /usr/local/lib64/libglibivy.so.3.15 /usr/local/lib64/libglibivy.so.3<br />
<br />
8. Install opam (OCaml packet manager) via yaourt<br />
$ yaourt -S opam <br />
<br />
9. Initialize opam<br />
$ opam init <br />
$ f<br />
$ ~/.bashrc<br />
$ echo 'eval `opam config env`' >> ~/.bashrc<br />
<br />
10. Install and pin lablgtk.2.16.0 (2.18.0 will not work)<br />
$ opam install -v lablgtk.2.16.0<br />
$ opam pin add lablgtk 2.16.0<br />
<br />
11. Install OCaml packets via opam<br />
$ opam install ocamlfind ocamlnet xml-light pcre ivy<br />
<br />
If this fails at Ivy related parts check the notes on top of this guide.<br />
<br />
12. Install ivy-python via pip<br />
# pip install ivy-python<br />
<br />
13. Install the Toolchain for Paparazzi (e.g. [https://aur.archlinux.org/packages/gcc-arm-none-eabi-bin/ gcc-arm-none-eabi-bin] from the AUR)<br />
$pacman -S gcc-arm-none-eabi-bin<br />
<br />
Optional:<br />
<br />
1. Install flashing utilities if needed<br />
$ yaourt stlink-git dfu-util<br />
<br />
[[Installation#Getting_the_Source_Code|Download]] and [[Installation#Launching_the_Software|build Paparazzi]]<br />
<br />
== Installing the Cross compiler toolchain ==<br />
<br />
There are currently two different toolchains available that can be used on Linux based systems with Paparazzi. For more information see [[Installation/Linux#ARM_embedded_toolchain]]<br />
<br />
== Installing OCaml packages using OPAM ==<br />
<br />
One possibility to install and manage OCaml packages is [http://opam.ocamlpro.com/ OPAM (OCaml Package Manager)]:<br/><br />
'''Please first check the official [http://opam.ocaml.org/doc/Install.html OPAM install guide] for the simplest method.'''<br/><br />
To install it from the latest git tree run:<br />
<nowiki>git clone https://github.com/OCamlPro/opam.git</nowiki><br />
cd opam<br />
./configure && make<br />
sudo make install<br />
<br />
opam init<br />
eval `opam config env`<br />
<br />
Update your shell environment as per opam init's instructions. E.g. add to your ''~/.profile'':<br />
eval `opam config env`<br />
<br />
Build and install OCaml libs:<br />
opam install ocamlfind xml-light pcre ocamlnet<br />
opam install -v lablgtk<br />
<br />
== IVY ==<br />
<br />
IVY is a simple protocol and a set of open-source libraries and programs that allows applications to broadcast information through text messages, with a subscription mechanism based on regular expressions. The project can be found at: http://www.eei.cena.fr/products/ivy/ <br />
<br />
In the paparazzi project, Ivy is used to send telemetry data to where ever you want.<br />
<br />
NOTE: Do not confuse this IVY with the Apache Ivy project. <br />
<br />
=== Ivy-python ===<br />
<br />
The ivy-python package makes it possible to use the IVY libraries from within the Python programming language. The ivy-python package is architecture independent, so it can be downloaded from the Ubuntu or Debian paparazzi repository.<br />
<br />
The easiest way to instally it on non Debian based systems is using [https://pip.pypa.io/ pip] to install the [https://pypi.python.org/pypi/ivy-python ivy-python package] from [https://pypi.python.org/pypi PyPi - the Python Package Index].<br />
pip install ivy-python<br />
<br />
Or install from the source repository via <br />
<br />
git clone https://gitlab.com/ivybus/ivy-python.git<br />
cd ivy-python<br />
./setup.py install<br />
<br />
=== Ivy-c ===<br />
<br />
To be able to use ivy-c, the libraries need to be installed. <br />
<br />
Required packages (Debian based):<br />
* tk-dev<br />
* libpcre3-dev<br />
* libxt-dev<br />
* pkg-config<br />
* libglib2.0-dev<br />
<br />
Download source, compile and install libraries:<br />
<br />
# mkdir -p /opt/ivy-c <br />
# cd /opt/ivy-c<br />
# svn co https://svn.tls.cena.fr/svn/ivy/ivy-c/trunk<br />
# cd /opt/ivy-c/trunk/src<br />
# make<br />
# make install<br />
<br />
It is possible you get errors of the test module when compiling, just ignore the messages, it is not important for the Paparazzi project. Contact the IVY team to help them also to resolve also the testing makefile issue.<br />
<br />
==== troubleshooting ====<br />
<br />
Error message:<br />
gcc -c -O2 -Wall -Wshadow -fPIC -I/usr/include/tcl8.4 -DTCL_CHANNEL_INTEGRATION ivytcl.c<br />
ivytcl.c:28:17: fatal error: tcl.h: No such file or directory<br />
<br />
The Makefile cannot read the tcl-dev version you have installed and assumes that version 8.4 is installed, but can't find the appropriate folder.<br/><br />
Edit the line 57 of the Makefile from TCLVERS=8.4 according to your installed version, or just delete the 8.4, both work.<br />
<br />
<br />
Can't find 64bit libs:<br />
Your ivy libs were probably installed to /usr/local/lib64 and you have to make symbolic links so that they will be found:<br />
$ sudo ln -s /usr/local/lib64/libivy.so /usr/local/lib64/libivy.so.3 /usr/lib<br />
or <br />
sudo ln -s /usr/local/lib64/libivy.so /usr/local/lib64/libivy.so.3 /usr/local/lib<br />
<br />
<br />
If you get an error relating to ivytestready.c, make the following changes:<br />
mkdir /opt/ivy-c/trunk/tools/Ivy<br />
cd /opt/ivy-c/trunk/tools/Ivy<br />
cp ../../src/ivy.h .<br />
cp ../../src/ivyloop.h .<br />
cp ../../src/ivysocket.h .<br />
cp ../../src/timer.h .<br />
cd ~/develop/ivy-c/trunk/src<br />
make<br />
<br />
This copies files from the src directory to the Ivy folder in tools which did not appear after running svn above.<br />
<br />
=== Ivy-OCaml ===<br />
<br />
ivy-ocaml provides OCaml bindings for ivy-c and is needed for most of the ground segment agents that are written in OCaml like [[Server]] and [[GCS]].<br />
<br />
Download source, compile and install libraries:<br />
<br />
# mkdir -p /opt/ivy-ocaml<br />
# cd /opt/ivy-ocaml<br />
# svn co https://svn.tls.cena.fr/svn/ivy/ivy-ocaml/trunk<br />
# cd /opt/ivy-ocaml/trunk<br />
# make<br />
# make install<br />
<br />
==== ivy-ocaml via OPAM ====<br />
Or use OPAM: While the source repository and debian package is named ''ivy-ocaml'', in OPAM it is only named ''ivy'' (since it is obviously for OCaml).<br />
<br />
$ opam update<br />
$ opam install ivy<br />
<br />
== LPC21ISP ==<br />
<br />
lpc21isp is only needed to serially flash the LPC2148 based autopilots (e.g. [[Lpc21BootloaderUpload bootloader]] for tiny, twog, umarim). LPC21ISP is an in-circuit programming (ISP) tool for the microcontroller used on the Paparazzi autopilot boards. The lpc21isp project is hosted on sourceforge and one can find the source packages and information at http://sourceforge.net/projects/lpc21isp/ <br />
<br />
Get the SVN version via<br />
<br />
$ mkdir -p /opt/lpc21isp<br />
$ cd /opt/lpc21isp<br />
$ svn co https://lpc21isp.svn.sourceforge.net/svnroot/lpc21isp lpc21<br />
<br />
To compile go into the source directory and then do<br />
<br />
$ cd lpc21<br />
$ make -f Makefile clean all<br />
<br />
To install<br />
<br />
$ exportline="PATH=$PATH:/opt/lpc21isp"<br />
$ if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi<br />
$ source ~/.profile<br />
<br />
== Paparazzi-dev Debian/Ubuntu packages ==<br />
<br />
For Ubuntu users, you can install the following packages from standard repository. You can just copy the line(s) and paste into your terminal. But do not copy the $ sign, this symbol is just added on this page to show that it is to be pasted at a normal terminal prompt.<br />
<br />
=== Whole lot in one ===<br />
<br />
sudo apt-get install ocaml libcamlimages-ocaml liblablgtk2-ocaml-dev liblablgtk2-gl-ocaml-dev \<br />
liblablgtk2-gnome-ocaml-dev libxml-light-ocaml-dev libocamlnet-ocaml-dev libpcre-ocaml \<br />
libpcre-ocaml-dev libgnomecanvas2-0 libgnomecanvas2-dev libglade2-0 libglade2-dev make build-essential \<br />
git gnuplot boa m4 libtool libftdi-dev libmpfr-dev tcl8.5-dev xutils-dev<br />
<br />
=== Ocaml and libraries ===<br />
<br />
Ocaml, short for Objective Caml is the most popular variant of the Caml language. The Paparazzi Ground Control Station (GCS) and some of it's tools are crafted in this language.<br />
<br />
* ocaml, ocaml-camlimages-devel, ocaml-lablgtk2-devel, ocaml-xml-light-devel, ocamlnet-ocaml-devel<br />
<br />
$ sudo apt-get install ocaml libcamlimages-ocaml liblablgtk2-ocaml-dev liblablgtk2-gl-ocaml-dev \<br />
liblablgtk2-gnome-ocaml-dev libxml-light-ocaml-dev libocamlnet-ocaml-dev<br />
<br />
=== Gnome canvas Library ===<br />
<br />
The GnomeCanvas is an engine for structured graphics that offers a rich imaging model, high performance rendering, and a powerful, high level API. This widget can be used for flexible display of graphics and for creating interactive user interface elements.<br />
<br />
$ sudo apt-get install libgnomecanvas2-0 libgnomecanvas2-dev<br />
<br />
=== USB Library ===<br />
<br />
The libusb project aims to create a library for use by user level applications to access USB devices regardless of OS. [http://www.libusb.org]<br />
<br />
$ sudo apt-get install libusb-dev<br />
<br />
=== Ocaml PCRE ===<br />
<br />
This OCaml-library interfaces the PCRE (Perl-compatibility regular expressions) C library. it can be used for matching regular expressions which are written in Perl style.<br />
<br />
$ sudo apt-get install libpcre-ocaml libpcre-ocaml-dev<br />
<br />
=== Glade Library ===<br />
<br />
Libglade is a library that performs a similar job to the C source output routines in the GLADE user interface builder. Whereas GLADE's output routines create C source code that must be compiled, libglade builds the interface from an XML file (GLADE's save format) at runtime. This can allow modifying the user interface without recompiling.<br />
<br />
$ sudo apt-get install libglade2-0 libglade2-dev<br />
<br />
=== Tcl/Tk ===<br />
<br />
$ sudo apt-get install tcl-dev<br />
<br />
Also the some utils are required to compile and install Ivy.<br />
<br />
$ sudo apt-get install xutils-dev<br />
<br />
=== Make ===<br />
<br />
GNU Make is an utility which controls the generation of executables and other target files of a program from the program's source files. <br />
<br />
$ sudo apt-get install make<br />
<br />
=== Build essential ===<br />
<br />
$ sudo apt-get install build-essential<br />
<br />
=== Libtool ===<br />
<br />
GNU libtool is a generic library support script. Libtool hides the complexity of using shared libraries behind a consistent, portable interface. Creating the files for Paparazzi software building becomes less cumbersome by using this tool.<br />
<br />
$ sudo apt-get install libtool<br />
<br />
=== libpcre3-dev ===<br />
<br />
Required for compiling Ivy-C.<br />
<br />
$ apt-get install libpcre3-dev<br />
<br />
=== Git Client ===<br />
<br />
Git is a version control system. Version control systems allow many individuals to collaborate on the Paparazzi source code. This is needed to retrieve the latest sourcecode from various packages and Paparazzi sourcecode itself.<br />
<br />
$ sudo apt-get install git<br />
<br />
=== Subversion ===<br />
<br />
Version control system, required for cloning the ivy packages.<br />
<br />
$ apt-get install subversion<br />
<br />
=== GNU Plot ===<br />
<br />
A command-line driven interactive plotting program. Unknow if it is used<br />
<br />
$ sudo apt-get install gnuplot<br />
<br />
=== Meld ===<br />
<br />
Meld is a graphical front end to the diff program. It provides a side-by-side view of the differences between two files. It is used by the Paparazzi Center when configuration changes are not yet saved and the option comes along where one either can keep or view changes made in aircraft- and other configuration files.<br />
<br />
$ sudo apt-get install meld<br />
<br />
=== FTDI library ===<br />
<br />
libftdi is a library that talks to FTDI's 232 type chips, including the popular bitbang mode, using libusb. A library to be able to use with a debugging Autopilot hardware boards.<br />
<br />
$ sudo apt-get install libftdi-dev <br />
<br />
=== MPFR library ===<br />
<br />
The MPFR library is a C library for multiple-precision floating-point computations with correct rounding. MPFR is based on the GMP multiple-precision library. The main goal of MPFR is to provide a library for multiple-precision floating-point computation which is both efficient and has a well-defined semantics.<br />
<br />
$ sudo apt-get install libmpfr-dev<br />
<br />
=== ImageMagick ===<br />
<br />
ImageMagick is a software suite to create, edit, and compose bitmap images. It can read, convert and write images in a variety of formats. Use ImageMagick to translate, flip, mirror, rotate, scale, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves. Being able to modify image based map pictures is a feature that may come in handy one time.<br />
<br />
$ sudo apt-get install imagemagick<br />
<br />
=== Optional on an older OS ===<br />
<br />
If you have an older OS distribution it never hurts to install the following...<br />
<br />
$ sudo apt-get install libx11-6 libx11-dev texinfo libncurses5 libncursesw5 libncursesw5-dev zlibc<br />
<br />
== Paparazzi Main sourcecode ==<br />
<br />
See the main [[Installation#Getting_the_Source_Code]] page<br />
<br />
TIP: <br />
If you get the File "pprz.mli", line 149, characters 78-89: Error: Unbound type constructor Ivy.binding<br />
...this happens when IVY libraries are not yet installed. How to do this, read the part on installing IVY on this page<br />
<br />
<br />
== Useful links ==<br />
<br />
https://launchpad.net/gcc-arm-embedded/<br />
<br />
https://github.com/paparazzi/paparazzi-portability-support<br />
<br />
http://wiki.ubuntuusers.de/GNU_arm-toolchain<br />
<br />
http://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/ARM-Options.html#ARM-Options<br />
<br />
http://mcuprogramming.com/forum/arm/gnu-arm-toolchain-installer/<br />
<br />
http://www.ethernut.de/en/documents/cross-toolchain-osx.html<br />
<br />
http://www.hermann-uwe.de/blog/building-an-arm-cross-toolchain-with-binutils-gcc-newlib-and-gdb-from-source<br />
<br />
[[Category:Software]] [[Category:Developer_Documentation]] [[Category:Installation]]</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=Installation/FromScratch&diff=20230Installation/FromScratch2015-08-13T21:05:38Z<p>NeoFromMatrix: /* Arch Linux */</p>
<hr />
<div><categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Installation</categorytree><br />
__TOC__<br />
<br />
'''Users of recent Debian/Ubuntu distributions are advised to use the binary packages as described in [[Installation/Linux]].'''<br />
<br />
<span style="color:#FF0000">'''WARNING! Only use if you are proficient in working with Linux!'''</span><br />
<br />
== Intro ==<br />
<br />
Users of other Linux flavors or anyone needing manual control of each individual package can install them independently. <br/><br />
The list of dependencies of the Debian package is located in the [https://github.com/paparazzi/paparazzi-portability-support/blob/master/debian/paparazzi-dev/debian/control <tt>debian/control</tt>] file and may help users of other distributions.<br />
<br />
Some corresponding source tarballs can be downloaded from [https://launchpad.net/~paparazzi-uav/+archive/ppa/+packages paparazzi-uav ppa] on launchpad. (maybe building the packages from source is more reliable in view of dependencies)<br />
<br />
For distributions using RPM packaging, the [http://packages.debian.org/unstable/source/alien alien] tool can be used to convert a .deb package into a .rpm package.<br />
<br />
As with all Wiki pages, also this page is a work in progress. Try to be a big help to the Paparazzi project and improve this page whenever you can. If you have a distribution different from Ubuntu which doesn't satisfy any other dependency and have instructions about compiling it, packaging it, feel free to add any reference on how to do that on this wikipage.<br />
<br />
== Goal ==<br />
<br />
The goal of this page is to clarify about which version of each piece of software has to be compiled, where to find that software, patches needed to make it compile on Linux, maybe even FreeBSD or OSX.<br />
<br />
== Fedora 19 ==<br />
<br />
To build paparazzi-uav on Fedora 19, you must install the next packages from the official repository:<br />
* ocaml<br />
* ocaml-findlib<br />
* ocaml-xml-light<br />
* ocaml-ocamlnet<br />
* ocaml-lablgtk-devel<br />
* libxml2-devel<br />
* SDL-devel<br />
* libusb-devel<br />
<br />
Paparazzi-uav needs to include some ocaml headers when it compiles the simulator, then please be sure that they are included. If not, edit sw/simulator/Makefile and add:<br />
<br />
CAML_CFLAGS = -I/usr/lib64/ocaml<br />
<br />
The following packages must be built from source code (they are not included in the official repository): <br />
* ivy-c <br />
* ivy-ocaml <br />
<br />
Paparazzi-uav was successfully compiled using ivy-c 3.14 (downloaded from SVN repository, revision #3602) and ivy-ocaml 1.2. Please note that the ivy-c version is an unstable version!<br />
<br />
Additionally, you need install the next RPMs to build ivy-c:<br />
* pcre-devel<br />
* libXt-devel<br />
* tcl-devel<br />
* glib2-devel<br />
<br />
Don't forget to set the environment variable PKG_CONFIG before building ivy-ocaml, e.g:<br />
<br />
$ export PKG_CONFIG=/usr/local/lib/pkgconfig<br />
<br />
== Arch Linux ==<br />
<br />
This is probably a dirty hacked together (not realy according to "the Arch Way") install, but works on fresh installed Archbang.<br />
<br />
'''NOTE: following issues '''<br />
# This has been written for Archbang, although it should work on any Arch Linux based system, it has not been tested yet.<br />
# '''It seems that the error "unbound module GnoCanvas" can be resolved with installing lablgtk2 over yaourt and then conf-gnomecanvas over opam?''' <br />
# why is there no symlink from liblglibivy.so.3 and liblglibivy.so.3 to libglibivy.so.3.15?<br />
# If pkg-config can't find some .pc files, the required path for these might not be set and exported properly. Use "pkg-config --variable pc_path pkg-config" to check if the path containing the ivy-c.pc, ivy-glib.pc and ivy-tcl.pc files are found.<br />
# "ocamlfind: Package `netclient' not found" -> seems that the opam packages need to be installed in a specific order... (try ocamlnet first, then lablgtk.2.16) <br />
<br />
1. Update the fresh installation<br />
# pacman -Syyu<br />
<br />
2. Install [https://www.archlinux.org/groups/x86_64/base-devel/ base-devel] (pacman build tools, if you don't already have it) and yajl (for yaourt) <br />
# pacman -S base-devel yajl<br />
<br />
3. Add "export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/" to your shell config file (mostly ~/.bashrc)<br />
$ echo 'export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/' >> ~/.bashrc<br />
<br />
4. Install yaourt (this tool can build and install packages from the AUR for you) <br/><br />
https://astrofloyd.wordpress.com/2015/01/17/installing-yaourt-on-arch-linux/<br />
<br />
5. Install general dependencies<br />
# pacman -S subversion git libusb pcre ocaml camlp4 tcl tk python python-pip sdl glade<br />
(libtool is a component of base-devel, so this will be already installed)<br />
<br />
6. Build Ivy-C from Source<br />
$ svn checkout https://svn.tls.cena.fr/svn/ivy/ivy-c/trunk /home/$USER/temp/ivy-c<br />
$ cd /home/$USER/temp/ivy-c/src<br />
$ make<br />
# sudo make install<br />
<br />
7. '''Dirty''' All the ivy libs are installed in ''/usr/local/lib64'' and not ''/usr/local/lib'' as the .pc files point to currently. <br/><br />
Change in the third line (libdir) in the ivy-c.pc, ivy-glib.pc and ivy-tcl.pc file from ''lib'' to ''lib64'' and the fourth line (includedir) from ''include'' to ''include/Ivy''<br />
<br />
8. '''Dirty'''For libgivy, libivy and libtclivy (.so and .so.3 ending) is a link directing to the lib with .so.3.15 availaible, but not for libglibivy. <br/><br />
Create these links for libglibivy<br />
# ln -s /usr/local/lib64/libglibivy.so.3.15 /usr/local/lib64/libglibivy.so<br />
# ln -s /usr/local/lib64/libglibivy.so.3.15 /usr/local/lib64/libglibivy.so.3<br />
<br />
9. Install opam (OCaml packet manager) via yaourt<br />
$ yaourt -S opam <br />
<br />
10. Initialize opam<br />
$ opam init <br />
$ f<br />
$ ~/.bashrc<br />
$ echo 'eval `opam config env`' >> ~/.bashrc<br />
<br />
11. Install and pin lablgtk.2.16.0 (2.18.0 will not work)<br />
$ opam install -v lablgtk.2.16.0<br />
$ opam pin add lablgtk 2.16.0<br />
<br />
12. Install OCaml packets via opam<br />
$ opam install ocamlfind ocamlnet xml-light pcre ivy<br />
<br />
If this fails at Ivy check the notes on top of this guide.<br />
<br />
13. Install ivy-python via pip<br />
# pip install ivy-python<br />
<br />
14. Install the Toolchain for Paparazzi (e.g. [https://aur.archlinux.org/packages/gcc-arm-none-eabi-bin/ gcc-arm-none-eabi-bin] from the AUR)<br />
$pacman -S gcc-arm-none-eabi-bin<br />
15. Install flashing utilities if needed<br />
$ yaourt stlink-git dfu-util<br />
<br />
[[Installation#Getting_the_Source_Code|Download]] and [[Installation#Launching_the_Software|build Paparazzi]]<br />
<br />
== Installing the Cross compiler toolchain ==<br />
<br />
There are currently two different toolchains available that can be used on Linux based systems with Paparazzi. For more information see [[Installation/Linux#ARM_embedded_toolchain]]<br />
<br />
== Installing OCaml packages using OPAM ==<br />
<br />
One possibility to install and manage OCaml packages is [http://opam.ocamlpro.com/ OPAM (OCaml Package Manager)]:<br/><br />
'''Please first check the official [http://opam.ocaml.org/doc/Install.html OPAM install guide] for the simplest method.'''<br/><br />
To install it from the latest git tree run:<br />
<nowiki>git clone https://github.com/OCamlPro/opam.git</nowiki><br />
cd opam<br />
./configure && make<br />
sudo make install<br />
<br />
opam init<br />
eval `opam config env`<br />
<br />
Update your shell environment as per opam init's instructions. E.g. add to your ''~/.profile'':<br />
eval `opam config env`<br />
<br />
Build and install OCaml libs:<br />
opam install ocamlfind xml-light pcre ocamlnet<br />
opam install -v lablgtk<br />
<br />
== IVY ==<br />
<br />
IVY is a simple protocol and a set of open-source libraries and programs that allows applications to broadcast information through text messages, with a subscription mechanism based on regular expressions. The project can be found at: http://www.eei.cena.fr/products/ivy/ <br />
<br />
In the paparazzi project, Ivy is used to send telemetry data to where ever you want.<br />
<br />
NOTE: Do not confuse this IVY with the Apache Ivy project. <br />
<br />
=== Ivy-python ===<br />
<br />
The ivy-python package makes it possible to use the IVY libraries from within the Python programming language. The ivy-python package is architecture independent, so it can be downloaded from the Ubuntu or Debian paparazzi repository.<br />
<br />
The easiest way to instally it on non Debian based systems is using [https://pip.pypa.io/ pip] to install the [https://pypi.python.org/pypi/ivy-python ivy-python package] from [https://pypi.python.org/pypi PyPi - the Python Package Index].<br />
pip install ivy-python<br />
<br />
Or install from the source repository via <br />
<br />
git clone https://gitorious.org/ivybus/ivy-python.git<br />
cd ivy-python<br />
./setup.py install<br />
<br />
=== Ivy-c ===<br />
<br />
To be able to use ivy-c, the libraries need to be installed. <br />
<br />
Required packages (Debian based):<br />
* tk-dev<br />
* libpcre3-dev<br />
* libxt-dev<br />
* pkg-config<br />
* libglib2.0-dev<br />
<br />
Download source, compile and install libraries:<br />
<br />
# mkdir -p /opt/ivy-c <br />
# cd /opt/ivy-c<br />
# svn co https://svn.tls.cena.fr/svn/ivy/ivy-c/trunk<br />
# cd /opt/ivy-c/trunk/src<br />
# make<br />
# make install<br />
<br />
It is possible you get errors of the test module when compiling, just ignore the messages, it is not important for the Paparazzi project. Contact the IVY team to help them also to resolve also the testing makefile issue.<br />
<br />
==== troubleshooting ====<br />
<br />
Error message:<br />
gcc -c -O2 -Wall -Wshadow -fPIC -I/usr/include/tcl8.4 -DTCL_CHANNEL_INTEGRATION ivytcl.c<br />
ivytcl.c:28:17: fatal error: tcl.h: No such file or directory<br />
<br />
The Makefile cannot read the tcl-dev version you have installed and assumes that version 8.4 is installed, but can't find the appropriate folder.<br/><br />
Edit the line 57 of the Makefile from TCLVERS=8.4 according to your installed version, or just delete the 8.4, both work.<br />
<br />
<br />
Can't find 64bit libs:<br />
Your ivy libs were probably installed to /usr/local/lib64 and you have to make symbolic links so that they will be found:<br />
$ sudo ln -s /usr/local/lib64/libivy.so /usr/local/lib64/libivy.so.3 /usr/lib<br />
or <br />
sudo ln -s /usr/local/lib64/libivy.so /usr/local/lib64/libivy.so.3 /usr/local/lib<br />
<br />
<br />
If you get an error relating to ivytestready.c, make the following changes:<br />
mkdir /opt/ivy-c/trunk/tools/Ivy<br />
cd /opt/ivy-c/trunk/tools/Ivy<br />
cp ../../src/ivy.h .<br />
cp ../../src/ivyloop.h .<br />
cp ../../src/ivysocket.h .<br />
cp ../../src/timer.h .<br />
cd ~/develop/ivy-c/trunk/src<br />
make<br />
<br />
This copies files from the src directory to the Ivy folder in tools which did not appear after running svn above.<br />
<br />
=== Ivy-OCaml ===<br />
<br />
ivy-ocaml provides OCaml bindings for ivy-c and is needed for most of the ground segment agents that are written in OCaml like [[Server]] and [[GCS]].<br />
<br />
Download source, compile and install libraries:<br />
<br />
# mkdir -p /opt/ivy-ocaml<br />
# cd /opt/ivy-ocaml<br />
# svn co https://svn.tls.cena.fr/svn/ivy/ivy-ocaml/trunk<br />
# cd /opt/ivy-ocaml/trunk<br />
# make<br />
# make install<br />
<br />
==== ivy-ocaml via OPAM ====<br />
Or use OPAM: While the source repository and debian package is named ''ivy-ocaml'', in OPAM it is only named ''ivy'' (since it is obviously for OCaml).<br />
<br />
$ opam update<br />
$ opam install ivy<br />
<br />
== LPC21ISP ==<br />
<br />
lpc21isp is only needed to serially flash the LPC2148 based autopilots (e.g. [[Lpc21BootloaderUpload bootloader]] for tiny, twog, umarim). LPC21ISP is an in-circuit programming (ISP) tool for the microcontroller used on the Paparazzi autopilot boards. The lpc21isp project is hosted on sourceforge and one can find the source packages and information at http://sourceforge.net/projects/lpc21isp/ <br />
<br />
Get the SVN version via<br />
<br />
$ mkdir -p /opt/lpc21isp<br />
$ cd /opt/lpc21isp<br />
$ svn co https://lpc21isp.svn.sourceforge.net/svnroot/lpc21isp lpc21<br />
<br />
To compile go into the source directory and then do<br />
<br />
$ cd lpc21<br />
$ make -f Makefile clean all<br />
<br />
To install<br />
<br />
$ exportline="PATH=$PATH:/opt/lpc21isp"<br />
$ if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi<br />
$ source ~/.profile<br />
<br />
== Paparazzi-dev Debian/Ubuntu packages ==<br />
<br />
For Ubuntu users, you can install the following packages from standard repository. You can just copy the line(s) and paste into your terminal. But do not copy the $ sign, this symbol is just added on this page to show that it is to be pasted at a normal terminal prompt.<br />
<br />
=== Whole lot in one ===<br />
<br />
sudo apt-get install ocaml libcamlimages-ocaml liblablgtk2-ocaml-dev liblablgtk2-gl-ocaml-dev \<br />
liblablgtk2-gnome-ocaml-dev libxml-light-ocaml-dev libocamlnet-ocaml-dev libpcre-ocaml \<br />
libpcre-ocaml-dev libgnomecanvas2-0 libgnomecanvas2-dev libglade2-0 libglade2-dev make build-essential \<br />
git gnuplot boa m4 libtool libftdi-dev libmpfr-dev tcl8.5-dev xutils-dev<br />
<br />
=== Ocaml and libraries ===<br />
<br />
Ocaml, short for Objective Caml is the most popular variant of the Caml language. The Paparazzi Ground Control Station (GCS) and some of it's tools are crafted in this language.<br />
<br />
* ocaml, ocaml-camlimages-devel, ocaml-lablgtk2-devel, ocaml-xml-light-devel, ocamlnet-ocaml-devel<br />
<br />
$ sudo apt-get install ocaml libcamlimages-ocaml liblablgtk2-ocaml-dev liblablgtk2-gl-ocaml-dev \<br />
liblablgtk2-gnome-ocaml-dev libxml-light-ocaml-dev libocamlnet-ocaml-dev<br />
<br />
=== Gnome canvas Library ===<br />
<br />
The GnomeCanvas is an engine for structured graphics that offers a rich imaging model, high performance rendering, and a powerful, high level API. This widget can be used for flexible display of graphics and for creating interactive user interface elements.<br />
<br />
$ sudo apt-get install libgnomecanvas2-0 libgnomecanvas2-dev<br />
<br />
=== USB Library ===<br />
<br />
The libusb project aims to create a library for use by user level applications to access USB devices regardless of OS. [http://www.libusb.org]<br />
<br />
$ sudo apt-get install libusb-dev<br />
<br />
=== Ocaml PCRE ===<br />
<br />
This OCaml-library interfaces the PCRE (Perl-compatibility regular expressions) C library. it can be used for matching regular expressions which are written in Perl style.<br />
<br />
$ sudo apt-get install libpcre-ocaml libpcre-ocaml-dev<br />
<br />
=== Glade Library ===<br />
<br />
Libglade is a library that performs a similar job to the C source output routines in the GLADE user interface builder. Whereas GLADE's output routines create C source code that must be compiled, libglade builds the interface from an XML file (GLADE's save format) at runtime. This can allow modifying the user interface without recompiling.<br />
<br />
$ sudo apt-get install libglade2-0 libglade2-dev<br />
<br />
=== Tcl/Tk ===<br />
<br />
$ sudo apt-get install tcl-dev<br />
<br />
Also the some utils are required to compile and install Ivy.<br />
<br />
$ sudo apt-get install xutils-dev<br />
<br />
=== Make ===<br />
<br />
GNU Make is an utility which controls the generation of executables and other target files of a program from the program's source files. <br />
<br />
$ sudo apt-get install make<br />
<br />
=== Build essential ===<br />
<br />
$ sudo apt-get install build-essential<br />
<br />
=== Libtool ===<br />
<br />
GNU libtool is a generic library support script. Libtool hides the complexity of using shared libraries behind a consistent, portable interface. Creating the files for Paparazzi software building becomes less cumbersome by using this tool.<br />
<br />
$ sudo apt-get install libtool<br />
<br />
=== libpcre3-dev ===<br />
<br />
Required for compiling Ivy-C.<br />
<br />
$ apt-get install libpcre3-dev<br />
<br />
=== Git Client ===<br />
<br />
Git is a version control system. Version control systems allow many individuals to collaborate on the Paparazzi source code. This is needed to retrieve the latest sourcecode from various packages and Paparazzi sourcecode itself.<br />
<br />
$ sudo apt-get install git<br />
<br />
=== Subversion ===<br />
<br />
Version control system, required for cloning the ivy packages.<br />
<br />
$ apt-get install subversion<br />
<br />
=== GNU Plot ===<br />
<br />
A command-line driven interactive plotting program. Unknow if it is used<br />
<br />
$ sudo apt-get install gnuplot<br />
<br />
=== Meld ===<br />
<br />
Meld is a graphical front end to the diff program. It provides a side-by-side view of the differences between two files. It is used by the Paparazzi Center when configuration changes are not yet saved and the option comes along where one either can keep or view changes made in aircraft- and other configuration files.<br />
<br />
$ sudo apt-get install meld<br />
<br />
=== FTDI library ===<br />
<br />
libftdi is a library that talks to FTDI's 232 type chips, including the popular bitbang mode, using libusb. A library to be able to use with a debugging Autopilot hardware boards.<br />
<br />
$ sudo apt-get install libftdi-dev <br />
<br />
=== MPFR library ===<br />
<br />
The MPFR library is a C library for multiple-precision floating-point computations with correct rounding. MPFR is based on the GMP multiple-precision library. The main goal of MPFR is to provide a library for multiple-precision floating-point computation which is both efficient and has a well-defined semantics.<br />
<br />
$ sudo apt-get install libmpfr-dev<br />
<br />
=== ImageMagick ===<br />
<br />
ImageMagick is a software suite to create, edit, and compose bitmap images. It can read, convert and write images in a variety of formats. Use ImageMagick to translate, flip, mirror, rotate, scale, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves. Being able to modify image based map pictures is a feature that may come in handy one time.<br />
<br />
$ sudo apt-get install imagemagick<br />
<br />
=== Optional on an older OS ===<br />
<br />
If you have an older OS distribution it never hurts to install the following...<br />
<br />
$ sudo apt-get install libx11-6 libx11-dev texinfo libncurses5 libncursesw5 libncursesw5-dev zlibc<br />
<br />
== Paparazzi Main sourcecode ==<br />
<br />
See the main [[Installation#Getting_the_Source_Code]] page<br />
<br />
TIP: <br />
If you get the File "pprz.mli", line 149, characters 78-89: Error: Unbound type constructor Ivy.binding<br />
...this happens when IVY libraries are not yet installed. How to do this, read the part on installing IVY on this page<br />
<br />
<br />
== Useful links ==<br />
<br />
https://launchpad.net/gcc-arm-embedded/<br />
<br />
https://github.com/paparazzi/paparazzi-portability-support<br />
<br />
http://wiki.ubuntuusers.de/GNU_arm-toolchain<br />
<br />
http://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/ARM-Options.html#ARM-Options<br />
<br />
http://mcuprogramming.com/forum/arm/gnu-arm-toolchain-installer/<br />
<br />
http://www.ethernut.de/en/documents/cross-toolchain-osx.html<br />
<br />
http://www.hermann-uwe.de/blog/building-an-arm-cross-toolchain-with-binutils-gcc-newlib-and-gdb-from-source<br />
<br />
[[Category:Software]] [[Category:Developer_Documentation]] [[Category:Installation]]</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=Installation/FromScratch&diff=20229Installation/FromScratch2015-08-13T20:42:19Z<p>NeoFromMatrix: /* Arch Linux */</p>
<hr />
<div><categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Installation</categorytree><br />
__TOC__<br />
<br />
'''Users of recent Debian/Ubuntu distributions are advised to use the binary packages as described in [[Installation/Linux]].'''<br />
<br />
<span style="color:#FF0000">'''WARNING! Only use if you are proficient in working with Linux!'''</span><br />
<br />
== Intro ==<br />
<br />
Users of other Linux flavors or anyone needing manual control of each individual package can install them independently. <br/><br />
The list of dependencies of the Debian package is located in the [https://github.com/paparazzi/paparazzi-portability-support/blob/master/debian/paparazzi-dev/debian/control <tt>debian/control</tt>] file and may help users of other distributions.<br />
<br />
Some corresponding source tarballs can be downloaded from [https://launchpad.net/~paparazzi-uav/+archive/ppa/+packages paparazzi-uav ppa] on launchpad. (maybe building the packages from source is more reliable in view of dependencies)<br />
<br />
For distributions using RPM packaging, the [http://packages.debian.org/unstable/source/alien alien] tool can be used to convert a .deb package into a .rpm package.<br />
<br />
As with all Wiki pages, also this page is a work in progress. Try to be a big help to the Paparazzi project and improve this page whenever you can. If you have a distribution different from Ubuntu which doesn't satisfy any other dependency and have instructions about compiling it, packaging it, feel free to add any reference on how to do that on this wikipage.<br />
<br />
== Goal ==<br />
<br />
The goal of this page is to clarify about which version of each piece of software has to be compiled, where to find that software, patches needed to make it compile on Linux, maybe even FreeBSD or OSX.<br />
<br />
== Fedora 19 ==<br />
<br />
To build paparazzi-uav on Fedora 19, you must install the next packages from the official repository:<br />
* ocaml<br />
* ocaml-findlib<br />
* ocaml-xml-light<br />
* ocaml-ocamlnet<br />
* ocaml-lablgtk-devel<br />
* libxml2-devel<br />
* SDL-devel<br />
* libusb-devel<br />
<br />
Paparazzi-uav needs to include some ocaml headers when it compiles the simulator, then please be sure that they are included. If not, edit sw/simulator/Makefile and add:<br />
<br />
CAML_CFLAGS = -I/usr/lib64/ocaml<br />
<br />
The following packages must be built from source code (they are not included in the official repository): <br />
* ivy-c <br />
* ivy-ocaml <br />
<br />
Paparazzi-uav was successfully compiled using ivy-c 3.14 (downloaded from SVN repository, revision #3602) and ivy-ocaml 1.2. Please note that the ivy-c version is an unstable version!<br />
<br />
Additionally, you need install the next RPMs to build ivy-c:<br />
* pcre-devel<br />
* libXt-devel<br />
* tcl-devel<br />
* glib2-devel<br />
<br />
Don't forget to set the environment variable PKG_CONFIG before building ivy-ocaml, e.g:<br />
<br />
$ export PKG_CONFIG=/usr/local/lib/pkgconfig<br />
<br />
== Arch Linux ==<br />
<br />
This is probably a dirty hacked together (not realy according to "the Arch Way") install, but works on fresh installed Archbang.<br />
<br />
'''NOTE: following issues '''<br />
# This has been written for Archbang, although it should work on any Arch Linux based system, it has not been tested yet.<br />
# '''It seems that the error "unbound module GnoCanvas" can be resolved with installing lablgtk2 over yaourt and then conf-gnomecanvas over opam?''' <br />
# why is there no symlink from liblglibivy.so.3 and liblglibivy.so.3 to libglibivy.so.3.15?<br />
# If pkg-config can't find some .pc files, the required path for these might not be set and exported properly. Use "pkg-config --variable pc_path pkg-config" to check if the path containing the ivy-c.pc, ivy-glib.pc and ivy-tcl.pc files are found.<br />
# "ocamlfind: Package `netclient' not found" error, no solution yet written down<br />
<br />
1. Update the fresh installation<br />
# pacman -Syyu<br />
<br />
2. Install [https://www.archlinux.org/groups/x86_64/base-devel/ base-devel] (pacman build tools, if you don't already have it) and yajl (for yaourt) <br />
# pacman -S base-devel yajl<br />
<br />
3. Add "export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/" to your shell config file (mostly ~/.bashrc)<br />
$ echo 'export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/' >> ~/.bashrc<br />
<br />
4. Install yaourt (this tool can build and install packages from the AUR for you) <br/><br />
https://astrofloyd.wordpress.com/2015/01/17/installing-yaourt-on-arch-linux/<br />
<br />
5. Install general dependencies<br />
# pacman -S subversion git libusb pcre ocaml camlp4 tcl tk python python-pip sdl glade<br />
(libtool is a component of base-devel, so this will be already installed)<br />
<br />
6. Build Ivy-C from Source<br />
$ svn checkout https://svn.tls.cena.fr/svn/ivy/ivy-c/trunk /home/$USER/temp/ivy-c<br />
$ cd /home/$USER/temp/ivy-c/src<br />
$ make<br />
# sudo make install<br />
<br />
7. '''Dirty''' All the ivy libs are installed in ''/usr/local/lib64'' and not ''/usr/local/lib'' as the .pc files point to currently. <br/><br />
Change in the third line (libdir) in the ivy-c.pc, ivy-glib.pc and ivy-tcl.pc file from ''lib'' to ''lib64'' and the fourth line (includedir) from ''include'' to ''include/Ivy''<br />
<br />
8. '''Dirty'''For libgivy, libivy and libtclivy (.so and .so.3 ending) is a link directing to the lib with .so.3.15 availaible, but not for libglibivy. <br/><br />
Create these links for libglibivy<br />
# ln -s /usr/local/lib64/libglibivy.so.3.15 /usr/local/lib64/libglibivy.so<br />
# ln -s /usr/local/lib64/libglibivy.so.3.15 /usr/local/lib64/libglibivy.so.3<br />
<br />
9. Install opam (OCaml packet manager) via yaourt<br />
$ yaourt -S opam <br />
<br />
10. Initialize opam<br />
$ opam init <br />
$ f<br />
$ ~/.bashrc<br />
$ echo 'eval `opam config env`' >> ~/.bashrc<br />
<br />
11. Install and pin lablgtk.2.16.0 (2.18.0 will not work)<br />
$ opam install -v lablgtk.2.16.0<br />
$ opam pin add lablgtk 2.16.0<br />
<br />
12. Install OCaml packets via opam<br />
$ opam install ocamlfind ocamlnet xml-light pcre ivy<br />
<br />
If this fails at Ivy check the notes on top of this guide.<br />
<br />
13. Install ivy-python via pip<br />
# pip install ivy-python<br />
<br />
14. Install the Toolchain for Paparazzi (e.g. [https://aur.archlinux.org/packages/gcc-arm-none-eabi-bin/ gcc-arm-none-eabi-bin] from the AUR)<br />
$pacman -S gcc-arm-none-eabi-bin<br />
15. Install flashing utilities if needed<br />
$ yaourt stlink-git dfu-util<br />
<br />
[[Installation#Getting_the_Source_Code|Download]] and [[Installation#Launching_the_Software|build Paparazzi]]<br />
<br />
== Installing the Cross compiler toolchain ==<br />
<br />
There are currently two different toolchains available that can be used on Linux based systems with Paparazzi. For more information see [[Installation/Linux#ARM_embedded_toolchain]]<br />
<br />
== Installing OCaml packages using OPAM ==<br />
<br />
One possibility to install and manage OCaml packages is [http://opam.ocamlpro.com/ OPAM (OCaml Package Manager)]:<br/><br />
'''Please first check the official [http://opam.ocaml.org/doc/Install.html OPAM install guide] for the simplest method.'''<br/><br />
To install it from the latest git tree run:<br />
<nowiki>git clone https://github.com/OCamlPro/opam.git</nowiki><br />
cd opam<br />
./configure && make<br />
sudo make install<br />
<br />
opam init<br />
eval `opam config env`<br />
<br />
Update your shell environment as per opam init's instructions. E.g. add to your ''~/.profile'':<br />
eval `opam config env`<br />
<br />
Build and install OCaml libs:<br />
opam install ocamlfind xml-light pcre ocamlnet<br />
opam install -v lablgtk<br />
<br />
== IVY ==<br />
<br />
IVY is a simple protocol and a set of open-source libraries and programs that allows applications to broadcast information through text messages, with a subscription mechanism based on regular expressions. The project can be found at: http://www.eei.cena.fr/products/ivy/ <br />
<br />
In the paparazzi project, Ivy is used to send telemetry data to where ever you want.<br />
<br />
NOTE: Do not confuse this IVY with the Apache Ivy project. <br />
<br />
=== Ivy-python ===<br />
<br />
The ivy-python package makes it possible to use the IVY libraries from within the Python programming language. The ivy-python package is architecture independent, so it can be downloaded from the Ubuntu or Debian paparazzi repository.<br />
<br />
The easiest way to instally it on non Debian based systems is using [https://pip.pypa.io/ pip] to install the [https://pypi.python.org/pypi/ivy-python ivy-python package] from [https://pypi.python.org/pypi PyPi - the Python Package Index].<br />
pip install ivy-python<br />
<br />
Or install from the source repository via <br />
<br />
git clone https://gitorious.org/ivybus/ivy-python.git<br />
cd ivy-python<br />
./setup.py install<br />
<br />
=== Ivy-c ===<br />
<br />
To be able to use ivy-c, the libraries need to be installed. <br />
<br />
Required packages (Debian based):<br />
* tk-dev<br />
* libpcre3-dev<br />
* libxt-dev<br />
* pkg-config<br />
* libglib2.0-dev<br />
<br />
Download source, compile and install libraries:<br />
<br />
# mkdir -p /opt/ivy-c <br />
# cd /opt/ivy-c<br />
# svn co https://svn.tls.cena.fr/svn/ivy/ivy-c/trunk<br />
# cd /opt/ivy-c/trunk/src<br />
# make<br />
# make install<br />
<br />
It is possible you get errors of the test module when compiling, just ignore the messages, it is not important for the Paparazzi project. Contact the IVY team to help them also to resolve also the testing makefile issue.<br />
<br />
==== troubleshooting ====<br />
<br />
Error message:<br />
gcc -c -O2 -Wall -Wshadow -fPIC -I/usr/include/tcl8.4 -DTCL_CHANNEL_INTEGRATION ivytcl.c<br />
ivytcl.c:28:17: fatal error: tcl.h: No such file or directory<br />
<br />
The Makefile cannot read the tcl-dev version you have installed and assumes that version 8.4 is installed, but can't find the appropriate folder.<br/><br />
Edit the line 57 of the Makefile from TCLVERS=8.4 according to your installed version, or just delete the 8.4, both work.<br />
<br />
<br />
Can't find 64bit libs:<br />
Your ivy libs were probably installed to /usr/local/lib64 and you have to make symbolic links so that they will be found:<br />
$ sudo ln -s /usr/local/lib64/libivy.so /usr/local/lib64/libivy.so.3 /usr/lib<br />
or <br />
sudo ln -s /usr/local/lib64/libivy.so /usr/local/lib64/libivy.so.3 /usr/local/lib<br />
<br />
<br />
If you get an error relating to ivytestready.c, make the following changes:<br />
mkdir /opt/ivy-c/trunk/tools/Ivy<br />
cd /opt/ivy-c/trunk/tools/Ivy<br />
cp ../../src/ivy.h .<br />
cp ../../src/ivyloop.h .<br />
cp ../../src/ivysocket.h .<br />
cp ../../src/timer.h .<br />
cd ~/develop/ivy-c/trunk/src<br />
make<br />
<br />
This copies files from the src directory to the Ivy folder in tools which did not appear after running svn above.<br />
<br />
=== Ivy-OCaml ===<br />
<br />
ivy-ocaml provides OCaml bindings for ivy-c and is needed for most of the ground segment agents that are written in OCaml like [[Server]] and [[GCS]].<br />
<br />
Download source, compile and install libraries:<br />
<br />
# mkdir -p /opt/ivy-ocaml<br />
# cd /opt/ivy-ocaml<br />
# svn co https://svn.tls.cena.fr/svn/ivy/ivy-ocaml/trunk<br />
# cd /opt/ivy-ocaml/trunk<br />
# make<br />
# make install<br />
<br />
==== ivy-ocaml via OPAM ====<br />
Or use OPAM: While the source repository and debian package is named ''ivy-ocaml'', in OPAM it is only named ''ivy'' (since it is obviously for OCaml).<br />
<br />
$ opam update<br />
$ opam install ivy<br />
<br />
== LPC21ISP ==<br />
<br />
lpc21isp is only needed to serially flash the LPC2148 based autopilots (e.g. [[Lpc21BootloaderUpload bootloader]] for tiny, twog, umarim). LPC21ISP is an in-circuit programming (ISP) tool for the microcontroller used on the Paparazzi autopilot boards. The lpc21isp project is hosted on sourceforge and one can find the source packages and information at http://sourceforge.net/projects/lpc21isp/ <br />
<br />
Get the SVN version via<br />
<br />
$ mkdir -p /opt/lpc21isp<br />
$ cd /opt/lpc21isp<br />
$ svn co https://lpc21isp.svn.sourceforge.net/svnroot/lpc21isp lpc21<br />
<br />
To compile go into the source directory and then do<br />
<br />
$ cd lpc21<br />
$ make -f Makefile clean all<br />
<br />
To install<br />
<br />
$ exportline="PATH=$PATH:/opt/lpc21isp"<br />
$ if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi<br />
$ source ~/.profile<br />
<br />
== Paparazzi-dev Debian/Ubuntu packages ==<br />
<br />
For Ubuntu users, you can install the following packages from standard repository. You can just copy the line(s) and paste into your terminal. But do not copy the $ sign, this symbol is just added on this page to show that it is to be pasted at a normal terminal prompt.<br />
<br />
=== Whole lot in one ===<br />
<br />
sudo apt-get install ocaml libcamlimages-ocaml liblablgtk2-ocaml-dev liblablgtk2-gl-ocaml-dev \<br />
liblablgtk2-gnome-ocaml-dev libxml-light-ocaml-dev libocamlnet-ocaml-dev libpcre-ocaml \<br />
libpcre-ocaml-dev libgnomecanvas2-0 libgnomecanvas2-dev libglade2-0 libglade2-dev make build-essential \<br />
git gnuplot boa m4 libtool libftdi-dev libmpfr-dev tcl8.5-dev xutils-dev<br />
<br />
=== Ocaml and libraries ===<br />
<br />
Ocaml, short for Objective Caml is the most popular variant of the Caml language. The Paparazzi Ground Control Station (GCS) and some of it's tools are crafted in this language.<br />
<br />
* ocaml, ocaml-camlimages-devel, ocaml-lablgtk2-devel, ocaml-xml-light-devel, ocamlnet-ocaml-devel<br />
<br />
$ sudo apt-get install ocaml libcamlimages-ocaml liblablgtk2-ocaml-dev liblablgtk2-gl-ocaml-dev \<br />
liblablgtk2-gnome-ocaml-dev libxml-light-ocaml-dev libocamlnet-ocaml-dev<br />
<br />
=== Gnome canvas Library ===<br />
<br />
The GnomeCanvas is an engine for structured graphics that offers a rich imaging model, high performance rendering, and a powerful, high level API. This widget can be used for flexible display of graphics and for creating interactive user interface elements.<br />
<br />
$ sudo apt-get install libgnomecanvas2-0 libgnomecanvas2-dev<br />
<br />
=== USB Library ===<br />
<br />
The libusb project aims to create a library for use by user level applications to access USB devices regardless of OS. [http://www.libusb.org]<br />
<br />
$ sudo apt-get install libusb-dev<br />
<br />
=== Ocaml PCRE ===<br />
<br />
This OCaml-library interfaces the PCRE (Perl-compatibility regular expressions) C library. it can be used for matching regular expressions which are written in Perl style.<br />
<br />
$ sudo apt-get install libpcre-ocaml libpcre-ocaml-dev<br />
<br />
=== Glade Library ===<br />
<br />
Libglade is a library that performs a similar job to the C source output routines in the GLADE user interface builder. Whereas GLADE's output routines create C source code that must be compiled, libglade builds the interface from an XML file (GLADE's save format) at runtime. This can allow modifying the user interface without recompiling.<br />
<br />
$ sudo apt-get install libglade2-0 libglade2-dev<br />
<br />
=== Tcl/Tk ===<br />
<br />
$ sudo apt-get install tcl-dev<br />
<br />
Also the some utils are required to compile and install Ivy.<br />
<br />
$ sudo apt-get install xutils-dev<br />
<br />
=== Make ===<br />
<br />
GNU Make is an utility which controls the generation of executables and other target files of a program from the program's source files. <br />
<br />
$ sudo apt-get install make<br />
<br />
=== Build essential ===<br />
<br />
$ sudo apt-get install build-essential<br />
<br />
=== Libtool ===<br />
<br />
GNU libtool is a generic library support script. Libtool hides the complexity of using shared libraries behind a consistent, portable interface. Creating the files for Paparazzi software building becomes less cumbersome by using this tool.<br />
<br />
$ sudo apt-get install libtool<br />
<br />
=== libpcre3-dev ===<br />
<br />
Required for compiling Ivy-C.<br />
<br />
$ apt-get install libpcre3-dev<br />
<br />
=== Git Client ===<br />
<br />
Git is a version control system. Version control systems allow many individuals to collaborate on the Paparazzi source code. This is needed to retrieve the latest sourcecode from various packages and Paparazzi sourcecode itself.<br />
<br />
$ sudo apt-get install git<br />
<br />
=== Subversion ===<br />
<br />
Version control system, required for cloning the ivy packages.<br />
<br />
$ apt-get install subversion<br />
<br />
=== GNU Plot ===<br />
<br />
A command-line driven interactive plotting program. Unknow if it is used<br />
<br />
$ sudo apt-get install gnuplot<br />
<br />
=== Meld ===<br />
<br />
Meld is a graphical front end to the diff program. It provides a side-by-side view of the differences between two files. It is used by the Paparazzi Center when configuration changes are not yet saved and the option comes along where one either can keep or view changes made in aircraft- and other configuration files.<br />
<br />
$ sudo apt-get install meld<br />
<br />
=== FTDI library ===<br />
<br />
libftdi is a library that talks to FTDI's 232 type chips, including the popular bitbang mode, using libusb. A library to be able to use with a debugging Autopilot hardware boards.<br />
<br />
$ sudo apt-get install libftdi-dev <br />
<br />
=== MPFR library ===<br />
<br />
The MPFR library is a C library for multiple-precision floating-point computations with correct rounding. MPFR is based on the GMP multiple-precision library. The main goal of MPFR is to provide a library for multiple-precision floating-point computation which is both efficient and has a well-defined semantics.<br />
<br />
$ sudo apt-get install libmpfr-dev<br />
<br />
=== ImageMagick ===<br />
<br />
ImageMagick is a software suite to create, edit, and compose bitmap images. It can read, convert and write images in a variety of formats. Use ImageMagick to translate, flip, mirror, rotate, scale, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves. Being able to modify image based map pictures is a feature that may come in handy one time.<br />
<br />
$ sudo apt-get install imagemagick<br />
<br />
=== Optional on an older OS ===<br />
<br />
If you have an older OS distribution it never hurts to install the following...<br />
<br />
$ sudo apt-get install libx11-6 libx11-dev texinfo libncurses5 libncursesw5 libncursesw5-dev zlibc<br />
<br />
== Paparazzi Main sourcecode ==<br />
<br />
See the main [[Installation#Getting_the_Source_Code]] page<br />
<br />
TIP: <br />
If you get the File "pprz.mli", line 149, characters 78-89: Error: Unbound type constructor Ivy.binding<br />
...this happens when IVY libraries are not yet installed. How to do this, read the part on installing IVY on this page<br />
<br />
<br />
== Useful links ==<br />
<br />
https://launchpad.net/gcc-arm-embedded/<br />
<br />
https://github.com/paparazzi/paparazzi-portability-support<br />
<br />
http://wiki.ubuntuusers.de/GNU_arm-toolchain<br />
<br />
http://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/ARM-Options.html#ARM-Options<br />
<br />
http://mcuprogramming.com/forum/arm/gnu-arm-toolchain-installer/<br />
<br />
http://www.ethernut.de/en/documents/cross-toolchain-osx.html<br />
<br />
http://www.hermann-uwe.de/blog/building-an-arm-cross-toolchain-with-binutils-gcc-newlib-and-gdb-from-source<br />
<br />
[[Category:Software]] [[Category:Developer_Documentation]] [[Category:Installation]]</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=Installation/FromScratch&diff=20228Installation/FromScratch2015-08-13T20:35:42Z<p>NeoFromMatrix: /* Arch Linux */</p>
<hr />
<div><categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Installation</categorytree><br />
__TOC__<br />
<br />
'''Users of recent Debian/Ubuntu distributions are advised to use the binary packages as described in [[Installation/Linux]].'''<br />
<br />
<span style="color:#FF0000">'''WARNING! Only use if you are proficient in working with Linux!'''</span><br />
<br />
== Intro ==<br />
<br />
Users of other Linux flavors or anyone needing manual control of each individual package can install them independently. <br/><br />
The list of dependencies of the Debian package is located in the [https://github.com/paparazzi/paparazzi-portability-support/blob/master/debian/paparazzi-dev/debian/control <tt>debian/control</tt>] file and may help users of other distributions.<br />
<br />
Some corresponding source tarballs can be downloaded from [https://launchpad.net/~paparazzi-uav/+archive/ppa/+packages paparazzi-uav ppa] on launchpad. (maybe building the packages from source is more reliable in view of dependencies)<br />
<br />
For distributions using RPM packaging, the [http://packages.debian.org/unstable/source/alien alien] tool can be used to convert a .deb package into a .rpm package.<br />
<br />
As with all Wiki pages, also this page is a work in progress. Try to be a big help to the Paparazzi project and improve this page whenever you can. If you have a distribution different from Ubuntu which doesn't satisfy any other dependency and have instructions about compiling it, packaging it, feel free to add any reference on how to do that on this wikipage.<br />
<br />
== Goal ==<br />
<br />
The goal of this page is to clarify about which version of each piece of software has to be compiled, where to find that software, patches needed to make it compile on Linux, maybe even FreeBSD or OSX.<br />
<br />
== Fedora 19 ==<br />
<br />
To build paparazzi-uav on Fedora 19, you must install the next packages from the official repository:<br />
* ocaml<br />
* ocaml-findlib<br />
* ocaml-xml-light<br />
* ocaml-ocamlnet<br />
* ocaml-lablgtk-devel<br />
* libxml2-devel<br />
* SDL-devel<br />
* libusb-devel<br />
<br />
Paparazzi-uav needs to include some ocaml headers when it compiles the simulator, then please be sure that they are included. If not, edit sw/simulator/Makefile and add:<br />
<br />
CAML_CFLAGS = -I/usr/lib64/ocaml<br />
<br />
The following packages must be built from source code (they are not included in the official repository): <br />
* ivy-c <br />
* ivy-ocaml <br />
<br />
Paparazzi-uav was successfully compiled using ivy-c 3.14 (downloaded from SVN repository, revision #3602) and ivy-ocaml 1.2. Please note that the ivy-c version is an unstable version!<br />
<br />
Additionally, you need install the next RPMs to build ivy-c:<br />
* pcre-devel<br />
* libXt-devel<br />
* tcl-devel<br />
* glib2-devel<br />
<br />
Don't forget to set the environment variable PKG_CONFIG before building ivy-ocaml, e.g:<br />
<br />
$ export PKG_CONFIG=/usr/local/lib/pkgconfig<br />
<br />
== Arch Linux ==<br />
<br />
This is probably a dirty hacked together (not realy according to "the Arch Way") install, but works on fresh installed Archbang.<br />
<br />
'''NOTE: following issues '''<br />
# This has been written for Archbang, although it should work on any Arch Linux based system, it has not been tested yet.<br />
# '''It seems that the error "unbound module GnoCanvas" can be resolved with installing conf-gnomecanvas2 over opam and lablgtk2 over yaourt?''' <br />
# why is there no symlink from liblglibivy.so.3 and liblglibivy.so.3 to libglibivy.so.3.15?<br />
# If pkg-config can't find some .pc files, the required path for these might not be set and exported properly. Use "pkg-config --variable pc_path pkg-config" to check if the path containing the ivy-c.pc, ivy-glib.pc and ivy-tcl.pc files are found.<br />
<br />
1. Update the fresh installation<br />
# pacman -Syyu<br />
<br />
2. Install [https://www.archlinux.org/groups/x86_64/base-devel/ base-devel] (pacman build tools, if you don't already have it) and yajl (for yaourt) <br />
# pacman -S base-devel yajl<br />
<br />
3. Add "export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/" to your shell config file (mostly ~/.bashrc)<br />
$ echo 'export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/' >> ~/.bashrc<br />
<br />
4. Install yaourt (this tool can build and install packages from the AUR for you) <br/><br />
https://astrofloyd.wordpress.com/2015/01/17/installing-yaourt-on-arch-linux/<br />
<br />
5. Install general dependencies<br />
# pacman -S subversion git libusb pcre ocaml camlp4 tcl tk python python-pip sdl glade<br />
(libtool is a component of base-devel, so this will be already installed)<br />
<br />
6. Build Ivy-C from Source<br />
$ svn checkout https://svn.tls.cena.fr/svn/ivy/ivy-c/trunk /home/$USER/temp/ivy-c<br />
$ cd /home/$USER/temp/ivy-c/src<br />
$ make<br />
# sudo make install<br />
<br />
7. '''Dirty''' All the ivy libs are installed in ''/usr/local/lib64'' and not ''/usr/local/lib'' as the .pc files point to currently. <br/><br />
Change in the third line (libdir) in the ivy-c.pc, ivy-glib.pc and ivy-tcl.pc file from ''lib'' to ''lib64'' and the fourth line (includedir) from ''include'' to ''include/Ivy''<br />
<br />
8. '''Dirty'''For libgivy, libivy and libtclivy (.so and .so.3 ending) is a link directing to the lib with .so.3.15 availaible, but not for libglibivy. <br/><br />
Create these links for libglibivy<br />
# ln -s /usr/local/lib64/libglibivy.so.3.15 /usr/local/lib64/libglibivy.so<br />
# ln -s /usr/local/lib64/libglibivy.so.3.15 /usr/local/lib64/libglibivy.so.3<br />
<br />
9. Install opam (OCaml packet manager) via yaourt<br />
$ yaourt -S opam <br />
<br />
10. Initialize opam<br />
$ opam init <br />
$ f<br />
$ ~/.bashrc<br />
$ echo 'eval `opam config env`' >> ~/.bashrc<br />
<br />
11. Install and pin lablgtk.2.16.0 (2.18.0 will not work)<br />
$ opam install -v lablgtk.2.16.0<br />
$ opam pin add lablgtk 2.16.0<br />
<br />
12. Install OCaml packets via opam<br />
$ opam install ocamlfind ocamlnet xml-light pcre ivy<br />
<br />
If this fails at Ivy check the notes on top of this guide.<br />
<br />
13. Install ivy-python via pip<br />
# pip install ivy-python<br />
<br />
14. Install the Toolchain for Paparazzi (e.g. [https://aur.archlinux.org/packages/gcc-arm-none-eabi-bin/ gcc-arm-none-eabi-bin] from the AUR)<br />
$pacman -S gcc-arm-none-eabi-bin<br />
15. Install flashing utilities if needed<br />
$ yaourt stlink-git dfu-util<br />
<br />
[[Installation#Getting_the_Source_Code|Download]] and [[Installation#Launching_the_Software|build Paparazzi]]<br />
<br />
== Installing the Cross compiler toolchain ==<br />
<br />
There are currently two different toolchains available that can be used on Linux based systems with Paparazzi. For more information see [[Installation/Linux#ARM_embedded_toolchain]]<br />
<br />
== Installing OCaml packages using OPAM ==<br />
<br />
One possibility to install and manage OCaml packages is [http://opam.ocamlpro.com/ OPAM (OCaml Package Manager)]:<br/><br />
'''Please first check the official [http://opam.ocaml.org/doc/Install.html OPAM install guide] for the simplest method.'''<br/><br />
To install it from the latest git tree run:<br />
<nowiki>git clone https://github.com/OCamlPro/opam.git</nowiki><br />
cd opam<br />
./configure && make<br />
sudo make install<br />
<br />
opam init<br />
eval `opam config env`<br />
<br />
Update your shell environment as per opam init's instructions. E.g. add to your ''~/.profile'':<br />
eval `opam config env`<br />
<br />
Build and install OCaml libs:<br />
opam install ocamlfind xml-light pcre ocamlnet<br />
opam install -v lablgtk<br />
<br />
== IVY ==<br />
<br />
IVY is a simple protocol and a set of open-source libraries and programs that allows applications to broadcast information through text messages, with a subscription mechanism based on regular expressions. The project can be found at: http://www.eei.cena.fr/products/ivy/ <br />
<br />
In the paparazzi project, Ivy is used to send telemetry data to where ever you want.<br />
<br />
NOTE: Do not confuse this IVY with the Apache Ivy project. <br />
<br />
=== Ivy-python ===<br />
<br />
The ivy-python package makes it possible to use the IVY libraries from within the Python programming language. The ivy-python package is architecture independent, so it can be downloaded from the Ubuntu or Debian paparazzi repository.<br />
<br />
The easiest way to instally it on non Debian based systems is using [https://pip.pypa.io/ pip] to install the [https://pypi.python.org/pypi/ivy-python ivy-python package] from [https://pypi.python.org/pypi PyPi - the Python Package Index].<br />
pip install ivy-python<br />
<br />
Or install from the source repository via <br />
<br />
git clone https://gitorious.org/ivybus/ivy-python.git<br />
cd ivy-python<br />
./setup.py install<br />
<br />
=== Ivy-c ===<br />
<br />
To be able to use ivy-c, the libraries need to be installed. <br />
<br />
Required packages (Debian based):<br />
* tk-dev<br />
* libpcre3-dev<br />
* libxt-dev<br />
* pkg-config<br />
* libglib2.0-dev<br />
<br />
Download source, compile and install libraries:<br />
<br />
# mkdir -p /opt/ivy-c <br />
# cd /opt/ivy-c<br />
# svn co https://svn.tls.cena.fr/svn/ivy/ivy-c/trunk<br />
# cd /opt/ivy-c/trunk/src<br />
# make<br />
# make install<br />
<br />
It is possible you get errors of the test module when compiling, just ignore the messages, it is not important for the Paparazzi project. Contact the IVY team to help them also to resolve also the testing makefile issue.<br />
<br />
==== troubleshooting ====<br />
<br />
Error message:<br />
gcc -c -O2 -Wall -Wshadow -fPIC -I/usr/include/tcl8.4 -DTCL_CHANNEL_INTEGRATION ivytcl.c<br />
ivytcl.c:28:17: fatal error: tcl.h: No such file or directory<br />
<br />
The Makefile cannot read the tcl-dev version you have installed and assumes that version 8.4 is installed, but can't find the appropriate folder.<br/><br />
Edit the line 57 of the Makefile from TCLVERS=8.4 according to your installed version, or just delete the 8.4, both work.<br />
<br />
<br />
Can't find 64bit libs:<br />
Your ivy libs were probably installed to /usr/local/lib64 and you have to make symbolic links so that they will be found:<br />
$ sudo ln -s /usr/local/lib64/libivy.so /usr/local/lib64/libivy.so.3 /usr/lib<br />
or <br />
sudo ln -s /usr/local/lib64/libivy.so /usr/local/lib64/libivy.so.3 /usr/local/lib<br />
<br />
<br />
If you get an error relating to ivytestready.c, make the following changes:<br />
mkdir /opt/ivy-c/trunk/tools/Ivy<br />
cd /opt/ivy-c/trunk/tools/Ivy<br />
cp ../../src/ivy.h .<br />
cp ../../src/ivyloop.h .<br />
cp ../../src/ivysocket.h .<br />
cp ../../src/timer.h .<br />
cd ~/develop/ivy-c/trunk/src<br />
make<br />
<br />
This copies files from the src directory to the Ivy folder in tools which did not appear after running svn above.<br />
<br />
=== Ivy-OCaml ===<br />
<br />
ivy-ocaml provides OCaml bindings for ivy-c and is needed for most of the ground segment agents that are written in OCaml like [[Server]] and [[GCS]].<br />
<br />
Download source, compile and install libraries:<br />
<br />
# mkdir -p /opt/ivy-ocaml<br />
# cd /opt/ivy-ocaml<br />
# svn co https://svn.tls.cena.fr/svn/ivy/ivy-ocaml/trunk<br />
# cd /opt/ivy-ocaml/trunk<br />
# make<br />
# make install<br />
<br />
==== ivy-ocaml via OPAM ====<br />
Or use OPAM: While the source repository and debian package is named ''ivy-ocaml'', in OPAM it is only named ''ivy'' (since it is obviously for OCaml).<br />
<br />
$ opam update<br />
$ opam install ivy<br />
<br />
== LPC21ISP ==<br />
<br />
lpc21isp is only needed to serially flash the LPC2148 based autopilots (e.g. [[Lpc21BootloaderUpload bootloader]] for tiny, twog, umarim). LPC21ISP is an in-circuit programming (ISP) tool for the microcontroller used on the Paparazzi autopilot boards. The lpc21isp project is hosted on sourceforge and one can find the source packages and information at http://sourceforge.net/projects/lpc21isp/ <br />
<br />
Get the SVN version via<br />
<br />
$ mkdir -p /opt/lpc21isp<br />
$ cd /opt/lpc21isp<br />
$ svn co https://lpc21isp.svn.sourceforge.net/svnroot/lpc21isp lpc21<br />
<br />
To compile go into the source directory and then do<br />
<br />
$ cd lpc21<br />
$ make -f Makefile clean all<br />
<br />
To install<br />
<br />
$ exportline="PATH=$PATH:/opt/lpc21isp"<br />
$ if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi<br />
$ source ~/.profile<br />
<br />
== Paparazzi-dev Debian/Ubuntu packages ==<br />
<br />
For Ubuntu users, you can install the following packages from standard repository. You can just copy the line(s) and paste into your terminal. But do not copy the $ sign, this symbol is just added on this page to show that it is to be pasted at a normal terminal prompt.<br />
<br />
=== Whole lot in one ===<br />
<br />
sudo apt-get install ocaml libcamlimages-ocaml liblablgtk2-ocaml-dev liblablgtk2-gl-ocaml-dev \<br />
liblablgtk2-gnome-ocaml-dev libxml-light-ocaml-dev libocamlnet-ocaml-dev libpcre-ocaml \<br />
libpcre-ocaml-dev libgnomecanvas2-0 libgnomecanvas2-dev libglade2-0 libglade2-dev make build-essential \<br />
git gnuplot boa m4 libtool libftdi-dev libmpfr-dev tcl8.5-dev xutils-dev<br />
<br />
=== Ocaml and libraries ===<br />
<br />
Ocaml, short for Objective Caml is the most popular variant of the Caml language. The Paparazzi Ground Control Station (GCS) and some of it's tools are crafted in this language.<br />
<br />
* ocaml, ocaml-camlimages-devel, ocaml-lablgtk2-devel, ocaml-xml-light-devel, ocamlnet-ocaml-devel<br />
<br />
$ sudo apt-get install ocaml libcamlimages-ocaml liblablgtk2-ocaml-dev liblablgtk2-gl-ocaml-dev \<br />
liblablgtk2-gnome-ocaml-dev libxml-light-ocaml-dev libocamlnet-ocaml-dev<br />
<br />
=== Gnome canvas Library ===<br />
<br />
The GnomeCanvas is an engine for structured graphics that offers a rich imaging model, high performance rendering, and a powerful, high level API. This widget can be used for flexible display of graphics and for creating interactive user interface elements.<br />
<br />
$ sudo apt-get install libgnomecanvas2-0 libgnomecanvas2-dev<br />
<br />
=== USB Library ===<br />
<br />
The libusb project aims to create a library for use by user level applications to access USB devices regardless of OS. [http://www.libusb.org]<br />
<br />
$ sudo apt-get install libusb-dev<br />
<br />
=== Ocaml PCRE ===<br />
<br />
This OCaml-library interfaces the PCRE (Perl-compatibility regular expressions) C library. it can be used for matching regular expressions which are written in Perl style.<br />
<br />
$ sudo apt-get install libpcre-ocaml libpcre-ocaml-dev<br />
<br />
=== Glade Library ===<br />
<br />
Libglade is a library that performs a similar job to the C source output routines in the GLADE user interface builder. Whereas GLADE's output routines create C source code that must be compiled, libglade builds the interface from an XML file (GLADE's save format) at runtime. This can allow modifying the user interface without recompiling.<br />
<br />
$ sudo apt-get install libglade2-0 libglade2-dev<br />
<br />
=== Tcl/Tk ===<br />
<br />
$ sudo apt-get install tcl-dev<br />
<br />
Also the some utils are required to compile and install Ivy.<br />
<br />
$ sudo apt-get install xutils-dev<br />
<br />
=== Make ===<br />
<br />
GNU Make is an utility which controls the generation of executables and other target files of a program from the program's source files. <br />
<br />
$ sudo apt-get install make<br />
<br />
=== Build essential ===<br />
<br />
$ sudo apt-get install build-essential<br />
<br />
=== Libtool ===<br />
<br />
GNU libtool is a generic library support script. Libtool hides the complexity of using shared libraries behind a consistent, portable interface. Creating the files for Paparazzi software building becomes less cumbersome by using this tool.<br />
<br />
$ sudo apt-get install libtool<br />
<br />
=== libpcre3-dev ===<br />
<br />
Required for compiling Ivy-C.<br />
<br />
$ apt-get install libpcre3-dev<br />
<br />
=== Git Client ===<br />
<br />
Git is a version control system. Version control systems allow many individuals to collaborate on the Paparazzi source code. This is needed to retrieve the latest sourcecode from various packages and Paparazzi sourcecode itself.<br />
<br />
$ sudo apt-get install git<br />
<br />
=== Subversion ===<br />
<br />
Version control system, required for cloning the ivy packages.<br />
<br />
$ apt-get install subversion<br />
<br />
=== GNU Plot ===<br />
<br />
A command-line driven interactive plotting program. Unknow if it is used<br />
<br />
$ sudo apt-get install gnuplot<br />
<br />
=== Meld ===<br />
<br />
Meld is a graphical front end to the diff program. It provides a side-by-side view of the differences between two files. It is used by the Paparazzi Center when configuration changes are not yet saved and the option comes along where one either can keep or view changes made in aircraft- and other configuration files.<br />
<br />
$ sudo apt-get install meld<br />
<br />
=== FTDI library ===<br />
<br />
libftdi is a library that talks to FTDI's 232 type chips, including the popular bitbang mode, using libusb. A library to be able to use with a debugging Autopilot hardware boards.<br />
<br />
$ sudo apt-get install libftdi-dev <br />
<br />
=== MPFR library ===<br />
<br />
The MPFR library is a C library for multiple-precision floating-point computations with correct rounding. MPFR is based on the GMP multiple-precision library. The main goal of MPFR is to provide a library for multiple-precision floating-point computation which is both efficient and has a well-defined semantics.<br />
<br />
$ sudo apt-get install libmpfr-dev<br />
<br />
=== ImageMagick ===<br />
<br />
ImageMagick is a software suite to create, edit, and compose bitmap images. It can read, convert and write images in a variety of formats. Use ImageMagick to translate, flip, mirror, rotate, scale, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves. Being able to modify image based map pictures is a feature that may come in handy one time.<br />
<br />
$ sudo apt-get install imagemagick<br />
<br />
=== Optional on an older OS ===<br />
<br />
If you have an older OS distribution it never hurts to install the following...<br />
<br />
$ sudo apt-get install libx11-6 libx11-dev texinfo libncurses5 libncursesw5 libncursesw5-dev zlibc<br />
<br />
== Paparazzi Main sourcecode ==<br />
<br />
See the main [[Installation#Getting_the_Source_Code]] page<br />
<br />
TIP: <br />
If you get the File "pprz.mli", line 149, characters 78-89: Error: Unbound type constructor Ivy.binding<br />
...this happens when IVY libraries are not yet installed. How to do this, read the part on installing IVY on this page<br />
<br />
<br />
== Useful links ==<br />
<br />
https://launchpad.net/gcc-arm-embedded/<br />
<br />
https://github.com/paparazzi/paparazzi-portability-support<br />
<br />
http://wiki.ubuntuusers.de/GNU_arm-toolchain<br />
<br />
http://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/ARM-Options.html#ARM-Options<br />
<br />
http://mcuprogramming.com/forum/arm/gnu-arm-toolchain-installer/<br />
<br />
http://www.ethernut.de/en/documents/cross-toolchain-osx.html<br />
<br />
http://www.hermann-uwe.de/blog/building-an-arm-cross-toolchain-with-binutils-gcc-newlib-and-gdb-from-source<br />
<br />
[[Category:Software]] [[Category:Developer_Documentation]] [[Category:Installation]]</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=Installation/FromScratch&diff=20227Installation/FromScratch2015-08-13T20:17:31Z<p>NeoFromMatrix: /* Arch Linux */</p>
<hr />
<div><categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Installation</categorytree><br />
__TOC__<br />
<br />
'''Users of recent Debian/Ubuntu distributions are advised to use the binary packages as described in [[Installation/Linux]].'''<br />
<br />
<span style="color:#FF0000">'''WARNING! Only use if you are proficient in working with Linux!'''</span><br />
<br />
== Intro ==<br />
<br />
Users of other Linux flavors or anyone needing manual control of each individual package can install them independently. <br/><br />
The list of dependencies of the Debian package is located in the [https://github.com/paparazzi/paparazzi-portability-support/blob/master/debian/paparazzi-dev/debian/control <tt>debian/control</tt>] file and may help users of other distributions.<br />
<br />
Some corresponding source tarballs can be downloaded from [https://launchpad.net/~paparazzi-uav/+archive/ppa/+packages paparazzi-uav ppa] on launchpad. (maybe building the packages from source is more reliable in view of dependencies)<br />
<br />
For distributions using RPM packaging, the [http://packages.debian.org/unstable/source/alien alien] tool can be used to convert a .deb package into a .rpm package.<br />
<br />
As with all Wiki pages, also this page is a work in progress. Try to be a big help to the Paparazzi project and improve this page whenever you can. If you have a distribution different from Ubuntu which doesn't satisfy any other dependency and have instructions about compiling it, packaging it, feel free to add any reference on how to do that on this wikipage.<br />
<br />
== Goal ==<br />
<br />
The goal of this page is to clarify about which version of each piece of software has to be compiled, where to find that software, patches needed to make it compile on Linux, maybe even FreeBSD or OSX.<br />
<br />
== Fedora 19 ==<br />
<br />
To build paparazzi-uav on Fedora 19, you must install the next packages from the official repository:<br />
* ocaml<br />
* ocaml-findlib<br />
* ocaml-xml-light<br />
* ocaml-ocamlnet<br />
* ocaml-lablgtk-devel<br />
* libxml2-devel<br />
* SDL-devel<br />
* libusb-devel<br />
<br />
Paparazzi-uav needs to include some ocaml headers when it compiles the simulator, then please be sure that they are included. If not, edit sw/simulator/Makefile and add:<br />
<br />
CAML_CFLAGS = -I/usr/lib64/ocaml<br />
<br />
The following packages must be built from source code (they are not included in the official repository): <br />
* ivy-c <br />
* ivy-ocaml <br />
<br />
Paparazzi-uav was successfully compiled using ivy-c 3.14 (downloaded from SVN repository, revision #3602) and ivy-ocaml 1.2. Please note that the ivy-c version is an unstable version!<br />
<br />
Additionally, you need install the next RPMs to build ivy-c:<br />
* pcre-devel<br />
* libXt-devel<br />
* tcl-devel<br />
* glib2-devel<br />
<br />
Don't forget to set the environment variable PKG_CONFIG before building ivy-ocaml, e.g:<br />
<br />
$ export PKG_CONFIG=/usr/local/lib/pkgconfig<br />
<br />
== Arch Linux ==<br />
<br />
This is probably a dirty hacked together (not realy according to "the Arch Way") install, but works on fresh installed Archbang.<br />
<br />
'''NOTE: following issues '''<br />
# This has been written for Archbang, although it should work on any Arch Linux based system, it has not been tested yet.<br />
# '''It seems that the error "unbound module GnoCanvas" can be resolved with installing conf-gnomecanvas2 over opam and lablgtk2 over yaourt?''' <br />
# why is there no symlink from liblglibivy.so.3 and liblglibivy.so.3 to libglibivy.so.3.15?<br />
<br />
<br />
1. Update the fresh installation<br />
# pacman -Syyu<br />
<br />
2. Install [https://www.archlinux.org/groups/x86_64/base-devel/ base-devel] (pacman build tools, if you don't already have it) and yajl (for yaourt) <br />
# pacman -S base-devel yajl<br />
<br />
3. Add "export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/" to your shell config file (mostly ~/.bashrc)<br />
$ echo 'export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/' >> ~/.bashrc<br />
<br />
4. Install yaourt (this tool can build and install packages from the AUR for you) <br/><br />
https://astrofloyd.wordpress.com/2015/01/17/installing-yaourt-on-arch-linux/<br />
<br />
5. Install general dependencies<br />
# pacman -S subversion git libusb pcre ocaml camlp4 tcl tk python python-pip sdl glade<br />
(libtool is a component of base-devel, so this will be already installed)<br />
<br />
6. Build Ivy-C from Source<br />
$ svn checkout https://svn.tls.cena.fr/svn/ivy/ivy-c/trunk /home/$USER/temp/ivy-c<br />
$ cd /home/$USER/temp/ivy-c/src<br />
$ make<br />
# sudo make install<br />
<br />
7. '''Dirty''' All the ivy libs are installed in ''/usr/local/lib64'' and not ''/usr/local/lib'' as the .pc files point to currently. <br/><br />
Change in the third line (libdir) in the ivy-c.pc, ivy-glib.pc and ivy-tcl.pc file from ''lib'' to ''lib64'' and the fourth line (includedir) from ''include'' to ''include/Ivy''<br />
<br />
8. '''Dirty'''For libgivy, libivy and libtclivy (.so and .so.3 ending) is a link directing to the lib with .so.3.15 availaible, but not for libglibivy. <br/><br />
Create these links for libglibivy<br />
# ln -s /usr/local/lib64/libglibivy.so.3.15 /usr/local/lib64/libglibivy.so<br />
# ln -s /usr/local/lib64/libglibivy.so.3.15 /usr/local/lib64/libglibivy.so.3<br />
<br />
9. Install opam (OCaml packet manager) via yaourt<br />
$ yaourt -S opam <br />
<br />
10. Initialize opam<br />
$ opam init <br />
$ f<br />
$ ~/.bashrc<br />
$ echo 'eval `opam config env`' >> ~/.bashrc<br />
<br />
11. Install and pin lablgtk.2.16.0 (2.18.0 will not work)<br />
$ opam install -v lablgtk.2.16.0<br />
$ opam pin add lablgtk 2.16.0<br />
<br />
12. Install OCaml packets via opam<br />
$ opam install ocamlfind ocamlnet xml-light pcre ivy<br />
<br />
13. Install ivy-python via pip<br />
# pip install ivy-python<br />
<br />
14. Install the Toolchain for Paparazzi (e.g. [https://aur.archlinux.org/packages/gcc-arm-none-eabi-bin/ gcc-arm-none-eabi-bin] from the AUR)<br />
$pacman -S gcc-arm-none-eabi-bin<br />
15. Install flashing utilities if needed<br />
$ yaourt stlink-git dfu-util<br />
<br />
[[Installation#Getting_the_Source_Code|Download]] and [[Installation#Launching_the_Software|build Paparazzi]]<br />
<br />
== Installing the Cross compiler toolchain ==<br />
<br />
There are currently two different toolchains available that can be used on Linux based systems with Paparazzi. For more information see [[Installation/Linux#ARM_embedded_toolchain]]<br />
<br />
== Installing OCaml packages using OPAM ==<br />
<br />
One possibility to install and manage OCaml packages is [http://opam.ocamlpro.com/ OPAM (OCaml Package Manager)]:<br/><br />
'''Please first check the official [http://opam.ocaml.org/doc/Install.html OPAM install guide] for the simplest method.'''<br/><br />
To install it from the latest git tree run:<br />
<nowiki>git clone https://github.com/OCamlPro/opam.git</nowiki><br />
cd opam<br />
./configure && make<br />
sudo make install<br />
<br />
opam init<br />
eval `opam config env`<br />
<br />
Update your shell environment as per opam init's instructions. E.g. add to your ''~/.profile'':<br />
eval `opam config env`<br />
<br />
Build and install OCaml libs:<br />
opam install ocamlfind xml-light pcre ocamlnet<br />
opam install -v lablgtk<br />
<br />
== IVY ==<br />
<br />
IVY is a simple protocol and a set of open-source libraries and programs that allows applications to broadcast information through text messages, with a subscription mechanism based on regular expressions. The project can be found at: http://www.eei.cena.fr/products/ivy/ <br />
<br />
In the paparazzi project, Ivy is used to send telemetry data to where ever you want.<br />
<br />
NOTE: Do not confuse this IVY with the Apache Ivy project. <br />
<br />
=== Ivy-python ===<br />
<br />
The ivy-python package makes it possible to use the IVY libraries from within the Python programming language. The ivy-python package is architecture independent, so it can be downloaded from the Ubuntu or Debian paparazzi repository.<br />
<br />
The easiest way to instally it on non Debian based systems is using [https://pip.pypa.io/ pip] to install the [https://pypi.python.org/pypi/ivy-python ivy-python package] from [https://pypi.python.org/pypi PyPi - the Python Package Index].<br />
pip install ivy-python<br />
<br />
Or install from the source repository via <br />
<br />
git clone https://gitorious.org/ivybus/ivy-python.git<br />
cd ivy-python<br />
./setup.py install<br />
<br />
=== Ivy-c ===<br />
<br />
To be able to use ivy-c, the libraries need to be installed. <br />
<br />
Required packages (Debian based):<br />
* tk-dev<br />
* libpcre3-dev<br />
* libxt-dev<br />
* pkg-config<br />
* libglib2.0-dev<br />
<br />
Download source, compile and install libraries:<br />
<br />
# mkdir -p /opt/ivy-c <br />
# cd /opt/ivy-c<br />
# svn co https://svn.tls.cena.fr/svn/ivy/ivy-c/trunk<br />
# cd /opt/ivy-c/trunk/src<br />
# make<br />
# make install<br />
<br />
It is possible you get errors of the test module when compiling, just ignore the messages, it is not important for the Paparazzi project. Contact the IVY team to help them also to resolve also the testing makefile issue.<br />
<br />
==== troubleshooting ====<br />
<br />
Error message:<br />
gcc -c -O2 -Wall -Wshadow -fPIC -I/usr/include/tcl8.4 -DTCL_CHANNEL_INTEGRATION ivytcl.c<br />
ivytcl.c:28:17: fatal error: tcl.h: No such file or directory<br />
<br />
The Makefile cannot read the tcl-dev version you have installed and assumes that version 8.4 is installed, but can't find the appropriate folder.<br/><br />
Edit the line 57 of the Makefile from TCLVERS=8.4 according to your installed version, or just delete the 8.4, both work.<br />
<br />
<br />
Can't find 64bit libs:<br />
Your ivy libs were probably installed to /usr/local/lib64 and you have to make symbolic links so that they will be found:<br />
$ sudo ln -s /usr/local/lib64/libivy.so /usr/local/lib64/libivy.so.3 /usr/lib<br />
or <br />
sudo ln -s /usr/local/lib64/libivy.so /usr/local/lib64/libivy.so.3 /usr/local/lib<br />
<br />
<br />
If you get an error relating to ivytestready.c, make the following changes:<br />
mkdir /opt/ivy-c/trunk/tools/Ivy<br />
cd /opt/ivy-c/trunk/tools/Ivy<br />
cp ../../src/ivy.h .<br />
cp ../../src/ivyloop.h .<br />
cp ../../src/ivysocket.h .<br />
cp ../../src/timer.h .<br />
cd ~/develop/ivy-c/trunk/src<br />
make<br />
<br />
This copies files from the src directory to the Ivy folder in tools which did not appear after running svn above.<br />
<br />
=== Ivy-OCaml ===<br />
<br />
ivy-ocaml provides OCaml bindings for ivy-c and is needed for most of the ground segment agents that are written in OCaml like [[Server]] and [[GCS]].<br />
<br />
Download source, compile and install libraries:<br />
<br />
# mkdir -p /opt/ivy-ocaml<br />
# cd /opt/ivy-ocaml<br />
# svn co https://svn.tls.cena.fr/svn/ivy/ivy-ocaml/trunk<br />
# cd /opt/ivy-ocaml/trunk<br />
# make<br />
# make install<br />
<br />
==== ivy-ocaml via OPAM ====<br />
Or use OPAM: While the source repository and debian package is named ''ivy-ocaml'', in OPAM it is only named ''ivy'' (since it is obviously for OCaml).<br />
<br />
$ opam update<br />
$ opam install ivy<br />
<br />
== LPC21ISP ==<br />
<br />
lpc21isp is only needed to serially flash the LPC2148 based autopilots (e.g. [[Lpc21BootloaderUpload bootloader]] for tiny, twog, umarim). LPC21ISP is an in-circuit programming (ISP) tool for the microcontroller used on the Paparazzi autopilot boards. The lpc21isp project is hosted on sourceforge and one can find the source packages and information at http://sourceforge.net/projects/lpc21isp/ <br />
<br />
Get the SVN version via<br />
<br />
$ mkdir -p /opt/lpc21isp<br />
$ cd /opt/lpc21isp<br />
$ svn co https://lpc21isp.svn.sourceforge.net/svnroot/lpc21isp lpc21<br />
<br />
To compile go into the source directory and then do<br />
<br />
$ cd lpc21<br />
$ make -f Makefile clean all<br />
<br />
To install<br />
<br />
$ exportline="PATH=$PATH:/opt/lpc21isp"<br />
$ if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi<br />
$ source ~/.profile<br />
<br />
== Paparazzi-dev Debian/Ubuntu packages ==<br />
<br />
For Ubuntu users, you can install the following packages from standard repository. You can just copy the line(s) and paste into your terminal. But do not copy the $ sign, this symbol is just added on this page to show that it is to be pasted at a normal terminal prompt.<br />
<br />
=== Whole lot in one ===<br />
<br />
sudo apt-get install ocaml libcamlimages-ocaml liblablgtk2-ocaml-dev liblablgtk2-gl-ocaml-dev \<br />
liblablgtk2-gnome-ocaml-dev libxml-light-ocaml-dev libocamlnet-ocaml-dev libpcre-ocaml \<br />
libpcre-ocaml-dev libgnomecanvas2-0 libgnomecanvas2-dev libglade2-0 libglade2-dev make build-essential \<br />
git gnuplot boa m4 libtool libftdi-dev libmpfr-dev tcl8.5-dev xutils-dev<br />
<br />
=== Ocaml and libraries ===<br />
<br />
Ocaml, short for Objective Caml is the most popular variant of the Caml language. The Paparazzi Ground Control Station (GCS) and some of it's tools are crafted in this language.<br />
<br />
* ocaml, ocaml-camlimages-devel, ocaml-lablgtk2-devel, ocaml-xml-light-devel, ocamlnet-ocaml-devel<br />
<br />
$ sudo apt-get install ocaml libcamlimages-ocaml liblablgtk2-ocaml-dev liblablgtk2-gl-ocaml-dev \<br />
liblablgtk2-gnome-ocaml-dev libxml-light-ocaml-dev libocamlnet-ocaml-dev<br />
<br />
=== Gnome canvas Library ===<br />
<br />
The GnomeCanvas is an engine for structured graphics that offers a rich imaging model, high performance rendering, and a powerful, high level API. This widget can be used for flexible display of graphics and for creating interactive user interface elements.<br />
<br />
$ sudo apt-get install libgnomecanvas2-0 libgnomecanvas2-dev<br />
<br />
=== USB Library ===<br />
<br />
The libusb project aims to create a library for use by user level applications to access USB devices regardless of OS. [http://www.libusb.org]<br />
<br />
$ sudo apt-get install libusb-dev<br />
<br />
=== Ocaml PCRE ===<br />
<br />
This OCaml-library interfaces the PCRE (Perl-compatibility regular expressions) C library. it can be used for matching regular expressions which are written in Perl style.<br />
<br />
$ sudo apt-get install libpcre-ocaml libpcre-ocaml-dev<br />
<br />
=== Glade Library ===<br />
<br />
Libglade is a library that performs a similar job to the C source output routines in the GLADE user interface builder. Whereas GLADE's output routines create C source code that must be compiled, libglade builds the interface from an XML file (GLADE's save format) at runtime. This can allow modifying the user interface without recompiling.<br />
<br />
$ sudo apt-get install libglade2-0 libglade2-dev<br />
<br />
=== Tcl/Tk ===<br />
<br />
$ sudo apt-get install tcl-dev<br />
<br />
Also the some utils are required to compile and install Ivy.<br />
<br />
$ sudo apt-get install xutils-dev<br />
<br />
=== Make ===<br />
<br />
GNU Make is an utility which controls the generation of executables and other target files of a program from the program's source files. <br />
<br />
$ sudo apt-get install make<br />
<br />
=== Build essential ===<br />
<br />
$ sudo apt-get install build-essential<br />
<br />
=== Libtool ===<br />
<br />
GNU libtool is a generic library support script. Libtool hides the complexity of using shared libraries behind a consistent, portable interface. Creating the files for Paparazzi software building becomes less cumbersome by using this tool.<br />
<br />
$ sudo apt-get install libtool<br />
<br />
=== libpcre3-dev ===<br />
<br />
Required for compiling Ivy-C.<br />
<br />
$ apt-get install libpcre3-dev<br />
<br />
=== Git Client ===<br />
<br />
Git is a version control system. Version control systems allow many individuals to collaborate on the Paparazzi source code. This is needed to retrieve the latest sourcecode from various packages and Paparazzi sourcecode itself.<br />
<br />
$ sudo apt-get install git<br />
<br />
=== Subversion ===<br />
<br />
Version control system, required for cloning the ivy packages.<br />
<br />
$ apt-get install subversion<br />
<br />
=== GNU Plot ===<br />
<br />
A command-line driven interactive plotting program. Unknow if it is used<br />
<br />
$ sudo apt-get install gnuplot<br />
<br />
=== Meld ===<br />
<br />
Meld is a graphical front end to the diff program. It provides a side-by-side view of the differences between two files. It is used by the Paparazzi Center when configuration changes are not yet saved and the option comes along where one either can keep or view changes made in aircraft- and other configuration files.<br />
<br />
$ sudo apt-get install meld<br />
<br />
=== FTDI library ===<br />
<br />
libftdi is a library that talks to FTDI's 232 type chips, including the popular bitbang mode, using libusb. A library to be able to use with a debugging Autopilot hardware boards.<br />
<br />
$ sudo apt-get install libftdi-dev <br />
<br />
=== MPFR library ===<br />
<br />
The MPFR library is a C library for multiple-precision floating-point computations with correct rounding. MPFR is based on the GMP multiple-precision library. The main goal of MPFR is to provide a library for multiple-precision floating-point computation which is both efficient and has a well-defined semantics.<br />
<br />
$ sudo apt-get install libmpfr-dev<br />
<br />
=== ImageMagick ===<br />
<br />
ImageMagick is a software suite to create, edit, and compose bitmap images. It can read, convert and write images in a variety of formats. Use ImageMagick to translate, flip, mirror, rotate, scale, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves. Being able to modify image based map pictures is a feature that may come in handy one time.<br />
<br />
$ sudo apt-get install imagemagick<br />
<br />
=== Optional on an older OS ===<br />
<br />
If you have an older OS distribution it never hurts to install the following...<br />
<br />
$ sudo apt-get install libx11-6 libx11-dev texinfo libncurses5 libncursesw5 libncursesw5-dev zlibc<br />
<br />
== Paparazzi Main sourcecode ==<br />
<br />
See the main [[Installation#Getting_the_Source_Code]] page<br />
<br />
TIP: <br />
If you get the File "pprz.mli", line 149, characters 78-89: Error: Unbound type constructor Ivy.binding<br />
...this happens when IVY libraries are not yet installed. How to do this, read the part on installing IVY on this page<br />
<br />
<br />
== Useful links ==<br />
<br />
https://launchpad.net/gcc-arm-embedded/<br />
<br />
https://github.com/paparazzi/paparazzi-portability-support<br />
<br />
http://wiki.ubuntuusers.de/GNU_arm-toolchain<br />
<br />
http://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/ARM-Options.html#ARM-Options<br />
<br />
http://mcuprogramming.com/forum/arm/gnu-arm-toolchain-installer/<br />
<br />
http://www.ethernut.de/en/documents/cross-toolchain-osx.html<br />
<br />
http://www.hermann-uwe.de/blog/building-an-arm-cross-toolchain-with-binutils-gcc-newlib-and-gdb-from-source<br />
<br />
[[Category:Software]] [[Category:Developer_Documentation]] [[Category:Installation]]</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=Debug_Probes&diff=19926Debug Probes2015-06-19T13:37:31Z<p>NeoFromMatrix: /* FT2232H Mini Module */</p>
<hr />
<div><br />
__TOC__<br />
<br />
These various debug probes can be used for flashing and debugging Paparazzi hardware, some can even as USB-UART adapters. <br/><br />
Most are compatible with the currently used STM32 platform, some also with the older LPC 21xx.<br />
<br />
Debug probes for Atmel/AVR and SiLabs (ESC Controller chips) are located on the [[ESC]] page since those Microcontrollers are note more used as main processors.<br />
<br />
==Debug Protocols / Interfaces==<br />
<br />
There are two different relevant Protocolls / Interfaces for flashing and debugging for STM32:<br/><br />
<br />
Note: Some STM32 MCUs can also be flashed via Serial and or USB DFU! But SWD and JTAG provide (much better) debugging capabilities.<br />
<br />
===SWD===<br />
<br />
[http://www.arm.com/products/system-ip/debug-trace/coresight-soc-components/serial-wire-debug.php ARM Serial Wire Debug (SWD)] is a program and debug protocol for ARM processors. It's a low pin count and high-performance alternative and replacement to JTAG.<br />
<br />
===JTAG===<br />
<br />
JTAG is a industry standard on-chip debugging protocoll. It can be used for one or more chips (daisy chained), for interfacing with the chip as well as flashing software.<br />
<br />
[[DevGuide/OpenOCD]] can be used for interfacing with JTAG hardware (e.g. FTDI chips).<br />
<br />
==[[CricketProbe/v1.00 | CricketProbe v1.00]]==<br />
<br />
[[Image:CricketProbe_v100.jpg|300px|left|link=CricketProbe/v1.00 |CricketProbe v1.00 page]]<br />
<br />
The CricketProbe is a programming and debugging tool for ARM Cortex MCU, based on [http://www.blacksphere.co.nz Black Sphere Technologies] [http://www.blacksphere.co.nz/main/blackmagic Black Magic Probe].<br />
<br />
<br style="clear:both"><br />
<br />
==Lyorak Probe==<br />
<br />
[[Image:Lyorak_front.jpg|300px|Lyorak probe]] <br />
[[Image:Lyorak_pinout.jpeg|500px|Lyorak probe pinout]] <br />
<br />
The Lyorak probe is a programming and debugging tool for ARM Cortex MCU, based on the [http://www.blacksphere.co.nz/main/blackmagic Black Magic Probe]. <br/><br />
Designed with 1206 SMD components for easy assmbly and a CAN interface.<br />
<br />
<br style="clear:both"><br />
<br />
===Documentation===<br />
<br />
[https://github.com/molnarkares/blackmagic/tree/master/hardware/contrib/lyorak molnarkares/blackmagic git repo (fork from blackmagic)]<br />
<br />
=Black Magic Probe=<br />
<br />
[[Image:BMPM_1_top.jpg|300px|Black Magic Probe]]<br />
[[Image:BMPM_1_bottom.jpg|300px|Black Magic Probe]]<br />
<br />
This is the original [http://www.blacksphere.co.nz/main/blackmagic Black Magic Probe] from [http://www.blacksphere.co.nz Black Sphere Technologies], a programming and debugging tool for ARM Cortex MCU.<br />
<br />
<br style="clear:both"><br />
<br />
===Documentation===<br />
<br />
[https://github.com/blacksphere/blackmagic blacksphere/blackmagic git repo]<br />
[http://www.blacksphere.co.nz/main/index.php/blackmagic] <br />
[http://1bitsquared.com/collections/supporting-hardware/products/black-magic-probe Buy at 1bitsquared for 65$]<br />
<br />
=[[STLink]]=<br />
<br />
[[Image:St-link.jpg|300px]]<br />
<br />
Most STM discovery / eval boards comes with a [http://www.st.com/web/catalog/tools/FM146/CL1984/SC724/SS1677/PF251168 ST-Link V2] on board, with one exception; the STM32VL version, that board comes with ST-Link V1.<br />
<br />
These can be used with [https://github.com/texane/stlink texane’s] tools, or reflashed with [[STLink#Update_the_ST-Link_to_blackmagic_probe| the blackmagic firmware]].<br />
<br />
<br style="clear:both"><br />
<br />
==Clones==<br />
<br />
There are some variations of the STLink available. Some with the same STM32F103C8T6 MCU, some with a STM32F101C8T6.<br/><br />
More informations on the [[STLink#Clones]] page.<br/><br />
Likely possible to use them with (texanes) STLink or Blackmagic software.<br />
<br />
=FLOSS JTAG=<br />
<br />
[[Image:Jtag-up.jpg|300px|FLOSS JTAG top]]<br />
[[Image:Jtag-down.jpg|300px|FLOSS JTAG bottom]]<br />
<br />
The FLOSS JTAG is based on an FTDI 2232HL chip that allows two simultaneous USB connections, which means that FLOSS JTAG allows JTAG and UART simultaneously.<br/><br />
<br />
The upper side contains the JTAG connector and two sets of RX/TX LEDs for JTAG and UART/COM interface separately. The JTAG connector is 2x5 pins, 0.05-inch pitch, and is compatible with the Samtec FFSD-05-D-06.00-01-N-RW-R ribbon cable.<br />
<br />
On the bottom side there is 4 pin UART connector, which contains (from top to bottom on the image, or color dots): Ground (black), RX (orange), TX (yellow), and +5V (red) <br />
<br />
<br style="clear:both"><br />
<br />
Can be used with [[DevGuide/OpenOCD]] software.<br />
===Documentation===<br />
<br />
[http://randomprojects.org/wiki/Floss-JTAG randomprojects.org/wiki/Floss-JTAG]<br />
<br />
=FT2232H Mini Module=<br />
<br />
[[Image:AlternativeFlossJtag.png|300px|FT2232H Mini Modules as JTAG adapter]]<br />
[[Image:FT2232H_Mini_Module_front.jpg|200px|Top with all necessary connections]]<br />
[[Image:FT2232H_Mini_Module_back.jpg|200px|Bottom with pin headers]]<br />
<br />
<br style="clear:both"><br />
<br />
The FT2232H Mini modules can be used with blackmagic firmware or as FLOSS-JTAG device. <br/><br />
<br />
'''Important'''<br />
<br />
Out of the box, there is NO power supply for the FT2232H because this can either done with USB or external 5V.<br/><br />
The pictures above show two different PCB versions. The suggested connections only apply to the right (latest) layout.<br />
<br />
Connect: (for power supply over USB)<br />
* CN3 pin 1 to CN3 pin 3<br />
* CN2 pin group 1,3,5 to CN2 pin group 11,21 and to CN3 pin group 12,22<br />
<br />
'''Pinout'''<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="6"<br />
|+'''Power'''<br />
!''Use''!!''Pin''<br />
|-<br />
|3V3||CN2-1<br />
|-<br />
|3V3||CN2-3<br />
|-<br />
|3V3||CN2-5<br />
|-<br />
|GND||CN2-2<br />
|-<br />
|GND||CN2-4<br />
|-<br />
|GND||CN2-6<br />
|-<br />
|GND||CN3-2<br />
|-<br />
|GND||CN3-4<br />
|}<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="6"<br />
|+'''UART'''<br />
!''Use''!!''Pin''!!''Name''<br />
|-<br />
|UART1 RX ||CN2-10||ADBUS1<br />
|-<br />
|UART1 TX ||CN2-7||ADBUS0<br />
|-<br />
|UART2 RX ||CN3-25||BDBUS1<br />
|-<br />
|UART2 TX ||CN3-26||BDBUS0<br />
|}<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="6"<br />
|+'''JTAG'''<br />
!''Use''!!''Pin''!!''Name''<br />
|-<br />
|JTAG1 TCK ||CN2-7||ADBUS0<br />
|-<br />
|JTAG1 TDI ||CN2-10||ADBUS1<br />
|-<br />
|JTAG1 TDO ||CN2-9||ADBUS2<br />
|-<br />
|JTAG1 TMS ||CN2-12||ADBUS3<br />
|-<br />
|JTAG2 TCK ||CN3-26||BDBUS0<br />
|-<br />
|JTAG2 TDI ||CN3-25||BDBUS1<br />
|-<br />
|JTAG2 TDO ||CN3-24||BDBUS2<br />
|-<br />
|JTAG2 TMS ||CN3-23||BDBUS3<br />
|}<br />
<br />
===Blackmagic firmware===<br />
<br />
First, get the VID/PID for your FT2232 device using 'lsusb'. Edit the file<br />
'src/libftdi/platform.h' and change the VID/PID to match your hardware.<br />
Compile the application with the command:<br />
<br />
make PROBE_HOST=libftdi<br />
<br />
===Use as FLOSS-JTAG===<br />
<br />
With the tool "FT_Prog" change the description the FT2232H to "FLOSS-JTAG".<br />
<br />
===Documentation===<br />
<br />
[http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT2232H.pdf FT2232H Datasheet] <br/><br />
[http://www.ftdichip.com/Support/Documents/DataSheets/Modules/DS_FT2232H_Mini_Module.pdf FT2232H Mini Module Datatsheet] <br/><br />
[http://at.mouser.com/ProductDetail/FTDI/FT2232H-MINI-MODULE/?qs=sGAEpiMZZMvOu2nvEqRMlAhGRrWaSCdm Mouser shop 22€]<br />
<br />
=Blackmagic Probe usage=<br />
<br />
In the wiki (under [Developer_Guide]) is already some helpful information:<br />
* Use Blackmagic Probe with Eclipse [[RT_Paparazzi#Debugging_with_an_Eclipse_IDE]].<br />
* General OpenOCD/GDB commands in reagards of the BMP, also about SWD [[DevGuide/GDB_OpenOCD_Debug#Debugging_with_GDB_over_JTAG]] [[DevGuide/GDB_OpenOCD_Debug#Black_Magic_Probe]].<br />
<br />
===Upgrade BMP firmware===<br />
<br />
Check firmware version:<br />
$ arm-none-eabi-gdb<br />
(gdb) target extended-remote /dev/ttyACM0<br />
(gdb) monitor version<br />
<br />
Download source from git, compile:<br />
$ git clone https://github.com/blacksphere/blackmagic<br />
$ cd blackmagic<br />
$ git submodule init<br />
$ git submodule update<br />
$ make<br />
$ cd src<br />
$ make clean<br />
$ make PROBE_HOST=native<br />
$ cd ../scripts<br />
Connect the Blackmagic Probe to USB while holding down the button for firmware update, then start "stm32_mem.py".<br />
$ stm32_mem.py ../src/blackmagic.bin<br />
<br />
You can build different targets (Hardware Platforms), default value is;<br />
<br />
$ make PROBE_HOST=native<br />
<br />
[[Category:Hardware]]</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=Debug_Probes&diff=19920Debug Probes2015-06-15T20:28:48Z<p>NeoFromMatrix: /* Clones */</p>
<hr />
<div><br />
__TOC__<br />
<br />
These various debug probes can be used for flashing and debugging Paparazzi hardware, some can even as USB-UART adapters. <br/><br />
Most are compatible with the currently used STM32 platform, some also with the older LPC 21xx.<br />
<br />
Debug probes for Atmel/AVR and SiLabs (ESC Controller chips) are located on the [[ESC]] page since those Microcontrollers are note more used as main processors.<br />
<br />
==Debug Protocols / Interfaces==<br />
<br />
There are two different relevant Protocolls / Interfaces for flashing and debugging for STM32:<br/><br />
<br />
Note: Some STM32 MCUs can also be flashed via Serial and or USB DFU! But SWD and JTAG provide (much better) debugging capabilities.<br />
<br />
===SWD===<br />
<br />
[http://www.arm.com/products/system-ip/debug-trace/coresight-soc-components/serial-wire-debug.php ARM Serial Wire Debug (SWD)] is a program and debug protocol for ARM processors. It's a low pin count and high-performance alternative and replacement to JTAG.<br />
<br />
===JTAG===<br />
<br />
JTAG is a industry standard on-chip debugging protocoll. It can be used for one or more chips (daisy chained), for interfacing with the chip as well as flashing software.<br />
<br />
[[DevGuide/OpenOCD]] can be used for interfacing with JTAG hardware (e.g. FTDI chips).<br />
<br />
==[[CricketProbe/v1.00 | CricketProbe v1.00]]==<br />
<br />
[[Image:CricketProbe_v100.jpg|300px|left|link=CricketProbe/v1.00 |CricketProbe v1.00 page]]<br />
<br />
The CricketProbe is a programming and debugging tool for ARM Cortex MCU, based on [http://www.blacksphere.co.nz Black Sphere Technologies] [http://www.blacksphere.co.nz/main/blackmagic Black Magic Probe].<br />
<br />
<br style="clear:both"><br />
<br />
==Lyorak Probe==<br />
<br />
[[Image:Lyorak_front.jpg|300px|Lyorak probe]] <br />
[[Image:Lyorak_pinout.jpeg|500px|Lyorak probe pinout]] <br />
<br />
The Lyorak probe is a programming and debugging tool for ARM Cortex MCU, based on the [http://www.blacksphere.co.nz/main/blackmagic Black Magic Probe]. <br/><br />
Designed with 1206 SMD components for easy assmbly and a CAN interface.<br />
<br />
<br style="clear:both"><br />
<br />
===Documentation===<br />
<br />
[https://github.com/molnarkares/blackmagic/tree/master/hardware/contrib/lyorak molnarkares/blackmagic git repo (fork from blackmagic)]<br />
<br />
=Black Magic Probe=<br />
<br />
[[Image:BMPM_1_top.jpg|300px|Black Magic Probe]]<br />
[[Image:BMPM_1_bottom.jpg|300px|Black Magic Probe]]<br />
<br />
This is the original [http://www.blacksphere.co.nz/main/blackmagic Black Magic Probe] from [http://www.blacksphere.co.nz Black Sphere Technologies], a programming and debugging tool for ARM Cortex MCU.<br />
<br />
<br style="clear:both"><br />
<br />
===Documentation===<br />
<br />
[https://github.com/blacksphere/blackmagic blacksphere/blackmagic git repo]<br />
[http://www.blacksphere.co.nz/main/index.php/blackmagic] <br />
[http://1bitsquared.com/collections/supporting-hardware/products/black-magic-probe Buy at 1bitsquared for 65$]<br />
<br />
=[[STLink]]=<br />
<br />
[[Image:St-link.jpg|300px]]<br />
<br />
Most STM discovery / eval boards comes with a [http://www.st.com/web/catalog/tools/FM146/CL1984/SC724/SS1677/PF251168 ST-Link V2] on board, with one exception; the STM32VL version, that board comes with ST-Link V1.<br />
<br />
These can be used with [https://github.com/texane/stlink texane’s] tools, or reflashed with [[STLink#Update_the_ST-Link_to_blackmagic_probe| the blackmagic firmware]].<br />
<br />
<br style="clear:both"><br />
<br />
==Clones==<br />
<br />
There are some variations of the STLink available. Some with the same STM32F103C8T6 MCU, some with a STM32F101C8T6.<br/><br />
More informations on the [[STLink#Clones]] page.<br/><br />
Likely possible to use them with (texanes) STLink or Blackmagic software.<br />
<br />
=FLOSS JTAG=<br />
<br />
[[Image:Jtag-up.jpg|300px|FLOSS JTAG top]]<br />
[[Image:Jtag-down.jpg|300px|FLOSS JTAG bottom]]<br />
<br />
The FLOSS JTAG is based on an FTDI 2232HL chip that allows two simultaneous USB connections, which means that FLOSS JTAG allows JTAG and UART simultaneously.<br/><br />
<br />
The upper side contains the JTAG connector and two sets of RX/TX LEDs for JTAG and UART/COM interface separately. The JTAG connector is 2x5 pins, 0.05-inch pitch, and is compatible with the Samtec FFSD-05-D-06.00-01-N-RW-R ribbon cable.<br />
<br />
On the bottom side there is 4 pin UART connector, which contains (from top to bottom on the image, or color dots): Ground (black), RX (orange), TX (yellow), and +5V (red) <br />
<br />
<br style="clear:both"><br />
<br />
Can be used with [[DevGuide/OpenOCD]] software.<br />
===Documentation===<br />
<br />
[http://randomprojects.org/wiki/Floss-JTAG randomprojects.org/wiki/Floss-JTAG]<br />
<br />
=FT2232H Mini Module=<br />
<br />
[[Image:AlternativeFlossJtag.png|300px|FT2232H Mini Modules as JTAG adapter]]<br />
[[Image:FT2232H_Mini_Module_front.jpg|200px|Top with all necessary connections]]<br />
[[Image:FT2232H_Mini_Module_back.jpg|200px|Bottom with pin headers]]<br />
<br />
<br style="clear:both"><br />
<br />
The FT2232H Mini modules can be used with blackmagic firmware or as FLOSS-JTAG device. <br/><br />
<br />
'''Important'''<br />
<br />
Out of the box, there is NO power supply for the FT2232H because this can either done with USB or external 5V.<br/><br />
The pictures above show two different PCB versions. The suggested connections only apply to the right (latest) layout.<br />
<br />
Connect: (for power supply over USB)<br />
* CN3 pin 1 to CN3 pin 3<br />
* CN2 pin group 1,3,5 to CN2 pin group 11,21 and to CN3 pin group 12,22<br />
<br />
'''Pinout'''<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="6"<br />
|+'''UART'''<br />
!''Use''!!''Pin''!!''Name''<br />
|-<br />
|UART1 RX ||CN2-10||ADBUS1<br />
|-<br />
|UART1 TX ||CN2-7||ADBUS0<br />
|-<br />
|UART2 RX ||CN3-25||BDBUS1<br />
|-<br />
|UART2 TX ||CN3-26||BDBUS0<br />
|}<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="6"<br />
|+'''JTAG'''<br />
!''Use''!!''Pin''!!''Name''<br />
|-<br />
|JTAG1 TCK ||CN2-7||ADBUS0<br />
|-<br />
|JTAG1 TDI ||CN2-10||ADBUS1<br />
|-<br />
|JTAG1 TDO ||CN2-9||ADBUS2<br />
|-<br />
|JTAG1 TMS ||CN2-12||ADBUS3<br />
|-<br />
|JTAG2 TCK ||CN3-26||BDBUS0<br />
|-<br />
|JTAG2 TDI ||CN3-25||BDBUS1<br />
|-<br />
|JTAG2 TDO ||CN3-24||BDBUS2<br />
|-<br />
|JTAG2 TMS ||CN3-23||BDBUS3<br />
|}<br />
<br />
===Blackmagic firmware===<br />
<br />
First, get the VID/PID for your FT2232 device using 'lsusb'. Edit the file<br />
'src/libftdi/platform.h' and change the VID/PID to match your hardware.<br />
Compile the application with the command:<br />
<br />
make PROBE_HOST=libftdi<br />
<br />
===Use as FLOSS-JTAG===<br />
<br />
With the tool "FT_Prog" change the description the FT2232H to "FLOSS-JTAG".<br />
<br />
===Documentation===<br />
<br />
[http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT2232H.pdf FT2232H Datasheet] <br/><br />
[http://www.ftdichip.com/Support/Documents/DataSheets/Modules/DS_FT2232H_Mini_Module.pdf FT2232H Mini Module Datatsheet] <br/><br />
[http://at.mouser.com/ProductDetail/FTDI/FT2232H-MINI-MODULE/?qs=sGAEpiMZZMvOu2nvEqRMlAhGRrWaSCdm Mouser shop 22€]<br />
<br />
=Blackmagic Probe usage=<br />
<br />
In the wiki (under [Developer_Guide]) is already some helpful information:<br />
* Use Blackmagic Probe with Eclipse [[RT_Paparazzi#Debugging_with_an_Eclipse_IDE]].<br />
* General OpenOCD/GDB commands in reagards of the BMP, also about SWD [[DevGuide/GDB_OpenOCD_Debug#Debugging_with_GDB_over_JTAG]] [[DevGuide/GDB_OpenOCD_Debug#Black_Magic_Probe]].<br />
<br />
===Upgrade BMP firmware===<br />
<br />
Check firmware version:<br />
$ arm-none-eabi-gdb<br />
(gdb) target extended-remote /dev/ttyACM0<br />
(gdb) monitor version<br />
<br />
Download source from git, compile:<br />
$ git clone https://github.com/blacksphere/blackmagic<br />
$ cd blackmagic<br />
$ git submodule init<br />
$ git submodule update<br />
$ make<br />
$ cd src<br />
$ make clean<br />
$ make PROBE_HOST=native<br />
$ cd ../scripts<br />
Connect the Blackmagic Probe to USB while holding down the button for firmware update, then start "stm32_mem.py".<br />
$ stm32_mem.py ../src/blackmagic.bin<br />
<br />
You can build different targets (Hardware Platforms), default value is;<br />
<br />
$ make PROBE_HOST=native<br />
<br />
[[Category:Hardware]]</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=Connectors_and_Wiring&diff=19862Connectors and Wiring2015-05-26T07:40:24Z<p>NeoFromMatrix: </p>
<hr />
<div>The Hirose DF13 series look pretty similar to the Molex Picoblade,although they have a different form facotor and may not fit! <br/><br />
Check the connector type before ordering (3D Robotics and HK/chinese manufactureres may use one of those types).<br />
<br />
== Molex PicoBlade™ 1.25mm (.049") Pitch Connector System ==<br />
<br />
[[Image:molex_plug.gif|thumb|Molex plug]]<br />
<br />
Paparazzi autopilots use [http://www.molex.com/cgi-bin/bv/molex/jsp/family/intro.jsp?BV_SessionID=@@@@1727607529.1210263742@@@@&BV_EngineID=cccdadedmmeeehecflgcehedffgdfmk.0&oid=-10261&channel=Products&familyOID=-10261&frellink=Introduction&chanName=family&pageTitle=PicoBlade&#153;%20|%20Overview 1.25mm Molex PicoBlade™] headers for all connections. Users must make their own wiring harnesses by either crimping the molex terminal pins onto their wiring or soldering pre-crimped wires to their peripherals.<br />
* Be sure to order plenty of 1.25mm [[Media:molex-female-510210200_sd.pdf|Molex plugs]] (female)<br />
* Current: 1.0A<br />
* Wires are available (post sources) with pins already crimped - simply trim and solder these to your peripherals and assemble them into the Molex plugs. Try [http://www.farnell.com/ Farnell] Part number 112-5276 or 112-5274, RS-Components [http://uk.rs-online.com/web/search/searchBrowseAction.html?method=searchProducts&searchTerm=279-9516&x=0&y=0 279-9516] or [http://uk.rs-online.com/web/search/searchBrowseAction.html?method=searchProducts&searchTerm=279-9544&x=30&y=20 279-9544]. In the US Newark has them. Part number [http://www.newark.com/jsp/search/productdetail.jsp?sku=93K4876 93K4876] ~$10 for 10 300mm wires with a socket on each end.<br />
<br />
=== 1.25mm (0.049") Pitch PicoBlade Receptacle (Female) ===<br />
<br />
[[Image:Molex_crimp.jpg|thumb|Inserting a Molex crimp]]<br />
<br />
These are the connector housings, used in the wiring harness and not the PCB<br />
<br />
* [http://www.mouser.com/search/ProductDetail.aspx?R=51021-0200virtualkey53810000virtualkey538-51021-0200 51021-0200] 1.25mm Molex PicoBlade Receptacle 2pos<br />
* [http://www.mouser.com/search/ProductDetail.aspx?R=51021-0300virtualkey53810000virtualkey538-51021-0300 51021-0300] 1.25mm Molex PicoBlade Receptacle 3pos<br />
* [http://www.mouser.com/Search/ProductDetail.aspx?qs=ILqg114nvd6Z%252bmZXFEtu8g%3d%3d 51021-0400] 1.25mm Molex PicoBlade Receptacle 4pos<br />
* [http://www.mouser.com/search/ProductDetail.aspx?R=51021-0500virtualkey53810000virtualkey538-51021-0500 51021-0500] 1.25mm Molex PicoBlade Receptacle 5pos<br />
* [http://www.mouser.com/Search/ProductDetail.aspx?qs=hSmm4fxMIuNmj4UzNb1XZA%3d%3d 51021-0700] 1.25mm Molex PicoBlade Receptacle 7pos<br />
* [http://www.mouser.com/search/ProductDetail.aspx?R=51021-0800virtualkey53810000virtualkey538-51021-0800 51021-0800] 1.25mm Molex PicoBlade Receptacle 8pos<br />
* [http://www.mouser.com/search/ProductDetail.aspx?R=51021-1000virtualkey53810000virtualkey538-51021-1000 51021-1000] 1.25mm Molex PicoBlade Receptacle 10pos<br />
<br />
=== 1.25mm (0.049") Female Crimp Terminals ===<br />
<br />
The 1.25mm terminals are extremely small and ''cannot and should not be soldered, crimped with pliers, or attached by any tool other than the genuine Molex crimper.'' Remember that if a wire comes loose, any wire, the plane will crash!<br />
<br />
* [http://www.mouser.com/search/ProductDetail.aspx?R=50058-8000virtualkey53810000virtualkey538-50058-8000 Mouser 50058-8000] 28-32 tape ($0.04-0.07 USD based on qty)<br />
* [http://www.mouser.com/search/ProductDetail.aspx?R=50079-8000virtualkey53810000virtualkey538-50079-8000 Mouser 50079-8000] 26-28 tape ($0.03-0.07 USD based on qty)<br />
<br />
or<br />
<br />
* [http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=WM1142CT-ND Digi-Key WM1142CT-ND] 26-28 AWG<br />
* [http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=WM1775-ND Digi-Key WM1775-ND] 28-32 AWG<br />
<br />
[[Image:molex_pin.gif|thumb|Molex pin]]<br />
<br />
=== Crimpers ===<br />
<br />
[[Image:molex_crimper.jpg|thumb|Molex Crimper]]<br />
<br />
Crimpers are available from Mouser or Digi-Key for approximately $200 USD and will prove worthwhile for most users. The fact that Wire-to-Wire Plugs are available should make this Crimper an even more worthwhile investment.<br />
<br />
* Strip Length should be between 1.40 to 1.90mm<br />
* Wire Insulation Range should be < 1.0mm with the 28-32AWG Terminals and < 1.04mm with the 26-28AWG Terminals<br />
<br />
* [http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=WM9984-ND Digi-Key WM9984-ND] for 26-32 AWG wire<br />
* [http://www.mouser.com/search/refine.aspx?Ntt=63811-0300 P/N# 63811-0300] for 28-26 AWG wire (obsolete)<br />
* [http://www.mouser.com/search/refine.aspx?Ntt=63811-0200 P/N# 63811-0200] for 32-28 AWG wire (obsolete)<br />
<br />
=== 1.25mm (0.049") Pitch PicoBlade Plug (Male, Wire-to-wire) ===<br />
<br />
These Plugs are for Wire-to-Wire connections and they are not required. Their reference here is for convenience only.<br />
<br />
* [http://www.mouser.com/search/ProductDetail.aspx?R=51047-0200virtualkey53810000virtualkey538-51047-0200 51047-0200] 1.25mm Molex PicoBlade Plug 2pos<br />
* [http://www.mouser.com/search/ProductDetail.aspx?R=51047-0300virtualkey53810000virtualkey538-51047-0300 51047-0300] 1.25mm Molex PicoBlade Plug 3pos<br />
* [http://www.mouser.com/search/ProductDetail.aspx?R=51047-0400virtualkey53810000virtualkey538-51047-0400 51047-0400] 1.25mm Molex PicoBlade Plug 4pos<br />
* [http://www.mouser.com/search/ProductDetail.aspx?R=51047-0500virtualkey53810000virtualkey538-51047-0500 51047-0500] 1.25mm Molex PicoBlade Plug 5pos<br />
* [http://www.mouser.com/search/ProductDetail.aspx?R=51047-0600virtualkey53810000virtualkey538-51047-0600 51047-0600] 1.25mm Molex PicoBlade Plug 6pos<br />
* [http://www.mouser.com/search/ProductDetail.aspx?R=51047-0700virtualkey53810000virtualkey538-51047-0700 51047-0700] 1.25mm Molex PicoBlade Plug 7pos<br />
* [http://www.mouser.com/search/ProductDetail.aspx?R=51047-0800virtualkey53810000virtualkey538-51047-0800 51047-0800] 1.25mm Molex PicoBlade Plug 8pos<br />
* [http://www.mouser.com/search/ProductDetail.aspx?R=51047-0900virtualkey53810000virtualkey538-51047-0900 51047-0900] 1.25mm Molex PicoBlade Plug 9pos<br />
* [http://www.mouser.com/search/ProductDetail.aspx?R=51047-1000virtualkey53810000virtualkey538-51047-1000 51047-1000] 1.25mm Molex PicoBlade Plug 10pos<br />
<br />
=== 1.25mm (0.049") Male Crimp Terminals ===<br />
<br />
These Crimp Terminals are for Wire-to-Wire connections and they are not required. Their reference here is for convenience only.<br />
<br />
* [http://www.mouser.com/search/ProductDetail.aspx?R=50133-8000virtualkey53810000virtualkey538-50133-8000 50133-8000] 28-32 tape <br />
* [http://www.mouser.com/search/ProductDetail.aspx?R=50125-8000virtualkey53810000virtualkey538-50125-8000 50125-8000] 26-28 tape <br />
<br />
<br style="clear:both;"/><br />
<br />
<br />
=== pre crimped connectors from ebay china (molex picblade) ===<br />
<br />
(these are the standard molex picoblade)<br />
<br />
You can find 10pcs female crimp termilas with 10cm wire and and 10 male terminals in abundle for around 5€<br />
Search for: "mini/micro jst 10pcs"<br />
<br />
This is very nice if vou have no crimp tool and want the cheapest connectors with wire on the market.<br />
Note: the male terminals in 1.25mm pitch are tht ! (trough hole technology)<br />
Be careful, most smd male terminals are 1mm pitch and can't be used on the lisa/m whis has 1.25mm pitch.<br />
<br />
== Power Supply ==<br />
For reference, Matthew Currie is assembling his Tiny(s) with WS Deans Micro 2R connectors for power as they are a commonly available R/C connector and are of high quality and durability. They do not have a positive lock mechanism but insert under a lot of pressure. They do not require any special crimping tools and withstand up to 15A.<br />
<br />
[[Image:Wsdm3007.png]]<br />
<br />
== Wiring ==<br />
Wiring is a critical part of any autonomous vehicle and the importance of high quality reliable wiring cannot be stressed enough. The molex connectors work best with 0.4mm (26AWG) wire though can also be used with 0.3mm (29AWG) on extremely lightweight models. Larger sizes will not fit. High strand-count wire is strongly advised as it is much less prone to failure from fatigue. The insulation type is critical: silicone is extremely flexible and heat resistant but easily cut or torn, teflon is extremely heat and abrasion resistant but not very flexible. Either choice is good though teflon is more durable and readily available. Standard plastic/vinyl insulated wire does not solder well (insulation melts) and does not crimp well - the vinyl insulation provides little or no strength and wires tend to break at the solder or crimp joints. Some recommended wire sources are:<br />
*Alpha 19 strand Teflon insulated 26AWG wire: [http://www.mouser.com/search/refine.aspx?Ntt=2843%2f19 Mouser P/N: 2843/19]<br />
*[http://www.rdswire.com/ RDS Wire] sells very high strand count (66 strands!) 26AWG and 29AWG silicone wire for around $0.60 to $1 per foot in quantity but they mostly deal with very large production orders and may or may not have small quantites available for a reasonable price. Call them for details.<br />
*[http://www.hobby-lobby.com/hobby-wire.htm Hobby-Lobby] has a great selection of larger silicone wire at great prices but this wire is only useful for motors and batteries. The 0.5mm wire they offer has ''very thick'' silicone insulation and will not fit into the molex connectors.<br />
*A convenient female USB mini-B receptacle ( [http://www.mouser.com/search/refine.aspx?Ntt=500075-0517 Mouser P/N: 500075-0517]) permits soldering directly without a PCB<br />
<br />
[[Category:Hardware]] [[Category:User_Documentation]]</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=Installation/FromScratch&diff=19861Installation/FromScratch2015-05-24T12:54:20Z<p>NeoFromMatrix: /* Arch Linux */</p>
<hr />
<div><categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Installation</categorytree><br />
__TOC__<br />
<br />
'''Users of recent Debian/Ubuntu distributions are advised to use the binary packages as described in [[Installation/Linux]].'''<br />
<br />
<span style="color:#FF0000">'''WARNING! Only use if you are proficient in working with Linux!'''</span><br />
<br />
== Intro ==<br />
<br />
Users of other Linux flavors or anyone needing manual control of each individual package can install them independently. <br/><br />
The list of dependencies of the Debian package is located in the [https://github.com/paparazzi/paparazzi-portability-support/blob/master/debian/paparazzi-dev/debian/control <tt>debian/control</tt>] file and may help users of other distributions.<br />
<br />
Some corresponding source tarballs can be downloaded from [https://launchpad.net/~paparazzi-uav/+archive/ppa/+packages paparazzi-uav ppa] on launchpad. (maybe building the packages from source is more reliable in view of dependencies)<br />
<br />
For distributions using RPM packaging, the [http://packages.debian.org/unstable/source/alien alien] tool can be used to convert a .deb package into a .rpm package.<br />
<br />
As with all Wiki pages, also this page is a work in progress. Try to be a big help to the Paparazzi project and improve this page whenever you can. If you have a distribution different from Ubuntu which doesn't satisfy any other dependency and have instructions about compiling it, packaging it, feel free to add any reference on how to do that on this wikipage.<br />
<br />
== Goal ==<br />
<br />
The goal of this page is to clarify about which version of each piece of software has to be compiled, where to find that software, patches needed to make it compile on Linux, maybe even FreeBSD or OSX.<br />
<br />
== Fedora 19 ==<br />
<br />
To build paparazzi-uav on Fedora 19, you must install the next packages from the official repository:<br />
* ocaml<br />
* ocaml-findlib<br />
* ocaml-xml-light<br />
* ocaml-ocamlnet<br />
* ocaml-lablgtk-devel<br />
* libxml2-devel<br />
* SDL-devel<br />
* libusb-devel<br />
<br />
Paparazzi-uav needs to include some ocaml headers when it compiles the simulator, then please be sure that they are included. If not, edit sw/simulator/Makefile and add:<br />
<br />
CAML_CFLAGS = -I/usr/lib64/ocaml<br />
<br />
The following packages must be built from source code (they are not included in the official repository): <br />
* ivy-c <br />
* ivy-ocaml <br />
<br />
Paparazzi-uav was successfully compiled using ivy-c 3.14 (downloaded from SVN repository, revision #3602) and ivy-ocaml 1.2. Please note that the ivy-c version is an unstable version!<br />
<br />
Additionally, you need install the next RPMs to build ivy-c:<br />
* pcre-devel<br />
* libXt-devel<br />
* tcl-devel<br />
* glib2-devel<br />
<br />
Don't forget to set the environment variable PKG_CONFIG before building ivy-ocaml, e.g:<br />
<br />
$ export PKG_CONFIG=/usr/local/lib/pkgconfig<br />
<br />
== Arch Linux ==<br />
<br />
This is probably a dirty hacked together (not realy according to "the Arch Way") install, but works on fresh installed Archbang.<br />
<br />
<br />
'''NOTE: following issues '''<br />
# This has been written for Archbang, although it should work on any Arch Linux based system, it has not been tested yet.<br />
# '''It seems that the error "unbound module GnoCanvas" can be resolved with installing conf-gnomecanvas2 over opam and lablgtk2 over yaourt?''' <br />
# why is there no symlink from liblglibivy.so.3 and liblglibivy.so.3 to libglibivy.so.3.15?<br />
<br />
<br />
1. Update the fresh installation<br />
# pacman -Syyu<br />
<br />
2. Install [https://www.archlinux.org/groups/x86_64/base-devel/ base-devel] (pacman build tools, if you don't already have it) and yajl (for yaourt) <br />
# pacman -S base-devel yajl<br />
<br />
3. Add "export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/" to your shell config file (mostly ~/.bashrc)<br />
$ echo 'export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/' >> ~/.bashrc<br />
<br />
4. Install yaourt (this tool can build and install packages from the AUR for you) <br/><br />
https://astrofloyd.wordpress.com/2015/01/17/installing-yaourt-on-arch-linux/<br />
<br />
5. Install general dependencies<br />
# pacman -S subversion git libusb pcre ocaml camlp4 tcl tk python python-pip sdl glade<br />
(libtool is a component of base-devel, so this will be already installed)<br />
<br />
6. Build Ivy-C from Source<br />
$ svn checkout https://svn.tls.cena.fr/svn/ivy/ivy-c/trunk /home/$USER/temp/ivy-c<br />
$ cd ivy-c/src<br />
$ make<br />
# sudo make install<br />
<br />
7. All the ivy libs are installed in ''/usr/local/lib64'' and not ''/usr/local/lib'' as the .pc files point to currently. <br/><br />
Change in the third line (libdir) in the ivy-c.pc, ivy-glib.pc and ivy-tcl.pc file from lib to lib64 and the fourth line (includedir) from include to include/Ivy.<br />
<br />
8. For libgivy, libivy and libtclivy (.so and .so.3 ending) is a link directing to the lib with .so.3.15 availaible, but not for libglibivy. <br/><br />
Create these links for libglibivy<br />
# ln -s /usr/local/lib64/libglibivy.so.3.15 /usr/local/lib64/libglibivy.so<br />
# ln -s /usr/local/lib64/libglibivy.so.3.15 /usr/local/lib64/libglibivy.so.3<br />
<br />
9. Install opam (OCaml packet manager) via yaourt<br />
$ yaourt -S opam <br />
<br />
10. Initialize opam<br />
$ opam init <br />
$ f<br />
$ ~/.bashrc<br />
$ echo 'eval `opam config env`' >> ~/.bashrc<br />
<br />
11. Install and pin lablgtk.2.16.0 (2.18.0 will not work)<br />
$ opam install -v lablgtk.2.16.0<br />
$ opam pin add lablgtk 2.16.0<br />
<br />
12. Install OCaml packets via opam<br />
$ opam install ocamlfind ocamlnet xml-light pcre ivy<br />
<br />
13. Install ivy-python via pip<br />
# pip install ivy-python<br />
<br />
14. Install the Toolchain for Paparazzi (e.g. [https://aur.archlinux.org/packages/gcc-arm-none-eabi-bin/ gcc-arm-none-eabi-bin] from the AUR)<br />
$pacman -S gcc-arm-none-eabi-bin<br />
15. Install flashing utilities if needed<br />
$ yaourt stlink-git dfu-util<br />
<br />
[[Installation#Getting_the_Source_Code|Download]] and [[Installation#Launching_the_Software|build Paparazzi]]<br />
<br />
== Installing the Cross compiler toolchain ==<br />
<br />
There are currently two different toolchains available that can be used on Linux based systems with Paparazzi. For more information see [[Installation/Linux#ARM_embedded_toolchain]]<br />
<br />
== Installing OCaml packages using OPAM ==<br />
<br />
One possibility to install and manage OCaml packages is [http://opam.ocamlpro.com/ OPAM (OCaml Package Manager)]:<br/><br />
'''Please first check the official [http://opam.ocaml.org/doc/Install.html OPAM install guide] for the simplest method.'''<br/><br />
To install it from the latest git tree run:<br />
<nowiki>git clone https://github.com/OCamlPro/opam.git</nowiki><br />
cd opam<br />
./configure && make<br />
sudo make install<br />
<br />
opam init<br />
eval `opam config env`<br />
<br />
Update your shell environment as per opam init's instructions. E.g. add to your ''~/.profile'':<br />
eval `opam config env`<br />
<br />
Build and install OCaml libs:<br />
opam install ocamlfind xml-light pcre ocamlnet<br />
opam install -v lablgtk<br />
<br />
== IVY ==<br />
<br />
IVY is a simple protocol and a set of open-source libraries and programs that allows applications to broadcast information through text messages, with a subscription mechanism based on regular expressions. The project can be found at: http://www.eei.cena.fr/products/ivy/ <br />
<br />
In the paparazzi project, Ivy is used to send telemetry data to where ever you want.<br />
<br />
NOTE: Do not confuse this IVY with the Apache Ivy project. <br />
<br />
=== Ivy-python ===<br />
<br />
The ivy-python package makes it possible to use the IVY libraries from within the Python programming language. The ivy-python package is architecture independent, so it can be downloaded from the Ubuntu or Debian paparazzi repository.<br />
<br />
The easiest way to instally it on non Debian based systems is using [https://pip.pypa.io/ pip] to install the [https://pypi.python.org/pypi/ivy-python ivy-python package] from [https://pypi.python.org/pypi PyPi - the Python Package Index].<br />
pip install ivy-python<br />
<br />
Or install from the source repository via <br />
<br />
git clone https://gitorious.org/ivybus/ivy-python.git<br />
cd ivy-python<br />
./setup.py install<br />
<br />
=== Ivy-c ===<br />
<br />
To be able to use ivy-c, the libraries need to be installed. <br />
<br />
Required packages (Debian based):<br />
* tk-dev<br />
* libpcre3-dev<br />
* libxt-dev<br />
* pkg-config<br />
* libglib2.0-dev<br />
<br />
Download source, compile and install libraries:<br />
<br />
# mkdir -p /opt/ivy-c <br />
# cd /opt/ivy-c<br />
# svn co https://svn.tls.cena.fr/svn/ivy/ivy-c/trunk<br />
# cd /opt/ivy-c/trunk/src<br />
# make<br />
# make install<br />
<br />
It is possible you get errors of the test module when compiling, just ignore the messages, it is not important for the Paparazzi project. Contact the IVY team to help them also to resolve also the testing makefile issue.<br />
<br />
==== troubleshooting ====<br />
<br />
Error message:<br />
gcc -c -O2 -Wall -Wshadow -fPIC -I/usr/include/tcl8.4 -DTCL_CHANNEL_INTEGRATION ivytcl.c<br />
ivytcl.c:28:17: fatal error: tcl.h: No such file or directory<br />
<br />
The Makefile cannot read the tcl-dev version you have installed and assumes that version 8.4 is installed, but can't find the appropriate folder.<br/><br />
Edit the line 57 of the Makefile from TCLVERS=8.4 according to your installed version, or just delete the 8.4, both work.<br />
<br />
<br />
Can't find 64bit libs:<br />
Your ivy libs were probably installed to /usr/local/lib64 and you have to make symbolic links so that they will be found:<br />
$ sudo ln -s /usr/local/lib64/libivy.so /usr/local/lib64/libivy.so.3 /usr/lib<br />
or <br />
sudo ln -s /usr/local/lib64/libivy.so /usr/local/lib64/libivy.so.3 /usr/local/lib<br />
<br />
<br />
If you get an error relating to ivytestready.c, make the following changes:<br />
mkdir /opt/ivy-c/trunk/tools/Ivy<br />
cd /opt/ivy-c/trunk/tools/Ivy<br />
cp ../../src/ivy.h .<br />
cp ../../src/ivyloop.h .<br />
cp ../../src/ivysocket.h .<br />
cp ../../src/timer.h .<br />
cd ~/develop/ivy-c/trunk/src<br />
make<br />
<br />
This copies files from the src directory to the Ivy folder in tools which did not appear after running svn above.<br />
<br />
=== Ivy-OCaml ===<br />
<br />
ivy-ocaml provides OCaml bindings for ivy-c and is needed for most of the ground segment agents that are written in OCaml like [[Server]] and [[GCS]].<br />
<br />
Download source, compile and install libraries:<br />
<br />
# mkdir -p /opt/ivy-ocaml<br />
# cd /opt/ivy-ocaml<br />
# svn co https://svn.tls.cena.fr/svn/ivy/ivy-ocaml/trunk<br />
# cd /opt/ivy-ocaml/trunk<br />
# make<br />
# make install<br />
<br />
==== ivy-ocaml via OPAM ====<br />
Or use OPAM: While the source repository and debian package is named ''ivy-ocaml'', in OPAM it is only named ''ivy'' (since it is obviously for OCaml).<br />
<br />
$ opam update<br />
$ opam install ivy<br />
<br />
== LPC21ISP ==<br />
<br />
lpc21isp is only needed to serially flash the LPC2148 based autopilots (e.g. [[Lpc21BootloaderUpload bootloader]] for tiny, twog, umarim). LPC21ISP is an in-circuit programming (ISP) tool for the microcontroller used on the Paparazzi autopilot boards. The lpc21isp project is hosted on sourceforge and one can find the source packages and information at http://sourceforge.net/projects/lpc21isp/ <br />
<br />
Get the SVN version via<br />
<br />
$ mkdir -p /opt/lpc21isp<br />
$ cd /opt/lpc21isp<br />
$ svn co https://lpc21isp.svn.sourceforge.net/svnroot/lpc21isp lpc21<br />
<br />
To compile go into the source directory and then do<br />
<br />
$ cd lpc21<br />
$ make -f Makefile clean all<br />
<br />
To install<br />
<br />
$ exportline="PATH=$PATH:/opt/lpc21isp"<br />
$ if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi<br />
$ source ~/.profile<br />
<br />
== Paparazzi-dev Debian/Ubuntu packages ==<br />
<br />
For Ubuntu users, you can install the following packages from standard repository. You can just copy the line(s) and paste into your terminal. But do not copy the $ sign, this symbol is just added on this page to show that it is to be pasted at a normal terminal prompt.<br />
<br />
=== Whole lot in one ===<br />
<br />
sudo apt-get install ocaml libcamlimages-ocaml liblablgtk2-ocaml-dev liblablgtk2-gl-ocaml-dev \<br />
liblablgtk2-gnome-ocaml-dev libxml-light-ocaml-dev libocamlnet-ocaml-dev libpcre-ocaml \<br />
libpcre-ocaml-dev libgnomecanvas2-0 libgnomecanvas2-dev libglade2-0 libglade2-dev make build-essential \<br />
git gnuplot boa m4 libtool libftdi-dev libmpfr-dev tcl8.5-dev xutils-dev<br />
<br />
=== Ocaml and libraries ===<br />
<br />
Ocaml, short for Objective Caml is the most popular variant of the Caml language. The Paparazzi Ground Control Station (GCS) and some of it's tools are crafted in this language.<br />
<br />
* ocaml, ocaml-camlimages-devel, ocaml-lablgtk2-devel, ocaml-xml-light-devel, ocamlnet-ocaml-devel<br />
<br />
$ sudo apt-get install ocaml libcamlimages-ocaml liblablgtk2-ocaml-dev liblablgtk2-gl-ocaml-dev \<br />
liblablgtk2-gnome-ocaml-dev libxml-light-ocaml-dev libocamlnet-ocaml-dev<br />
<br />
=== Gnome canvas Library ===<br />
<br />
The GnomeCanvas is an engine for structured graphics that offers a rich imaging model, high performance rendering, and a powerful, high level API. This widget can be used for flexible display of graphics and for creating interactive user interface elements.<br />
<br />
$ sudo apt-get install libgnomecanvas2-0 libgnomecanvas2-dev<br />
<br />
=== USB Library ===<br />
<br />
The libusb project aims to create a library for use by user level applications to access USB devices regardless of OS. [http://www.libusb.org]<br />
<br />
$ sudo apt-get install libusb-dev<br />
<br />
=== Ocaml PCRE ===<br />
<br />
This OCaml-library interfaces the PCRE (Perl-compatibility regular expressions) C library. it can be used for matching regular expressions which are written in Perl style.<br />
<br />
$ sudo apt-get install libpcre-ocaml libpcre-ocaml-dev<br />
<br />
=== Glade Library ===<br />
<br />
Libglade is a library that performs a similar job to the C source output routines in the GLADE user interface builder. Whereas GLADE's output routines create C source code that must be compiled, libglade builds the interface from an XML file (GLADE's save format) at runtime. This can allow modifying the user interface without recompiling.<br />
<br />
$ sudo apt-get install libglade2-0 libglade2-dev<br />
<br />
=== Tcl/Tk ===<br />
<br />
$ sudo apt-get install tcl-dev<br />
<br />
Also the some utils are required to compile and install Ivy.<br />
<br />
$ sudo apt-get install xutils-dev<br />
<br />
=== Make ===<br />
<br />
GNU Make is an utility which controls the generation of executables and other target files of a program from the program's source files. <br />
<br />
$ sudo apt-get install make<br />
<br />
=== Build essential ===<br />
<br />
$ sudo apt-get install build-essential<br />
<br />
=== Libtool ===<br />
<br />
GNU libtool is a generic library support script. Libtool hides the complexity of using shared libraries behind a consistent, portable interface. Creating the files for Paparazzi software building becomes less cumbersome by using this tool.<br />
<br />
$ sudo apt-get install libtool<br />
<br />
=== libpcre3-dev ===<br />
<br />
Required for compiling Ivy-C.<br />
<br />
$ apt-get install libpcre3-dev<br />
<br />
=== Git Client ===<br />
<br />
Git is a version control system. Version control systems allow many individuals to collaborate on the Paparazzi source code. This is needed to retrieve the latest sourcecode from various packages and Paparazzi sourcecode itself.<br />
<br />
$ sudo apt-get install git<br />
<br />
=== Subversion ===<br />
<br />
Version control system, required for cloning the ivy packages.<br />
<br />
$ apt-get install subversion<br />
<br />
=== GNU Plot ===<br />
<br />
A command-line driven interactive plotting program. Unknow if it is used<br />
<br />
$ sudo apt-get install gnuplot<br />
<br />
=== Meld ===<br />
<br />
Meld is a graphical front end to the diff program. It provides a side-by-side view of the differences between two files. It is used by the Paparazzi Center when configuration changes are not yet saved and the option comes along where one either can keep or view changes made in aircraft- and other configuration files.<br />
<br />
$ sudo apt-get install meld<br />
<br />
=== FTDI library ===<br />
<br />
libftdi is a library that talks to FTDI's 232 type chips, including the popular bitbang mode, using libusb. A library to be able to use with a debugging Autopilot hardware boards.<br />
<br />
$ sudo apt-get install libftdi-dev <br />
<br />
=== MPFR library ===<br />
<br />
The MPFR library is a C library for multiple-precision floating-point computations with correct rounding. MPFR is based on the GMP multiple-precision library. The main goal of MPFR is to provide a library for multiple-precision floating-point computation which is both efficient and has a well-defined semantics.<br />
<br />
$ sudo apt-get install libmpfr-dev<br />
<br />
=== ImageMagick ===<br />
<br />
ImageMagick is a software suite to create, edit, and compose bitmap images. It can read, convert and write images in a variety of formats. Use ImageMagick to translate, flip, mirror, rotate, scale, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves. Being able to modify image based map pictures is a feature that may come in handy one time.<br />
<br />
$ sudo apt-get install imagemagick<br />
<br />
=== Optional on an older OS ===<br />
<br />
If you have an older OS distribution it never hurts to install the following...<br />
<br />
$ sudo apt-get install libx11-6 libx11-dev texinfo libncurses5 libncursesw5 libncursesw5-dev zlibc<br />
<br />
== Paparazzi Main sourcecode ==<br />
<br />
See the main [[Installation#Getting_the_Source_Code]] page<br />
<br />
TIP: <br />
If you get the File "pprz.mli", line 149, characters 78-89: Error: Unbound type constructor Ivy.binding<br />
...this happens when IVY libraries are not yet installed. How to do this, read the part on installing IVY on this page<br />
<br />
<br />
== Useful links ==<br />
<br />
https://launchpad.net/gcc-arm-embedded/<br />
<br />
https://github.com/paparazzi/paparazzi-portability-support<br />
<br />
http://wiki.ubuntuusers.de/GNU_arm-toolchain<br />
<br />
http://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/ARM-Options.html#ARM-Options<br />
<br />
http://mcuprogramming.com/forum/arm/gnu-arm-toolchain-installer/<br />
<br />
http://www.ethernut.de/en/documents/cross-toolchain-osx.html<br />
<br />
http://www.hermann-uwe.de/blog/building-an-arm-cross-toolchain-with-binutils-gcc-newlib-and-gdb-from-source<br />
<br />
[[Category:Software]] [[Category:Developer_Documentation]] [[Category:Installation]]</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=STLink&diff=19860STLink2015-05-22T20:18:14Z<p>NeoFromMatrix: /* Clones */</p>
<hr />
<div><div style="float: right; width: 20%"><br />
<categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Firmware Flashing</categorytree><br />
</div><br />
<br />
<div style="float: right; width: 60%"><br />
[[Image:St-link.jpg|right|450px]]<br />
</div><br />
__TOC__<br />
<br />
<br />
Every STM discovery / eval board comes with a [http://www.st.com/web/catalog/tools/FM146/CL1984/SC724/SS1677/PF251168 ST-Link V2] on board, with one exception; the STM32VL version comes with a ST-Link V1.<br />
<br />
==SWD Header==<br />
<br />
[[Image:swd_header_discovery_board.png|250px|Pinout with Apogee connector]]<br />
<br />
==Install Software==<br />
<br />
The ''st-flash'' and ''st-util'' tools are needed, provied by [https://github.com/texane/stlink texane]<br />
<br />
Download and compile<br />
$ cd /opt<br />
$ git clone git://github.com/texane/stlink.git stlink<br />
$ cd stlink<br />
$ ./autogen.sh<br />
$ ./configure<br />
$ make<br />
<br />
Set enviroment variable<br />
$ exportline="PATH=$PATH:/opt/stlink"<br />
$ if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi<br />
$ source ~/.profile<br />
<br />
Add udev rules <br />
$ sudo cp /opt/stlink/49-stlinkv*.rules /etc/udev/rules.d<br />
$ sudo udevadm control --reload-rules<br />
<br />
ST-LinkV1 requires a bit different treatment, read the [https://github.com/texane/stlink/blob/master/README Readme.txt]<br />
<br />
==Airframe.xml setup==<br />
<br />
Connect the ST-Link to the MCU.<br />
If a complete STM32Fx-Discovery board is used, CN3 jumpers need to be set. To program a external MCU, remove CN3 jumpers and connect the external MCU with the SWD header.<br />
<br />
To use SWD via STLink as default:<br/><br />
Set '''FLASH_MODE=STLINK'''<br/><br />
<br />
==Update the ST-Link to blackmagic probe==<br />
<br />
The STM32F103 (STLink MCU) can be flashed with the blackmagic's firware.<br/><br />
<br />
===Two STLinkV2 Method===<br />
<br />
Use one STLink to flash another<br />
<br />
Hardware Setup:<br />
One STLinkV2 (connected via USB) is programming the other one. Change the 4 Solder jumpers on the bottom of the target STLinkV2 from "DEFAULT" to "REVERSED".<br/><br />
<br />
Connections between the two STLinks<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="6"<br />
|+'''Connections [Header-Pin]'''<br />
!''Use''!!''From Programmer''!!''To Target''<br />
|-<br />
|5V||P2-5V||P2-5V<br />
|-<br />
|SWDIO||CN2-4||CN3-2<br />
|-<br />
|SWDCLK||CN2-2||CN3-3<br />
|-<br />
|GND||CN2-3||CN3-4<br />
|}<br />
<br />
Download and build the Firmware<br />
git clone https://github.com/blacksphere/blackmagic<br />
cd blackmagic<br />
git submodule init<br />
git submodule update<br />
make<br />
cd src<br />
make clean<br />
make PROBE_HOST=stlink<br />
<br />
Remove the readout protection, erase and flash<br />
openocd -f interface/stlink-v2.cfg -f target/stm32f1x_stlink.cfg -c "init" -c "halt" -c "stm32f1x unlock 0" -c "shutdown"<br />
st-flash erase<br />
st-flash --reset write blackmagic.bin 0x8002000<br />
st-flash write blackmagic_dfu.bin 0x8000000<br />
<br />
====Documentation====<br />
<br />
[http://esden.net/2014/12/29/black-magic-discovery Black Magic Discovery from Esden] <-- This also describes how to remove the read out protection. <br/><br />
[http://embdev.net/articles/STM_Discovery_as_Black_Magic_Probe embdev.net page]<br />
<br />
===BMP Method===<br />
<br />
Use a BMP to flash a STLink<br />
<br />
Transfer the solder jumpers from "Default" to "Reversed" and build the firmware as descibed above.<br/><br />
Connect the BMP to the CN2 header (see Pinout above).<br />
<br />
Start gdb, erase the option bytes and flash BMP<br />
(gdb) target extended-remote /dev/ttyACM0<br />
(gdb) mon swdp_scan<br />
(gdb) att 1 <br />
(gdb) mon option erase<br />
(gdb) load /dir/to/blackmagic<br />
(gdb) load /dir/to/blackmagic_dfu<br />
(gdb) detach<br />
<br />
The option bytes do not cover the Readout Protection (RDP), but the RDP is disabled anyhow...<br />
<br />
'''Error at loading a new image after removing RDP'''<br />
<br />
Error erasing flash with vFlashErase packet<br />
If this occurs powercycle the target (disconnect and reconnect the 3V3 connection), swd scan, attach and try loading the image again. Usually the reset of the RDP requires a flash erase (done by mon option erase) and reset.<br />
<br />
Probably this can also be done via gdb.<br />
<br />
==Clones==<br />
<br />
There are also a lot of different chinese clones out there. Most with an identical MCU as the original STLinkV2, some with an STM32F101.<br />
<br />
It seems that each clone has its own programming pinout, so better double check (continuity tester) than to release the magic smoke...<br />
<br />
Most (all?) should work with the "stlink" target from Blackmagic Probe, since they probably use the same firmware from the original STLinkV2.<br />
<br />
===Red PCB===<br />
<br />
Seems to work with the standard stlink BMP image.<br />
<br />
[[Image:stlinkv2_clone_red_front.jpg|250px]]<br />
[[Image:stlinkv2_clone_red_back.jpg|250px]]<br />
<br />
* STM32F103C8T6<br />
<br />
Programming header (1.27mm, populated on the images) from the Mini USB to the Pin header (right to left on the image), used for programming the onboard MCU.<br />
<br />
# SWDIO<br />
# GND<br />
# SWDCLK<br />
# 3V3 <br />
<br />
Some Images and details about this hardware can be found at[https://www.mikrocontroller.net/articles/IRMP_auf_STM32_-_Bauanleitung]<br />
<br />
===Blue PCB===<br />
NOT TESTED YET<br />
[[Image:stlinkv2_clone_blue_front.jpg|250px]]<br />
[[Image:stlinkv2_clone_blue_back.jpg|250px]]<br />
<br />
* STM32F103C8T6<br />
<br />
Programming header (2.54mm, unpopulated on the images) from the USB to the Pin header (left to the right on the images), used for programming the onboard MCU.<br />
<br />
# GND<br />
# 5V<br />
# USART1 RX (PA10)<br />
# USART1 TX (PA9)<br />
<br />
Bootloader header (2.54mm, unpopulated on the images), from the USB to the Pin header (left to the right on the images), used for USART bootloader activation<br />
<br />
# 3V3<br />
# BOOT0 (pin 44)<br />
<br />
The 3V3/5V switch selects the input voltage for the onboard MCU.<br />
<br />
===Aluminium housing===<br />
NOT TESTED YET<br />
[[Image:stlinkv2_clone_aluminium.jpg|250px]]<br />
[[Image:stlinkv2_clone_aluminium_front.jpg|250px]]<br />
[[Image:stlinkv2_clone_aluminium_back.jpg|250px]]<br />
<br />
* STM32F101C8T6<br />
<br />
Programming header (1.27mm, unpopulated on the images) from the USB to the Pin header (left to the right on the images), used for programming the onboard MCU.<br />
<br />
# 3V3<br />
# GND<br />
# SWDCLK(PA14)<br />
# VDD, VBAT<br />
<br />
To disassemble pull the aluminium housing towards the USB connector.<br />
<br />
This has not the same hardware as https://github.com/blacksphere/blackmagic/issues/62 , but the same MCU, seems that this has just an other PCB.<br />
<br />
[[Category:Firmware Flashing]] [[Category:Developer_Documentation]]</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=File:Stlinkv2_clone_aluminium_back.jpg&diff=19859File:Stlinkv2 clone aluminium back.jpg2015-05-22T19:34:18Z<p>NeoFromMatrix: chinese STLinkV2 clone with aluminium housing, PCB back</p>
<hr />
<div>chinese STLinkV2 clone with aluminium housing, PCB back</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=File:Stlinkv2_clone_aluminium_front.jpg&diff=19858File:Stlinkv2 clone aluminium front.jpg2015-05-22T19:33:54Z<p>NeoFromMatrix: chinese STLinkV2 clone with aluminium housing, PCB front</p>
<hr />
<div>chinese STLinkV2 clone with aluminium housing, PCB front</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=File:Stlinkv2_clone_aluminium.jpg&diff=19857File:Stlinkv2 clone aluminium.jpg2015-05-22T19:33:02Z<p>NeoFromMatrix: chinese STLinkV2 clone with aluminium housing</p>
<hr />
<div>chinese STLinkV2 clone with aluminium housing</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=File:Stlinkv2_clone_blue_back.jpg&diff=19856File:Stlinkv2 clone blue back.jpg2015-05-22T19:30:23Z<p>NeoFromMatrix: chinese STLinkV2 clone back with the same MCU as the onboard STLinkV2</p>
<hr />
<div>chinese STLinkV2 clone back with the same MCU as the onboard STLinkV2</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=File:Stlinkv2_clone_blue_front.jpg&diff=19855File:Stlinkv2 clone blue front.jpg2015-05-22T19:29:03Z<p>NeoFromMatrix: chinese STLinkV2 clone front with the same MCU as the onboard STLinkV2</p>
<hr />
<div>chinese STLinkV2 clone front with the same MCU as the onboard STLinkV2</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=STLink&diff=19854STLink2015-05-22T15:35:09Z<p>NeoFromMatrix: /* Clones */</p>
<hr />
<div><div style="float: right; width: 20%"><br />
<categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Firmware Flashing</categorytree><br />
</div><br />
<br />
<div style="float: right; width: 60%"><br />
[[Image:St-link.jpg|right|450px]]<br />
</div><br />
__TOC__<br />
<br />
<br />
Every STM discovery / eval board comes with a [http://www.st.com/web/catalog/tools/FM146/CL1984/SC724/SS1677/PF251168 ST-Link V2] on board, with one exception; the STM32VL version comes with a ST-Link V1.<br />
<br />
==SWD Header==<br />
<br />
[[Image:swd_header_discovery_board.png|250px|Pinout with Apogee connector]]<br />
<br />
==Install Software==<br />
<br />
The ''st-flash'' and ''st-util'' tools are needed, provied by [https://github.com/texane/stlink texane]<br />
<br />
Download and compile<br />
$ cd /opt<br />
$ git clone git://github.com/texane/stlink.git stlink<br />
$ cd stlink<br />
$ ./autogen.sh<br />
$ ./configure<br />
$ make<br />
<br />
Set enviroment variable<br />
$ exportline="PATH=$PATH:/opt/stlink"<br />
$ if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi<br />
$ source ~/.profile<br />
<br />
Add udev rules <br />
$ sudo cp /opt/stlink/49-stlinkv*.rules /etc/udev/rules.d<br />
$ sudo udevadm control --reload-rules<br />
<br />
ST-LinkV1 requires a bit different treatment, read the [https://github.com/texane/stlink/blob/master/README Readme.txt]<br />
<br />
==Airframe.xml setup==<br />
<br />
Connect the ST-Link to the MCU.<br />
If a complete STM32Fx-Discovery board is used, CN3 jumpers need to be set. To program a external MCU, remove CN3 jumpers and connect the external MCU with the SWD header.<br />
<br />
To use SWD via STLink as default:<br/><br />
Set '''FLASH_MODE=STLINK'''<br/><br />
<br />
==Update the ST-Link to blackmagic probe==<br />
<br />
The STM32F103 (STLink MCU) can be flashed with the blackmagic's firware.<br/><br />
<br />
===Two STLinkV2 Method===<br />
<br />
Use one STLink to flash another<br />
<br />
Hardware Setup:<br />
One STLinkV2 (connected via USB) is programming the other one. Change the 4 Solder jumpers on the bottom of the target STLinkV2 from "DEFAULT" to "REVERSED".<br/><br />
<br />
Connections between the two STLinks<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="6"<br />
|+'''Connections [Header-Pin]'''<br />
!''Use''!!''From Programmer''!!''To Target''<br />
|-<br />
|5V||P2-5V||P2-5V<br />
|-<br />
|SWDIO||CN2-4||CN3-2<br />
|-<br />
|SWDCLK||CN2-2||CN3-3<br />
|-<br />
|GND||CN2-3||CN3-4<br />
|}<br />
<br />
Download and build the Firmware<br />
git clone https://github.com/blacksphere/blackmagic<br />
cd blackmagic<br />
git submodule init<br />
git submodule update<br />
make<br />
cd src<br />
make clean<br />
make PROBE_HOST=stlink<br />
<br />
Remove the readout protection, erase and flash<br />
openocd -f interface/stlink-v2.cfg -f target/stm32f1x_stlink.cfg -c "init" -c "halt" -c "stm32f1x unlock 0" -c "shutdown"<br />
st-flash erase<br />
st-flash --reset write blackmagic.bin 0x8002000<br />
st-flash write blackmagic_dfu.bin 0x8000000<br />
<br />
====Documentation====<br />
<br />
[http://esden.net/2014/12/29/black-magic-discovery Black Magic Discovery from Esden] <-- This also describes how to remove the read out protection. <br/><br />
[http://embdev.net/articles/STM_Discovery_as_Black_Magic_Probe embdev.net page]<br />
<br />
===BMP Method===<br />
<br />
Use a BMP to flash a STLink<br />
<br />
Transfer the solder jumpers from "Default" to "Reversed" and build the firmware as descibed above.<br/><br />
Connect the BMP to the CN2 header (see Pinout above).<br />
<br />
Start gdb, erase the option bytes and flash BMP<br />
(gdb) target extended-remote /dev/ttyACM0<br />
(gdb) mon swdp_scan<br />
(gdb) att 1 <br />
(gdb) mon option erase<br />
(gdb) load /dir/to/blackmagic<br />
(gdb) load /dir/to/blackmagic_dfu<br />
(gdb) detach<br />
<br />
The option bytes do not cover the Readout Protection (RDP), but the RDP is disabled anyhow...<br />
<br />
'''Error at loading a new image after removing RDP'''<br />
<br />
Error erasing flash with vFlashErase packet<br />
If this occurs powercycle the target (disconnect and reconnect the 3V3 connection), swd scan, attach and try loading the image again. Usually the reset of the RDP requires a flash erase (done by mon option erase) and reset.<br />
<br />
Probably this can also be done via gdb.<br />
<br />
==Clones==<br />
<br />
There are also a lot of different chinese clones out there. Most with an identical MCU as the original STLinkV2, some with an STM32F101.<br />
<br />
See also https://github.com/blacksphere/blackmagic/issues/62<br />
<br />
Most (all?) should work with the "stlink" target from Blackmagic Probe, since they probably use the same firmware from the original STLinkV2.<br />
<br />
===Red PCB===<br />
<br />
[[Image:stlinkv2_clone_red_front.jpg|250px]]<br />
[[Image:stlinkv2_clone_red_back.jpg|250px]]<br />
<br />
* STM32F103C8T6<br />
<br />
Programming header (1.27mm, populated on the images) from the Mini USB to the Pin header (right to left on the image), used for programming the onboard MCU.<br />
<br />
# SWDIO<br />
# GND<br />
# SWDCLK<br />
# 3V3 <br />
<br />
Some Images and details about this hardware can be found at[https://www.mikrocontroller.net/articles/IRMP_auf_STM32_-_Bauanleitung]<br />
<br />
===Blue PCB===<br />
<br />
[[Image:stlinkv2_clone_blue_front.jpg|250px]]<br />
[[Image:stlinkv2_clone_blue_back.jpg|250px]]<br />
<br />
* STM32F103C8T6<br />
<br />
===Aluminium housing===<br />
<br />
[[Image:stlinkv2_clone_aluminium.jpg|250px]]<br />
[[Image:stlinkv2_clone_aluminium_front.jpg|250px]]<br />
[[Image:stlinkv2_clone_aluminium_back.jpg|250px]]<br />
<br />
* STM32F101C8T6<br />
<br />
To disassemble pull the aluminium housing towards the USB connector.<br />
<br />
This has not the same hardware as https://github.com/blacksphere/blackmagic/issues/62 , but the same MCU, seems that this has just an other PCB.<br />
<br />
[[Category:Firmware Flashing]] [[Category:Developer_Documentation]]</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=STLink&diff=19853STLink2015-05-22T12:25:04Z<p>NeoFromMatrix: /* Clones */</p>
<hr />
<div><div style="float: right; width: 20%"><br />
<categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Firmware Flashing</categorytree><br />
</div><br />
<br />
<div style="float: right; width: 60%"><br />
[[Image:St-link.jpg|right|450px]]<br />
</div><br />
__TOC__<br />
<br />
<br />
Every STM discovery / eval board comes with a [http://www.st.com/web/catalog/tools/FM146/CL1984/SC724/SS1677/PF251168 ST-Link V2] on board, with one exception; the STM32VL version comes with a ST-Link V1.<br />
<br />
==SWD Header==<br />
<br />
[[Image:swd_header_discovery_board.png|250px|Pinout with Apogee connector]]<br />
<br />
==Install Software==<br />
<br />
The ''st-flash'' and ''st-util'' tools are needed, provied by [https://github.com/texane/stlink texane]<br />
<br />
Download and compile<br />
$ cd /opt<br />
$ git clone git://github.com/texane/stlink.git stlink<br />
$ cd stlink<br />
$ ./autogen.sh<br />
$ ./configure<br />
$ make<br />
<br />
Set enviroment variable<br />
$ exportline="PATH=$PATH:/opt/stlink"<br />
$ if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi<br />
$ source ~/.profile<br />
<br />
Add udev rules <br />
$ sudo cp /opt/stlink/49-stlinkv*.rules /etc/udev/rules.d<br />
$ sudo udevadm control --reload-rules<br />
<br />
ST-LinkV1 requires a bit different treatment, read the [https://github.com/texane/stlink/blob/master/README Readme.txt]<br />
<br />
==Airframe.xml setup==<br />
<br />
Connect the ST-Link to the MCU.<br />
If a complete STM32Fx-Discovery board is used, CN3 jumpers need to be set. To program a external MCU, remove CN3 jumpers and connect the external MCU with the SWD header.<br />
<br />
To use SWD via STLink as default:<br/><br />
Set '''FLASH_MODE=STLINK'''<br/><br />
<br />
==Update the ST-Link to blackmagic probe==<br />
<br />
The STM32F103 (STLink MCU) can be flashed with the blackmagic's firware.<br/><br />
<br />
===Two STLinkV2 Method===<br />
<br />
Use one STLink to flash another<br />
<br />
Hardware Setup:<br />
One STLinkV2 (connected via USB) is programming the other one. Change the 4 Solder jumpers on the bottom of the target STLinkV2 from "DEFAULT" to "REVERSED".<br/><br />
<br />
Connections between the two STLinks<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="6"<br />
|+'''Connections [Header-Pin]'''<br />
!''Use''!!''From Programmer''!!''To Target''<br />
|-<br />
|5V||P2-5V||P2-5V<br />
|-<br />
|SWDIO||CN2-4||CN3-2<br />
|-<br />
|SWDCLK||CN2-2||CN3-3<br />
|-<br />
|GND||CN2-3||CN3-4<br />
|}<br />
<br />
Download and build the Firmware<br />
git clone https://github.com/blacksphere/blackmagic<br />
cd blackmagic<br />
git submodule init<br />
git submodule update<br />
make<br />
cd src<br />
make clean<br />
make PROBE_HOST=stlink<br />
<br />
Remove the readout protection, erase and flash<br />
openocd -f interface/stlink-v2.cfg -f target/stm32f1x_stlink.cfg -c "init" -c "halt" -c "stm32f1x unlock 0" -c "shutdown"<br />
st-flash erase<br />
st-flash --reset write blackmagic.bin 0x8002000<br />
st-flash write blackmagic_dfu.bin 0x8000000<br />
<br />
====Documentation====<br />
<br />
[http://esden.net/2014/12/29/black-magic-discovery Black Magic Discovery from Esden] <-- This also describes how to remove the read out protection. <br/><br />
[http://embdev.net/articles/STM_Discovery_as_Black_Magic_Probe embdev.net page]<br />
<br />
===BMP Method===<br />
<br />
Use a BMP to flash a STLink<br />
<br />
Transfer the solder jumpers from "Default" to "Reversed" and build the firmware as descibed above.<br/><br />
Connect the BMP to the CN2 header (see Pinout above).<br />
<br />
Start gdb, erase the option bytes and flash BMP<br />
(gdb) target extended-remote /dev/ttyACM0<br />
(gdb) mon swdp_scan<br />
(gdb) att 1 <br />
(gdb) mon option erase<br />
(gdb) load /dir/to/blackmagic<br />
(gdb) load /dir/to/blackmagic_dfu<br />
(gdb) detach<br />
<br />
The option bytes do not cover the Readout Protection (RDP), but the RDP is disabled anyhow...<br />
<br />
'''Error at loading a new image after removing RDP'''<br />
<br />
Error erasing flash with vFlashErase packet<br />
If this occurs powercycle the target (disconnect and reconnect the 3V3 connection), swd scan, attach and try loading the image again. Usually the reset of the RDP requires a flash erase (done by mon option erase) and reset.<br />
<br />
Probably this can also be done via gdb.<br />
<br />
==Clones==<br />
<br />
There are also some chinese clones out there. Some with the identical MCU, and some also with an other.<br />
<br />
See also https://github.com/blacksphere/blackmagic/issues/62<br />
<br />
===Red PCB===<br />
<br />
[[Image:stlinkv2_clone_red_front.jpg|250px]]<br />
[[Image:stlinkv2_clone_red_back.jpg|250px]]<br />
<br />
* STM32F103C8T6<br />
<br />
Programming header (1.27mm, populated on the images) from the Mini USB to the Pin header (right to left on the image), used for programming the onboard MCU.<br />
<br />
# SWDIO<br />
# GND<br />
# SWDCLK<br />
# 3V3 <br />
<br />
===Blue PCB===<br />
<br />
[[Image:stlinkv2_clone_blue_front.jpg|250px]]<br />
[[Image:stlinkv2_clone_blue_back.jpg|250px]]<br />
<br />
* STM32F103C8T6<br />
<br />
===Aluminium housing===<br />
<br />
[[Image:stlinkv2_clone_aluminium.jpg|250px]]<br />
[[Image:stlinkv2_clone_aluminium_front.jpg|250px]]<br />
[[Image:stlinkv2_clone_aluminium_back.jpg|250px]]<br />
<br />
* STM32F101C8T6<br />
<br />
To disassemble pull the aluminium housing towards the USB connector.<br />
<br />
<br />
[[Category:Firmware Flashing]] [[Category:Developer_Documentation]]</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=File:Stlink_clone_red_back.jpg&diff=19852File:Stlink clone red back.jpg2015-05-22T12:22:05Z<p>NeoFromMatrix: NeoFromMatrix moved page File:Stlink clone red back.jpg to File:Stlinkv2 clone red back.jpg</p>
<hr />
<div>#REDIRECT [[File:Stlinkv2 clone red back.jpg]]</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=File:Stlinkv2_clone_red_back.jpg&diff=19851File:Stlinkv2 clone red back.jpg2015-05-22T12:22:05Z<p>NeoFromMatrix: NeoFromMatrix moved page File:Stlink clone red back.jpg to File:Stlinkv2 clone red back.jpg</p>
<hr />
<div>STLink clone (red PCB) back</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=File:Red_clone_back.jpg&diff=19850File:Red clone back.jpg2015-05-22T12:18:32Z<p>NeoFromMatrix: NeoFromMatrix moved page File:Red clone back.jpg to File:Stlink clone red back.jpg</p>
<hr />
<div>#REDIRECT [[File:Stlink clone red back.jpg]]</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=File:Stlinkv2_clone_red_back.jpg&diff=19849File:Stlinkv2 clone red back.jpg2015-05-22T12:18:32Z<p>NeoFromMatrix: NeoFromMatrix moved page File:Red clone back.jpg to File:Stlink clone red back.jpg</p>
<hr />
<div>STLink clone (red PCB) back</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=File:Red_clone_front.jpg&diff=19848File:Red clone front.jpg2015-05-22T12:17:55Z<p>NeoFromMatrix: NeoFromMatrix moved page File:Red clone front.jpg to File:Stlinkv2 clone red front.jpg</p>
<hr />
<div>#REDIRECT [[File:Stlinkv2 clone red front.jpg]]</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=File:Stlinkv2_clone_red_front.jpg&diff=19847File:Stlinkv2 clone red front.jpg2015-05-22T12:17:55Z<p>NeoFromMatrix: NeoFromMatrix moved page File:Red clone front.jpg to File:Stlinkv2 clone red front.jpg</p>
<hr />
<div>STLink clone (red PCB) front</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=Openlog&diff=19846Openlog2015-05-19T20:05:46Z<p>NeoFromMatrix: typo</p>
<hr />
<div><categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Modules</categorytree><br />
<br />
In general [http://www.sparkfun.com/products/9530 OpenLog] is a Module from Sparkfun that contains an Atmega328P and a Micro-SD-Slot. It can handle FAT16 and FAT32 microSD cards up to 16GB. Once installed into the wiring (parallel to the dataradio) it records every message the UAS sends. That is very handy for using it as some kind of blackbox or for data-logging purposes if no Modem was involved. It is also nice for reconstructing what happened after a crash, since the radio-communication is gone, once the plane is near the ground. 2GB is enough to log a comlete season (several hundred flights).<br />
The general logging is done in two steps: First you record your log using the telemtry in transparent mode, with the openlog-module loaded. the normal paparazzi-protocal does not contain timestamps and the openlog-module adds timestamps to the datastream to have a reference for the time.<br />
Second the recorded logs are extracted from the SD-Card to the normal logfiles. For doing so, there is a tool calles openlog2tlm to convert the recorded files to the TLM-format of the SD-logger. Next the created TLM-file is added to the logs by sd2log. <br />
There is a helper-script that does this job.<br />
<br />
=== Hardware ===<br />
<br />
[[File:openlog.jpg|300px]]<br />
<br />
The OpenLog is simply connected to the TX-Line of the AP. Once the AP is powered, it starts to record.<br />
In general there is one Problem with the stock-firmware of the OpenLog. If it gets an escape-character (CTRL+Z) it switches into command-mode and stops logging. But the telemetry stream is nearly arbitrary. So we have to deactivate this feature, it isn't needed for our application at all. Therefore we have to reprogram the OpenLog. You need an AVR-programmer like the i.e. [http://www.hobbyking.com/hobbycity/store/uh_viewItem.asp?idProduct=21321 usbasp]. You have to wire the ISP to the accoring pins of the OpenLog. You need the avrdude package installed. <br />
<br />
First you need to checkout the modified OpenLog firmware on github:<br />
<br />
git clone https://github.com/chni/OpenLog.git -b OpenLog_V1_noescape<br />
<br />
then change to the directory where the hexfile is:<br />
<br />
cd OpenLog/Code<br />
<br />
The hexfile is contained by the directory, so you can flash it. <br />
<br />
You should power the OpenLog with the Programmer, not by the LPC in the same time. The programming is done by running<br />
<br />
avrdude -c usbasp -pm328p -U flash:w:openlog_noescape.hex -Ulfuse:w:0xff:m -Uhfuse:w:0xda:m -Uefuse:w:0x0:m<br />
<br />
After running this, the OpenLog has a custom firmware making it ignore the escape-characters.<br />
<br />
=== Software ===<br />
<br />
First of all the OpenLog needs to be configured. If it was powered one time without being configured, but with SD-Card plugged, it creates a file named CONFIG.txt or CONFIG.TXT (depends on the version of the firmware). You need to configure the Baudrate, it defaults to 9600-8-N1. In case you use 57600 Baud it should look like:<br />
{{Box Code|CONFIG.TXT|<br />
<source lang="xml"><br />
57600,26,3,0<br />
</source><br />
}}<br />
Furthermore you need to add the OpenLog-module to your airframe.<br />
{{Box Code|conf/airframes/yourairframe.xml|<br />
<source lang="xml"><br />
[...]<br />
<modules><br />
<load name="openlog.xml"/><br />
[...]<br />
</modules><br />
[...]<br />
</source><br />
}}<br />
Then compile, flash your AP and do your flight. Afterwards take the SD-Card from the logger and import the logs:<br />
<br />
christoph@christoph:~/paparazzi/aktueller$ sw/logalizer/getopenlog LOG00003.TXT <br />
now converting LOG00003.TXT to LOG00003.TXT.tlm<br />
The conversion from the logfile from the SD to TLM seems to be successful, 567 have been converted, 2 packages have been broken<br />
Renaming produced file ...<br />
12_06_17__01_59_45_SD.data file produced<br />
Looking for 4ae62580cb19d37d2b30aa8d31cc20dc conf...<br />
12_06_17__01_59_45_SD.log file produced<br />
12_06_17__01_59_45_SD.tlm file saved<br />
<br />
You can also do batch processing like:<br />
<br />
christoph@christoph:~/paparazzi/aktueller$ sw/logalizer/getopenlog /media/disk-1/LOG*<br />
<br />
In this case all logs will be imported.<br />
Afterwards you can find the logs as usual in var/logs/*_SD.log<br />
<br />
If someting goes wrong during the import have a close look to the error messages, since openlog2tlm tries to identify the most common problems.<br />
<br />
<br />
<br />
[[Category:Software]] [[Category:User_Documentation]] [[Category:Modules]]</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=Subsystems&diff=19845Subsystems2015-05-19T20:04:26Z<p>NeoFromMatrix: simplified table</p>
<hr />
<div><categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages hideprefix=always>Subsystems</categorytree><br />
<br />
Mostly a subsystem is a part offering a specific functionality with a<br />
defined interface and can have multiple different implementations. (See <tt>sw/airborne/subsystems/...</tt>)<br />
<br />
They are selected and configured with a <source lang="xml" enclose="none"><subsystem name="foo" type="bar"></source> in the [[Airframe_Configuration#Firmware_and_Hardware_definitions|firmware section of the airframe file]].<br />
<br />
All this does is basically include a makefile <tt>foo_bar.makefile</tt> that adds the respective sources and adds a few configuration options. (See <tt>conf/firmwares/subsystems/...</tt>)<br />
<br />
This makes it easier to put an airframe file together (they replace the old raw makefile section) and also allows us to change the code and move/rename files behind the scenes without breaking everyones airframe files.<br />
<br />
See [[FirmwareArchitecture]] for the differences to [[Modules]], as well as how to write a new subsystem.<br />
<br />
== Available Subsystems ==<br />
<br />
{| class="wikitable sortable" border="1"<br />
! Name !! Types !! Firmwares !! Architecture !! Description<br />
|-<br />
|[[Subsystem/gps|gps]]<br />
||<br />
* ublox<br />
* ublox_utm<br />
* nmea<br />
* mediatek_diy<br />
* skytraq<br />
* sirf<br />
|<br />
* all<br />
* fixedwing<br />
* all<br />
* fixedwing<br />
* rotorcraft<br />
* rotorcraft<br />
|<br />
* all<br />
| GPS drivers<br />
|-<br />
|[[Subsystem/imu|imu]]<br />
||<br />
* analog<br />
* apogee<br />
* aspirin_v1.0<br />
* aspirin_v1.5<br />
* aspirin_v2.1<br />
* aspirin_v2.2<br />
* aspirin_i2c_v1.0<br />
* aspirin_i2c_v1.5<br />
* aspirin2_i2c<br />
* b2_v1.0<br />
* b2_v1.1<br />
* b2_v1.2<br />
* drotek_10dof_v2<br />
* gl1<br />
* yai<br />
* krooz_sd<br />
* navgo<br />
* umarin<br />
* crista<br />
* crista_hmc5843<br />
* ppzuav<br />
|<br />
* all<br />
* all<br />
* all<br />
* all<br />
* all<br />
* all<br />
* all<br />
* all<br />
* all<br />
* all<br />
* all<br />
* all<br />
* all<br />
* all<br />
* all<br />
* all<br />
* all<br />
* all<br />
* rotorcraft<br />
* rotorcraft<br />
* fixedwing<br />
|<br />
* all<br />
* stm32f4<br />
* all<br />
* all<br />
* all<br />
* all<br />
* all<br />
* all<br />
* all<br />
* all<br />
* all<br />
* all<br />
* all<br />
* all<br />
* all<br />
* stm32f4<br />
* lpc21<br />
* lpc21<br />
* all<br />
* all<br />
* all<br />
|| IMU drivers<br />
Traditional IR sensors can be used for fixedwing<br />
<br />
but an IMU subsystem is not required<br />
|-<br />
|-<br />
|[[Subsystem/ahrs|ahrs]]<br />
||<br />
* int_cmpl_quat<br />
* float_cmpl<br />
* float_dcm <br />
* int_cmpl_euler<br />
* float_mlkf<br />
* infrared<br />
|<br />
* all<br />
|<br />
* all<br />
|| AHRS algorithms<br />
|-<br />
|[[Subsystem/ins|ins]]<br />
||<br />
* alt_float<br />
* gps_passthrough<br />
* xsens<br />
* xsens700<br />
* ''no_type''<br />
* hff<br />
* extended<br />
* ardrone2<br />
* float_invariant<br />
|<br />
* fixedwing<br />
* fixedwing<br />
* fixedwing<br />
* fixedwing<br />
* rotorcraft<br />
* rotorcraft<br />
* rotorcraft<br />
* rotorcraft<br />
* all (experimental, only tested on fw)<br />
|<br />
* all<br />
* all<br />
* all<br />
* all<br />
* all<br />
* all<br />
* all<br />
* all<br />
* mcu with fpu (e.g. stm32f4)<br />
|| INS algorithms<br />
Most of the INS filters are only providing position and speed, and they need to be used together with an AHRS filter for attitude<br />
<br />
Currently, only the experimental invariant filter is a full INS<br />
|-<br />
|[[Subsystem/radio_control|radio_control]]<br />
||<br />
* ppm<br />
* spektrum<br />
* datalink<br />
* superbitrf_rc<br />
* sbus<br />
* sbus_dual<br />
| <br />
* all<br />
| <br />
* all<br />
* STM32<br />
* all<br />
* STM32<br />
* all<br />
* all<br />
| Radio Control implementations<br />
|-<br />
|[[Subsystem/telemetry|telemetry]]<br />
||<br />
* transparent<br />
* transparent_usb<br />
* xbee_api<br />
* superbitrf<br />
| <br />
* all<br />
* all<br />
* all<br />
* rotorcraft<br />
|<br />
* all<br />
* LPC21xx<br />
* all<br />
* STM32<br />
| Telemetry implementations<br />
|-<br />
|[[Subsystem/actuators|actuators]]<br />
||<br />
* mkk<br />
* mkk_v2<br />
* asctec<br />
* asctec_v2<br />
* pwm<br />
* dualpwm<br />
* skiron<br />
| <br />
* all<br />
| <br />
* all<br />
| Drivers for different ESCs and servos<br />
|-<br />
|[[Subsystem/stabilization|stabilization]]<br />
||<br />
* int_quat<br />
* float_quat<br />
* euler<br />
| <br />
* rotorcraft<br />
| <br />
* all<br />
| Attitude control system for rotorcraft<br />
|}<br />
<br />
<br />
<br />
[[Category:Software]] [[Category:Developer_Documentation]] [[Category:Subsystems]]</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=Installation/FromScratch&diff=19844Installation/FromScratch2015-05-19T17:55:30Z<p>NeoFromMatrix: /* Archbang */</p>
<hr />
<div><categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Installation</categorytree><br />
__TOC__<br />
<br />
'''Users of recent Debian/Ubuntu distributions are advised to use the binary packages as described in [[Installation/Linux]].'''<br />
<br />
<span style="color:#FF0000">'''WARNING! Only use if you are proficient in working with Linux!'''</span><br />
<br />
== Intro ==<br />
<br />
Users of other Linux flavors or anyone needing manual control of each individual package can install them independently. <br/><br />
The list of dependencies of the Debian package is located in the [https://github.com/paparazzi/paparazzi-portability-support/blob/master/debian/paparazzi-dev/debian/control <tt>debian/control</tt>] file and may help users of other distributions.<br />
<br />
Some corresponding source tarballs can be downloaded from [https://launchpad.net/~paparazzi-uav/+archive/ppa/+packages paparazzi-uav ppa] on launchpad. (maybe building the packages from source is more reliable in view of dependencies)<br />
<br />
For distributions using RPM packaging, the [http://packages.debian.org/unstable/source/alien alien] tool can be used to convert a .deb package into a .rpm package.<br />
<br />
As with all Wiki pages, also this page is a work in progress. Try to be a big help to the Paparazzi project and improve this page whenever you can. If you have a distribution different from Ubuntu which doesn't satisfy any other dependency and have instructions about compiling it, packaging it, feel free to add any reference on how to do that on this wikipage.<br />
<br />
== Goal ==<br />
<br />
The goal of this page is to clarify about which version of each piece of software has to be compiled, where to find that software, patches needed to make it compile on Linux, maybe even FreeBSD or OSX.<br />
<br />
== Fedora 19 ==<br />
<br />
To build paparazzi-uav on Fedora 19, you must install the next packages from the official repository:<br />
* ocaml<br />
* ocaml-findlib<br />
* ocaml-xml-light<br />
* ocaml-ocamlnet<br />
* ocaml-lablgtk-devel<br />
* libxml2-devel<br />
* SDL-devel<br />
* libusb-devel<br />
<br />
Paparazzi-uav needs to include some ocaml headers when it compiles the simulator, then please be sure that they are included. If not, edit sw/simulator/Makefile and add:<br />
<br />
CAML_CFLAGS = -I/usr/lib64/ocaml<br />
<br />
The following packages must be built from source code (they are not included in the official repository): <br />
* ivy-c <br />
* ivy-ocaml <br />
<br />
Paparazzi-uav was successfully compiled using ivy-c 3.14 (downloaded from SVN repository, revision #3602) and ivy-ocaml 1.2. Please note that the ivy-c version is an unstable version!<br />
<br />
Additionally, you need install the next RPMs to build ivy-c:<br />
* pcre-devel<br />
* libXt-devel<br />
* tcl-devel<br />
* glib2-devel<br />
<br />
Don't forget to set the environment variable PKG_CONFIG before building ivy-ocaml, e.g:<br />
<br />
$ export PKG_CONFIG=/usr/local/lib/pkgconfig<br />
<br />
== Arch Linux ==<br />
<br />
This is probably a dirty hacked together (not realy according to "the Arch Way") install, but works on fresh installed Archbang.<br />
<br />
<br />
'''NOTE: following issues '''<br />
# This has been written for Archbang, although it should work on any Arch Linux based system, it has not been tested yet.<br />
# '''It seems that the error "unbound module GnoCanvas" can be resolved with installing conf-gnomecanvas2 over opam and lablgtk2 over yaourt?''' <br />
# why is there no symlink from liblglibivy.so.3 and liblglibivy.so.3 to libglibivy.so.3.15?<br />
<br />
<br />
1. Update the fresh installation<br />
# pacman -Syyu<br />
<br />
2. Install [https://www.archlinux.org/groups/x86_64/base-devel/ base-devel] (pacman build tools) and yajl (for yaourt) <br />
# pacman -S base-devel yajl<br />
<br />
3. Add "export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/" to your shell config file (mostly ~/.bashrc)<br />
$ echo 'export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/' >> ~/.bashrc<br />
<br />
4. Install yaourt (this tool can build and install packages from the AUR for you) <br/><br />
https://astrofloyd.wordpress.com/2015/01/17/installing-yaourt-on-arch-linux/<br />
<br />
5. Install general dependencies<br />
# pacman -S subversion git libusb pcre ocaml camlp4 tcl tk python python-pip libtool sdl glade<br />
(libusb, pcre, tcl, libtool, sdl might be already installed)<br />
<br />
6. Build Ivy-C from Source<br />
$ svn checkout https://svn.tls.cena.fr/svn/ivy/ivy-c/trunk /home/$USER/temp/ivy-c<br />
$ cd ivy-c/src<br />
$ make<br />
# sudo make install<br />
<br />
7. All the ivy libs are installed in ''/usr/local/lib64'' and not ''/usr/local/lib'' as the .pc files point to currently. <br/><br />
Change in the third line (libdir) in the ivy-c.pc, ivy-glib.pc and ivy-tcl.pc file from lib to lib64 and the fourth line (includedir) from include to include/Ivy.<br />
<br />
8. For libgivy, libivy and libtclivy (.so and .so.3 ending) is a link directing to the lib with .so.3.15 availaible, but not for libglibivy. <br/><br />
Create these links for libglibivy<br />
# ln -s /usr/local/lib64/libglibivy.so.3.15 /usr/local/lib64/libglibivy.so<br />
# ln -s /usr/local/lib64/libglibivy.so.3.15 /usr/local/lib64/libglibivy.so.3<br />
<br />
9. Install opam (OCaml packet manager) via yaourt<br />
$ yaourt -S opam <br />
<br />
10. Initialize opam<br />
$ opam init <br />
$ f<br />
$ ~/.bashrc<br />
$ echo 'eval `opam config env`' >> ~/.bashrc<br />
<br />
11. Install and pin lablgtk.2.16.0 (2.18.0 will not work)<br />
$ opam install -v lablgtk.2.16.0<br />
$ opam pin add lablgtk 2.16.0<br />
<br />
12. Install OCaml packets via opam<br />
$ opam install ocamlfind ocamlnet xml-light pcre ivy<br />
<br />
13. Install ivy-python via pip<br />
# pip install ivy-python<br />
<br />
14. Install the Toolchain for Paparazzi (e.g. [https://aur.archlinux.org/packages/gcc-arm-none-eabi-bin/ gcc-arm-none-eabi-bin] from the AUR)<br />
$pacman -S gcc-arm-none-eabi-bin<br />
15. Install flashing utilities if needed<br />
$ yaourt stlink-git dfu-util<br />
<br />
[[Installation#Getting_the_Source_Code|Download]] and [[Installation#Launching_the_Software|build Paparazzi]]<br />
<br />
== Installing the Cross compiler toolchain ==<br />
<br />
There are currently two different toolchains available that can be used on Linux based systems with Paparazzi. For more information see [[Installation/Linux#ARM_embedded_toolchain]]<br />
<br />
== Installing OCaml packages using OPAM ==<br />
<br />
One possibility to install and manage OCaml packages is [http://opam.ocamlpro.com/ OPAM (OCaml Package Manager)]:<br/><br />
'''Please first check the official [http://opam.ocaml.org/doc/Install.html OPAM install guide] for the simplest method.'''<br/><br />
To install it from the latest git tree run:<br />
<nowiki>git clone https://github.com/OCamlPro/opam.git</nowiki><br />
cd opam<br />
./configure && make<br />
sudo make install<br />
<br />
opam init<br />
eval `opam config env`<br />
<br />
Update your shell environment as per opam init's instructions. E.g. add to your ''~/.profile'':<br />
eval `opam config env`<br />
<br />
Build and install OCaml libs:<br />
opam install ocamlfind xml-light pcre ocamlnet<br />
opam install -v lablgtk<br />
<br />
== IVY ==<br />
<br />
IVY is a simple protocol and a set of open-source libraries and programs that allows applications to broadcast information through text messages, with a subscription mechanism based on regular expressions. The project can be found at: http://www.eei.cena.fr/products/ivy/ <br />
<br />
In the paparazzi project, Ivy is used to send telemetry data to where ever you want.<br />
<br />
NOTE: Do not confuse this IVY with the Apache Ivy project. <br />
<br />
=== Ivy-python ===<br />
<br />
The ivy-python package makes it possible to use the IVY libraries from within the Python programming language. The ivy-python package is architecture independent, so it can be downloaded from the Ubuntu or Debian paparazzi repository.<br />
<br />
The easiest way to instally it on non Debian based systems is using [https://pip.pypa.io/ pip] to install the [https://pypi.python.org/pypi/ivy-python ivy-python package] from [https://pypi.python.org/pypi PyPi - the Python Package Index].<br />
pip install ivy-python<br />
<br />
Or install from the source repository via <br />
<br />
git clone https://gitorious.org/ivybus/ivy-python.git<br />
cd ivy-python<br />
./setup.py install<br />
<br />
=== Ivy-c ===<br />
<br />
To be able to use ivy-c, the libraries need to be installed. <br />
<br />
Required packages (Debian based):<br />
* tk-dev<br />
* libpcre3-dev<br />
* libxt-dev<br />
* pkg-config<br />
* libglib2.0-dev<br />
<br />
Download source, compile and install libraries:<br />
<br />
# mkdir -p /opt/ivy-c <br />
# cd /opt/ivy-c<br />
# svn co https://svn.tls.cena.fr/svn/ivy/ivy-c/trunk<br />
# cd /opt/ivy-c/trunk/src<br />
# make<br />
# make install<br />
<br />
It is possible you get errors of the test module when compiling, just ignore the messages, it is not important for the Paparazzi project. Contact the IVY team to help them also to resolve also the testing makefile issue.<br />
<br />
==== troubleshooting ====<br />
<br />
Error message:<br />
gcc -c -O2 -Wall -Wshadow -fPIC -I/usr/include/tcl8.4 -DTCL_CHANNEL_INTEGRATION ivytcl.c<br />
ivytcl.c:28:17: fatal error: tcl.h: No such file or directory<br />
<br />
The Makefile cannot read the tcl-dev version you have installed and assumes that version 8.4 is installed, but can't find the appropriate folder.<br/><br />
Edit the line 57 of the Makefile from TCLVERS=8.4 according to your installed version, or just delete the 8.4, both work.<br />
<br />
<br />
Can't find 64bit libs:<br />
Your ivy libs were probably installed to /usr/local/lib64 and you have to make symbolic links so that they will be found:<br />
$ sudo ln -s /usr/local/lib64/libivy.so /usr/local/lib64/libivy.so.3 /usr/lib<br />
or <br />
sudo ln -s /usr/local/lib64/libivy.so /usr/local/lib64/libivy.so.3 /usr/local/lib<br />
<br />
<br />
If you get an error relating to ivytestready.c, make the following changes:<br />
mkdir /opt/ivy-c/trunk/tools/Ivy<br />
cd /opt/ivy-c/trunk/tools/Ivy<br />
cp ../../src/ivy.h .<br />
cp ../../src/ivyloop.h .<br />
cp ../../src/ivysocket.h .<br />
cp ../../src/timer.h .<br />
cd ~/develop/ivy-c/trunk/src<br />
make<br />
<br />
This copies files from the src directory to the Ivy folder in tools which did not appear after running svn above.<br />
<br />
=== Ivy-OCaml ===<br />
<br />
ivy-ocaml provides OCaml bindings for ivy-c and is needed for most of the ground segment agents that are written in OCaml like [[Server]] and [[GCS]].<br />
<br />
Download source, compile and install libraries:<br />
<br />
# mkdir -p /opt/ivy-ocaml<br />
# cd /opt/ivy-ocaml<br />
# svn co https://svn.tls.cena.fr/svn/ivy/ivy-ocaml/trunk<br />
# cd /opt/ivy-ocaml/trunk<br />
# make<br />
# make install<br />
<br />
==== ivy-ocaml via OPAM ====<br />
Or use OPAM: While the source repository and debian package is named ''ivy-ocaml'', in OPAM it is only named ''ivy'' (since it is obviously for OCaml).<br />
<br />
$ opam update<br />
$ opam install ivy<br />
<br />
== LPC21ISP ==<br />
<br />
lpc21isp is only needed to serially flash the LPC2148 based autopilots (e.g. [[Lpc21BootloaderUpload bootloader]] for tiny, twog, umarim). LPC21ISP is an in-circuit programming (ISP) tool for the microcontroller used on the Paparazzi autopilot boards. The lpc21isp project is hosted on sourceforge and one can find the source packages and information at http://sourceforge.net/projects/lpc21isp/ <br />
<br />
Get the SVN version via<br />
<br />
$ mkdir -p /opt/lpc21isp<br />
$ cd /opt/lpc21isp<br />
$ svn co https://lpc21isp.svn.sourceforge.net/svnroot/lpc21isp lpc21<br />
<br />
To compile go into the source directory and then do<br />
<br />
$ cd lpc21<br />
$ make -f Makefile clean all<br />
<br />
To install<br />
<br />
$ exportline="PATH=$PATH:/opt/lpc21isp"<br />
$ if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi<br />
$ source ~/.profile<br />
<br />
== Paparazzi-dev Debian/Ubuntu packages ==<br />
<br />
For Ubuntu users, you can install the following packages from standard repository. You can just copy the line(s) and paste into your terminal. But do not copy the $ sign, this symbol is just added on this page to show that it is to be pasted at a normal terminal prompt.<br />
<br />
=== Whole lot in one ===<br />
<br />
sudo apt-get install ocaml libcamlimages-ocaml liblablgtk2-ocaml-dev liblablgtk2-gl-ocaml-dev \<br />
liblablgtk2-gnome-ocaml-dev libxml-light-ocaml-dev libocamlnet-ocaml-dev libpcre-ocaml \<br />
libpcre-ocaml-dev libgnomecanvas2-0 libgnomecanvas2-dev libglade2-0 libglade2-dev make build-essential \<br />
git gnuplot boa m4 libtool libftdi-dev libmpfr-dev tcl8.5-dev xutils-dev<br />
<br />
=== Ocaml and libraries ===<br />
<br />
Ocaml, short for Objective Caml is the most popular variant of the Caml language. The Paparazzi Ground Control Station (GCS) and some of it's tools are crafted in this language.<br />
<br />
* ocaml, ocaml-camlimages-devel, ocaml-lablgtk2-devel, ocaml-xml-light-devel, ocamlnet-ocaml-devel<br />
<br />
$ sudo apt-get install ocaml libcamlimages-ocaml liblablgtk2-ocaml-dev liblablgtk2-gl-ocaml-dev \<br />
liblablgtk2-gnome-ocaml-dev libxml-light-ocaml-dev libocamlnet-ocaml-dev<br />
<br />
=== Gnome canvas Library ===<br />
<br />
The GnomeCanvas is an engine for structured graphics that offers a rich imaging model, high performance rendering, and a powerful, high level API. This widget can be used for flexible display of graphics and for creating interactive user interface elements.<br />
<br />
$ sudo apt-get install libgnomecanvas2-0 libgnomecanvas2-dev<br />
<br />
=== USB Library ===<br />
<br />
The libusb project aims to create a library for use by user level applications to access USB devices regardless of OS. [http://www.libusb.org]<br />
<br />
$ sudo apt-get install libusb-dev<br />
<br />
=== Ocaml PCRE ===<br />
<br />
This OCaml-library interfaces the PCRE (Perl-compatibility regular expressions) C library. it can be used for matching regular expressions which are written in Perl style.<br />
<br />
$ sudo apt-get install libpcre-ocaml libpcre-ocaml-dev<br />
<br />
=== Glade Library ===<br />
<br />
Libglade is a library that performs a similar job to the C source output routines in the GLADE user interface builder. Whereas GLADE's output routines create C source code that must be compiled, libglade builds the interface from an XML file (GLADE's save format) at runtime. This can allow modifying the user interface without recompiling.<br />
<br />
$ sudo apt-get install libglade2-0 libglade2-dev<br />
<br />
=== Tcl/Tk ===<br />
<br />
$ sudo apt-get install tcl-dev<br />
<br />
Also the some utils are required to compile and install Ivy.<br />
<br />
$ sudo apt-get install xutils-dev<br />
<br />
=== Make ===<br />
<br />
GNU Make is an utility which controls the generation of executables and other target files of a program from the program's source files. <br />
<br />
$ sudo apt-get install make<br />
<br />
=== Build essential ===<br />
<br />
$ sudo apt-get install build-essential<br />
<br />
=== Libtool ===<br />
<br />
GNU libtool is a generic library support script. Libtool hides the complexity of using shared libraries behind a consistent, portable interface. Creating the files for Paparazzi software building becomes less cumbersome by using this tool.<br />
<br />
$ sudo apt-get install libtool<br />
<br />
=== libpcre3-dev ===<br />
<br />
Required for compiling Ivy-C.<br />
<br />
$ apt-get install libpcre3-dev<br />
<br />
=== Git Client ===<br />
<br />
Git is a version control system. Version control systems allow many individuals to collaborate on the Paparazzi source code. This is needed to retrieve the latest sourcecode from various packages and Paparazzi sourcecode itself.<br />
<br />
$ sudo apt-get install git<br />
<br />
=== Subversion ===<br />
<br />
Version control system, required for cloning the ivy packages.<br />
<br />
$ apt-get install subversion<br />
<br />
=== GNU Plot ===<br />
<br />
A command-line driven interactive plotting program. Unknow if it is used<br />
<br />
$ sudo apt-get install gnuplot<br />
<br />
=== Meld ===<br />
<br />
Meld is a graphical front end to the diff program. It provides a side-by-side view of the differences between two files. It is used by the Paparazzi Center when configuration changes are not yet saved and the option comes along where one either can keep or view changes made in aircraft- and other configuration files.<br />
<br />
$ sudo apt-get install meld<br />
<br />
=== FTDI library ===<br />
<br />
libftdi is a library that talks to FTDI's 232 type chips, including the popular bitbang mode, using libusb. A library to be able to use with a debugging Autopilot hardware boards.<br />
<br />
$ sudo apt-get install libftdi-dev <br />
<br />
=== MPFR library ===<br />
<br />
The MPFR library is a C library for multiple-precision floating-point computations with correct rounding. MPFR is based on the GMP multiple-precision library. The main goal of MPFR is to provide a library for multiple-precision floating-point computation which is both efficient and has a well-defined semantics.<br />
<br />
$ sudo apt-get install libmpfr-dev<br />
<br />
=== ImageMagick ===<br />
<br />
ImageMagick is a software suite to create, edit, and compose bitmap images. It can read, convert and write images in a variety of formats. Use ImageMagick to translate, flip, mirror, rotate, scale, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves. Being able to modify image based map pictures is a feature that may come in handy one time.<br />
<br />
$ sudo apt-get install imagemagick<br />
<br />
=== Optional on an older OS ===<br />
<br />
If you have an older OS distribution it never hurts to install the following...<br />
<br />
$ sudo apt-get install libx11-6 libx11-dev texinfo libncurses5 libncursesw5 libncursesw5-dev zlibc<br />
<br />
== Paparazzi Main sourcecode ==<br />
<br />
See the main [[Installation#Getting_the_Source_Code]] page<br />
<br />
TIP: <br />
If you get the File "pprz.mli", line 149, characters 78-89: Error: Unbound type constructor Ivy.binding<br />
...this happens when IVY libraries are not yet installed. How to do this, read the part on installing IVY on this page<br />
<br />
<br />
== Useful links ==<br />
<br />
https://launchpad.net/gcc-arm-embedded/<br />
<br />
https://github.com/paparazzi/paparazzi-portability-support<br />
<br />
http://wiki.ubuntuusers.de/GNU_arm-toolchain<br />
<br />
http://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/ARM-Options.html#ARM-Options<br />
<br />
http://mcuprogramming.com/forum/arm/gnu-arm-toolchain-installer/<br />
<br />
http://www.ethernut.de/en/documents/cross-toolchain-osx.html<br />
<br />
http://www.hermann-uwe.de/blog/building-an-arm-cross-toolchain-with-binutils-gcc-newlib-and-gdb-from-source<br />
<br />
[[Category:Software]] [[Category:Developer_Documentation]] [[Category:Installation]]</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=Installation/FromScratch&diff=19842Installation/FromScratch2015-05-18T17:38:40Z<p>NeoFromMatrix: typo</p>
<hr />
<div><categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Installation</categorytree><br />
__TOC__<br />
<br />
'''Users of recent Debian/Ubuntu distributions are advised to use the binary packages as described in [[Installation/Linux]].'''<br />
<br />
<span style="color:#FF0000">'''WARNING! Only use if you are proficient in working with Linux!'''</span><br />
<br />
== Intro ==<br />
<br />
Users of other Linux flavors or anyone needing manual control of each individual package can install them independently. <br/><br />
The list of dependencies of the Debian package is located in the [https://github.com/paparazzi/paparazzi-portability-support/blob/master/debian/paparazzi-dev/debian/control <tt>debian/control</tt>] file and may help users of other distributions.<br />
<br />
Some corresponding source tarballs can be downloaded from [https://launchpad.net/~paparazzi-uav/+archive/ppa/+packages paparazzi-uav ppa] on launchpad. (maybe building the packages from source is more reliable in view of dependencies)<br />
<br />
For distributions using RPM packaging, the [http://packages.debian.org/unstable/source/alien alien] tool can be used to convert a .deb package into a .rpm package.<br />
<br />
As with all Wiki pages, also this page is a work in progress. Try to be a big help to the Paparazzi project and improve this page whenever you can. If you have a distribution different from Ubuntu which doesn't satisfy any other dependency and have instructions about compiling it, packaging it, feel free to add any reference on how to do that on this wikipage.<br />
<br />
== Goal ==<br />
<br />
The goal of this page is to clarify about which version of each piece of software has to be compiled, where to find that software, patches needed to make it compile on Linux, maybe even FreeBSD or OSX.<br />
<br />
== Fedora 19 ==<br />
<br />
To build paparazzi-uav on Fedora 19, you must install the next packages from the official repository:<br />
* ocaml<br />
* ocaml-findlib<br />
* ocaml-xml-light<br />
* ocaml-ocamlnet<br />
* ocaml-lablgtk-devel<br />
* libxml2-devel<br />
* SDL-devel<br />
* libusb-devel<br />
<br />
Paparazzi-uav needs to include some ocaml headers when it compiles the simulator, then please be sure that they are included. If not, edit sw/simulator/Makefile and add:<br />
<br />
CAML_CFLAGS = -I/usr/lib64/ocaml<br />
<br />
The following packages must be built from source code (they are not included in the official repository): <br />
* ivy-c <br />
* ivy-ocaml <br />
<br />
Paparazzi-uav was successfully compiled using ivy-c 3.14 (downloaded from SVN repository, revision #3602) and ivy-ocaml 1.2. Please note that the ivy-c version is an unstable version!<br />
<br />
Additionally, you need install the next RPMs to build ivy-c:<br />
* pcre-devel<br />
* libXt-devel<br />
* tcl-devel<br />
* glib2-devel<br />
<br />
Don't forget to set the environment variable PKG_CONFIG before building ivy-ocaml, e.g:<br />
<br />
$ export PKG_CONFIG=/usr/local/lib/pkgconfig<br />
<br />
== Archbang ==<br />
<br />
This is probably a dirty hacked together (not realy according to "the Arch Way") install, but works on fresh installed Archbang.<br />
<br />
<br />
'''NOTE: following issues '''<br />
# '''It seems that the error "unbound module GnoCanvas" can be resolved with installing conf-gnomecanvas2 over opam and lablgtk2 over yaourt?''' <br />
# why is there no symlink from liblglibivy.so.3 and liblglibivy.so.3 to libglibivy.so.3.15?<br />
<br />
<br />
1. Update the fresh installation<br />
# pacman -Syyu<br />
<br />
2. Install [https://www.archlinux.org/groups/x86_64/base-devel/ base-devel] (pacman build tools) and yajl (for yaourt) <br />
# pacman -S base-devel yajl<br />
<br />
3. Add "export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/" to your shell config file (mostly ~/.bashrc)<br />
$ echo 'export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/' >> ~/.bashrc<br />
<br />
4. Install yaourt (this tool can build and install packages from the AUR for you) <br/><br />
https://astrofloyd.wordpress.com/2015/01/17/installing-yaourt-on-arch-linux/<br />
<br />
5. Install general dependencies<br />
# pacman -S subversion git libusb pcre ocaml camlp4 tcl tk python python-pip libtool sdl glade<br />
(libusb, pcre, tcl, libtool, sdl might be already installed)<br />
<br />
6. Build Ivy-C from Source<br />
$ svn checkout https://svn.tls.cena.fr/svn/ivy/ivy-c/trunk /home/$USER/temp/ivy-c<br />
$ cd ivy-c/src<br />
$ make<br />
# sudo make install<br />
<br />
7. All the ivy libs are installed in ''/usr/local/lib64'' and not ''/usr/local/lib'' as the .pc files point to currently. <br/><br />
Change in the third line (libdir) in the ivy-c.pc, ivy-glib.pc and ivy-tcl.pc file from lib to lib64 and the fourth line (includedir) from include to include/Ivy.<br />
<br />
8. For libgivy, libivy and libtclivy (.so and .so.3 ending) is a link directing to the lib with .so.3.15 availaible, but not for libglibivy. <br/><br />
Create these links for libglibivy<br />
# ln -s /usr/local/lib64/libglibivy.so.3.15 /usr/local/lib64/libglibivy.so<br />
# ln -s /usr/local/lib64/libglibivy.so.3.15 /usr/local/lib64/libglibivy.so.3<br />
<br />
9. Install opam (OCaml packet manager) via yaourt<br />
$ yaourt -S opam <br />
<br />
10. Initialize opam<br />
$ opam init <br />
$ f<br />
$ ~/.bashrc<br />
$ echo 'eval `opam config env`' >> ~/.bashrc<br />
<br />
11. Install and pin lablgtk.2.16.0 (2.18.0 will not work)<br />
$ opam install -v lablgtk.2.16.0<br />
$ opam pin add lablgtk 2.16.0<br />
<br />
12. Install OCaml packets via opam<br />
$ opam install ocamlfind ocamlnet xml-light pcre ivy<br />
<br />
13. Install ivy-python via pip<br />
# pip install ivy-python<br />
<br />
14. Install the Toolchain for Paparazzi (e.g. [https://aur.archlinux.org/packages/gcc-arm-none-eabi-bin/ gcc-arm-none-eabi-bin] from the AUR)<br />
$pacman -S gcc-arm-none-eabi-bin<br />
15. Install flashing utilities if needed<br />
$ yaourt stlink-git dfu-util<br />
<br />
[[Installation#Getting_the_Source_Code|Download]] and [[Installation#Launching_the_Software|build Paparazzi]]<br />
<br />
== Installing the Cross compiler toolchain ==<br />
<br />
There are currently two different toolchains available that can be used on Linux based systems with Paparazzi. For more information see [[Installation/Linux#ARM_embedded_toolchain]]<br />
<br />
== Installing OCaml packages using OPAM ==<br />
<br />
One possibility to install and manage OCaml packages is [http://opam.ocamlpro.com/ OPAM (OCaml Package Manager)]:<br/><br />
'''Please first check the official [http://opam.ocaml.org/doc/Install.html OPAM install guide] for the simplest method.'''<br/><br />
To install it from the latest git tree run:<br />
<nowiki>git clone https://github.com/OCamlPro/opam.git</nowiki><br />
cd opam<br />
./configure && make<br />
sudo make install<br />
<br />
opam init<br />
eval `opam config env`<br />
<br />
Update your shell environment as per opam init's instructions. E.g. add to your ''~/.profile'':<br />
eval `opam config env`<br />
<br />
Build and install OCaml libs:<br />
opam install ocamlfind xml-light pcre ocamlnet<br />
opam install -v lablgtk<br />
<br />
== IVY ==<br />
<br />
IVY is a simple protocol and a set of open-source libraries and programs that allows applications to broadcast information through text messages, with a subscription mechanism based on regular expressions. The project can be found at: http://www.eei.cena.fr/products/ivy/ <br />
<br />
In the paparazzi project, Ivy is used to send telemetry data to where ever you want.<br />
<br />
NOTE: Do not confuse this IVY with the Apache Ivy project. <br />
<br />
=== Ivy-python ===<br />
<br />
The ivy-python package makes it possible to use the IVY libraries from within the Python programming language. The ivy-python package is architecture independent, so it can be downloaded from the Ubuntu or Debian paparazzi repository.<br />
<br />
The easiest way to instally it on non Debian based systems is using [https://pip.pypa.io/ pip] to install the [https://pypi.python.org/pypi/ivy-python ivy-python package] from [https://pypi.python.org/pypi PyPi - the Python Package Index].<br />
pip install ivy-python<br />
<br />
Or install from the source repository via <br />
<br />
git clone https://gitorious.org/ivybus/ivy-python.git<br />
cd ivy-python<br />
./setup.py install<br />
<br />
=== Ivy-c ===<br />
<br />
To be able to use ivy-c, the libraries need to be installed. <br />
<br />
Required packages (Debian based):<br />
* tk-dev<br />
* libpcre3-dev<br />
* libxt-dev<br />
* pkg-config<br />
* libglib2.0-dev<br />
<br />
Download source, compile and install libraries:<br />
<br />
# mkdir -p /opt/ivy-c <br />
# cd /opt/ivy-c<br />
# svn co https://svn.tls.cena.fr/svn/ivy/ivy-c/trunk<br />
# cd /opt/ivy-c/trunk/src<br />
# make<br />
# make install<br />
<br />
It is possible you get errors of the test module when compiling, just ignore the messages, it is not important for the Paparazzi project. Contact the IVY team to help them also to resolve also the testing makefile issue.<br />
<br />
==== troubleshooting ====<br />
<br />
Error message:<br />
gcc -c -O2 -Wall -Wshadow -fPIC -I/usr/include/tcl8.4 -DTCL_CHANNEL_INTEGRATION ivytcl.c<br />
ivytcl.c:28:17: fatal error: tcl.h: No such file or directory<br />
<br />
The Makefile cannot read the tcl-dev version you have installed and assumes that version 8.4 is installed, but can't find the appropriate folder.<br/><br />
Edit the line 57 of the Makefile from TCLVERS=8.4 according to your installed version, or just delete the 8.4, both work.<br />
<br />
<br />
Can't find 64bit libs:<br />
Your ivy libs were probably installed to /usr/local/lib64 and you have to make symbolic links so that they will be found:<br />
$ sudo ln -s /usr/local/lib64/libivy.so /usr/local/lib64/libivy.so.3 /usr/lib<br />
or <br />
sudo ln -s /usr/local/lib64/libivy.so /usr/local/lib64/libivy.so.3 /usr/local/lib<br />
<br />
<br />
If you get an error relating to ivytestready.c, make the following changes:<br />
mkdir /opt/ivy-c/trunk/tools/Ivy<br />
cd /opt/ivy-c/trunk/tools/Ivy<br />
cp ../../src/ivy.h .<br />
cp ../../src/ivyloop.h .<br />
cp ../../src/ivysocket.h .<br />
cp ../../src/timer.h .<br />
cd ~/develop/ivy-c/trunk/src<br />
make<br />
<br />
This copies files from the src directory to the Ivy folder in tools which did not appear after running svn above.<br />
<br />
=== Ivy-OCaml ===<br />
<br />
ivy-ocaml provides OCaml bindings for ivy-c and is needed for most of the ground segment agents that are written in OCaml like [[Server]] and [[GCS]].<br />
<br />
Download source, compile and install libraries:<br />
<br />
# mkdir -p /opt/ivy-ocaml<br />
# cd /opt/ivy-ocaml<br />
# svn co https://svn.tls.cena.fr/svn/ivy/ivy-ocaml/trunk<br />
# cd /opt/ivy-ocaml/trunk<br />
# make<br />
# make install<br />
<br />
==== ivy-ocaml via OPAM ====<br />
Or use OPAM: While the source repository and debian package is named ''ivy-ocaml'', in OPAM it is only named ''ivy'' (since it is obviously for OCaml).<br />
<br />
$ opam update<br />
$ opam install ivy<br />
<br />
== LPC21ISP ==<br />
<br />
lpc21isp is only needed to serially flash the LPC2148 based autopilots (e.g. [[Lpc21BootloaderUpload bootloader]] for tiny, twog, umarim). LPC21ISP is an in-circuit programming (ISP) tool for the microcontroller used on the Paparazzi autopilot boards. The lpc21isp project is hosted on sourceforge and one can find the source packages and information at http://sourceforge.net/projects/lpc21isp/ <br />
<br />
Get the SVN version via<br />
<br />
$ mkdir -p /opt/lpc21isp<br />
$ cd /opt/lpc21isp<br />
$ svn co https://lpc21isp.svn.sourceforge.net/svnroot/lpc21isp lpc21<br />
<br />
To compile go into the source directory and then do<br />
<br />
$ cd lpc21<br />
$ make -f Makefile clean all<br />
<br />
To install<br />
<br />
$ exportline="PATH=$PATH:/opt/lpc21isp"<br />
$ if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi<br />
$ source ~/.profile<br />
<br />
== Paparazzi-dev Debian/Ubuntu packages ==<br />
<br />
For Ubuntu users, you can install the following packages from standard repository. You can just copy the line(s) and paste into your terminal. But do not copy the $ sign, this symbol is just added on this page to show that it is to be pasted at a normal terminal prompt.<br />
<br />
=== Whole lot in one ===<br />
<br />
sudo apt-get install ocaml libcamlimages-ocaml liblablgtk2-ocaml-dev liblablgtk2-gl-ocaml-dev \<br />
liblablgtk2-gnome-ocaml-dev libxml-light-ocaml-dev libocamlnet-ocaml-dev libpcre-ocaml \<br />
libpcre-ocaml-dev libgnomecanvas2-0 libgnomecanvas2-dev libglade2-0 libglade2-dev make build-essential \<br />
git gnuplot boa m4 libtool libftdi-dev libmpfr-dev tcl8.5-dev xutils-dev<br />
<br />
=== Ocaml and libraries ===<br />
<br />
Ocaml, short for Objective Caml is the most popular variant of the Caml language. The Paparazzi Ground Control Station (GCS) and some of it's tools are crafted in this language.<br />
<br />
* ocaml, ocaml-camlimages-devel, ocaml-lablgtk2-devel, ocaml-xml-light-devel, ocamlnet-ocaml-devel<br />
<br />
$ sudo apt-get install ocaml libcamlimages-ocaml liblablgtk2-ocaml-dev liblablgtk2-gl-ocaml-dev \<br />
liblablgtk2-gnome-ocaml-dev libxml-light-ocaml-dev libocamlnet-ocaml-dev<br />
<br />
=== Gnome canvas Library ===<br />
<br />
The GnomeCanvas is an engine for structured graphics that offers a rich imaging model, high performance rendering, and a powerful, high level API. This widget can be used for flexible display of graphics and for creating interactive user interface elements.<br />
<br />
$ sudo apt-get install libgnomecanvas2-0 libgnomecanvas2-dev<br />
<br />
=== USB Library ===<br />
<br />
The libusb project aims to create a library for use by user level applications to access USB devices regardless of OS. [http://www.libusb.org]<br />
<br />
$ sudo apt-get install libusb-dev<br />
<br />
=== Ocaml PCRE ===<br />
<br />
This OCaml-library interfaces the PCRE (Perl-compatibility regular expressions) C library. it can be used for matching regular expressions which are written in Perl style.<br />
<br />
$ sudo apt-get install libpcre-ocaml libpcre-ocaml-dev<br />
<br />
=== Glade Library ===<br />
<br />
Libglade is a library that performs a similar job to the C source output routines in the GLADE user interface builder. Whereas GLADE's output routines create C source code that must be compiled, libglade builds the interface from an XML file (GLADE's save format) at runtime. This can allow modifying the user interface without recompiling.<br />
<br />
$ sudo apt-get install libglade2-0 libglade2-dev<br />
<br />
=== Tcl/Tk ===<br />
<br />
$ sudo apt-get install tcl-dev<br />
<br />
Also the some utils are required to compile and install Ivy.<br />
<br />
$ sudo apt-get install xutils-dev<br />
<br />
=== Make ===<br />
<br />
GNU Make is an utility which controls the generation of executables and other target files of a program from the program's source files. <br />
<br />
$ sudo apt-get install make<br />
<br />
=== Build essential ===<br />
<br />
$ sudo apt-get install build-essential<br />
<br />
=== Libtool ===<br />
<br />
GNU libtool is a generic library support script. Libtool hides the complexity of using shared libraries behind a consistent, portable interface. Creating the files for Paparazzi software building becomes less cumbersome by using this tool.<br />
<br />
$ sudo apt-get install libtool<br />
<br />
=== libpcre3-dev ===<br />
<br />
Required for compiling Ivy-C.<br />
<br />
$ apt-get install libpcre3-dev<br />
<br />
=== Git Client ===<br />
<br />
Git is a version control system. Version control systems allow many individuals to collaborate on the Paparazzi source code. This is needed to retrieve the latest sourcecode from various packages and Paparazzi sourcecode itself.<br />
<br />
$ sudo apt-get install git<br />
<br />
=== Subversion ===<br />
<br />
Version control system, required for cloning the ivy packages.<br />
<br />
$ apt-get install subversion<br />
<br />
=== GNU Plot ===<br />
<br />
A command-line driven interactive plotting program. Unknow if it is used<br />
<br />
$ sudo apt-get install gnuplot<br />
<br />
=== Meld ===<br />
<br />
Meld is a graphical front end to the diff program. It provides a side-by-side view of the differences between two files. It is used by the Paparazzi Center when configuration changes are not yet saved and the option comes along where one either can keep or view changes made in aircraft- and other configuration files.<br />
<br />
$ sudo apt-get install meld<br />
<br />
=== FTDI library ===<br />
<br />
libftdi is a library that talks to FTDI's 232 type chips, including the popular bitbang mode, using libusb. A library to be able to use with a debugging Autopilot hardware boards.<br />
<br />
$ sudo apt-get install libftdi-dev <br />
<br />
=== MPFR library ===<br />
<br />
The MPFR library is a C library for multiple-precision floating-point computations with correct rounding. MPFR is based on the GMP multiple-precision library. The main goal of MPFR is to provide a library for multiple-precision floating-point computation which is both efficient and has a well-defined semantics.<br />
<br />
$ sudo apt-get install libmpfr-dev<br />
<br />
=== ImageMagick ===<br />
<br />
ImageMagick is a software suite to create, edit, and compose bitmap images. It can read, convert and write images in a variety of formats. Use ImageMagick to translate, flip, mirror, rotate, scale, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves. Being able to modify image based map pictures is a feature that may come in handy one time.<br />
<br />
$ sudo apt-get install imagemagick<br />
<br />
=== Optional on an older OS ===<br />
<br />
If you have an older OS distribution it never hurts to install the following...<br />
<br />
$ sudo apt-get install libx11-6 libx11-dev texinfo libncurses5 libncursesw5 libncursesw5-dev zlibc<br />
<br />
== Paparazzi Main sourcecode ==<br />
<br />
See the main [[Installation#Getting_the_Source_Code]] page<br />
<br />
TIP: <br />
If you get the File "pprz.mli", line 149, characters 78-89: Error: Unbound type constructor Ivy.binding<br />
...this happens when IVY libraries are not yet installed. How to do this, read the part on installing IVY on this page<br />
<br />
<br />
== Useful links ==<br />
<br />
https://launchpad.net/gcc-arm-embedded/<br />
<br />
https://github.com/paparazzi/paparazzi-portability-support<br />
<br />
http://wiki.ubuntuusers.de/GNU_arm-toolchain<br />
<br />
http://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/ARM-Options.html#ARM-Options<br />
<br />
http://mcuprogramming.com/forum/arm/gnu-arm-toolchain-installer/<br />
<br />
http://www.ethernut.de/en/documents/cross-toolchain-osx.html<br />
<br />
http://www.hermann-uwe.de/blog/building-an-arm-cross-toolchain-with-binutils-gcc-newlib-and-gdb-from-source<br />
<br />
[[Category:Software]] [[Category:Developer_Documentation]] [[Category:Installation]]</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=Installation/FromScratch&diff=19841Installation/FromScratch2015-05-17T19:30:56Z<p>NeoFromMatrix: archbang linux installation instructions</p>
<hr />
<div><categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Installation</categorytree><br />
__TOC__<br />
<br />
'''Users of recent Debian/Ubuntu distributions are advised to use the binary packages as described in [[Installation/Linux]].'''<br />
<br />
<span style="color:#FF0000">'''WARNING! Only use if you are proficient in working with Linux!'''</span><br />
<br />
== Intro ==<br />
<br />
Users of other Linux flavors or anyone needing manual control of each individual package can install them independently. <br/><br />
The list of dependencies of the Debian package is located in the [https://github.com/paparazzi/paparazzi-portability-support/blob/master/debian/paparazzi-dev/debian/control <tt>debian/control</tt>] file and may help users of other distributions.<br />
<br />
Some corresponding source tarballs can be downloaded from [https://launchpad.net/~paparazzi-uav/+archive/ppa/+packages paparazzi-uav ppa] on launchpad. (maybe building the packages from source is more reliable in view of dependencies)<br />
<br />
For distributions using RPM packaging, the [http://packages.debian.org/unstable/source/alien alien] tool can be used to convert a .deb package into a .rpm package.<br />
<br />
As with all Wiki pages, also this page is a work in progress. Try to be a big help to the Paparazzi project and improve this page whenever you can. If you have a distribution different from Ubuntu which doesn't satisfy any other dependency and have instructions about compiling it, packaging it, feel free to add any reference on how to do that on this wikipage.<br />
<br />
== Goal ==<br />
<br />
The goal of this page is to clarify about which version of each piece of software has to be compiled, where to find that software, patches needed to make it compile on Linux, maybe even FreeBSD or OSX.<br />
<br />
== Fedora 19 ==<br />
<br />
To build paparazzi-uav on Fedora 19, you must install the next packages from the official repository:<br />
* ocaml<br />
* ocaml-findlib<br />
* ocaml-xml-light<br />
* ocaml-ocamlnet<br />
* ocaml-lablgtk-devel<br />
* libxml2-devel<br />
* SDL-devel<br />
* libusb-devel<br />
<br />
Paparazzi-uav needs to include some ocaml headers when it compiles the simulator, then please be sure that they are included. If not, edit sw/simulator/Makefile and add:<br />
<br />
CAML_CFLAGS = -I/usr/lib64/ocaml<br />
<br />
The following packages must be built from source code (they are not included in the official repository): <br />
* ivy-c <br />
* ivy-ocaml <br />
<br />
Paparazzi-uav was successfully compiled using ivy-c 3.14 (downloaded from SVN repository, revision #3602) and ivy-ocaml 1.2. Please note that the ivy-c version is an unstable version!<br />
<br />
Additionally, you need install the next RPMs to build ivy-c:<br />
* pcre-devel<br />
* libXt-devel<br />
* tcl-devel<br />
* glib2-devel<br />
<br />
Don't forget to set the environment variable PKG_CONFIG before building ivy-ocaml, e.g:<br />
<br />
$ export PKG_CONFIG=/usr/local/lib/pkgconfig<br />
<br />
== Archbang ==<br />
<br />
This is probably a dirty hacked together (not realy according to "the Arch Way") install, but works on fresh installed Archbang.<br />
<br />
<br />
'''NOTE: following issues '''<br />
# '''It seems that the error "unbound module GnoCanvas" can be resolved with installing conf-gnomecanvas2 over opam and lablgtk2 over yaourt?''' <br />
# why is there no symlink from liblglibivy.so.3 and liblglibivy.so.3 to libglibivy.so.3.15?<br />
<br />
<br />
1. Update the fresh installation<br />
# pacman -Syyu<br />
<br />
2. Install [https://www.archlinux.org/groups/x86_64/base-devel/ base-devel] (pacman build tools) and yajl (for yaourt) <br />
# pacman -S base-devel yajl<br />
<br />
3. Add "export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/" to your shell config file (mostly ~/.bashrc)<br />
$ echo 'export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/' >> ~/.bashrc<br />
<br />
4. Install yaourt (this tool can build and install packages from the AUR for you) <br/><br />
https://astrofloyd.wordpress.com/2015/01/17/installing-yaourt-on-arch-linux/<br />
<br />
5. Install general dependencies<br />
# pacman -S subversion git libusb pcre ocaml camlp4 tcl tk python python-pip libtool sdl glade<br />
(libusb, pcre, tcl, libtool, sdl might be already installed)<br />
<br />
6. Build Ivy-C from Source<br />
$ svn checkout https://svn.tls.cena.fr/svn/ivy/ivy-c/trunk /home/$USER/temp/ivy-c<br />
$ cd ivy-c/src<br />
$ make<br />
# sudo make install<br />
<br />
7. All the ivy libs are installed in ''/usr/local/lib64'' and not ''/usr/local/lib'' as the .pc files point to currently. <br/><br />
Change in the third line (libdir) in the ivy-c.pc, ivy-glib.pc and ivy-tcl.pc file from lib to lib64 and the fourth line (includedir) from include to include/Ivy.<br />
<br />
8. For libgivy, libivy and libtclivy (.so and .so.3 ending) is a link directing to the lib with .so.3.15 availaible, but not for libglibivy. <br/><br />
Create these links for libglibivy<br />
# ln -s /usr/local/lib64/libglibivy.so.3.15 /usr/local/lib64/libglibivy.so<br />
# ln -s /usr/local/lib64/libglibivy.so.3.15 /usr/local/lib64/libglibivy.so.3<br />
<br />
9. Install opam (OCaml packet manager) via yaourt<br />
$ yaourt -S opam <br />
<br />
10. Initialize opam<br />
$ opam init <br />
$ f<br />
$ ~/.bashrc<br />
$ echo 'eval `opam config env`' >> ~/.bashrc<br />
<br />
11. Install and pin lablgtk.2.16.0 (2.18.0 will not work)<br />
$ opam install -v lablgtk.2.16.0.<br />
$ opam pin add lablgtk 2.16.0<br />
<br />
12. Install OCaml packets via opam<br />
$ opam install ocamlfind ocamlnet xml-light pcre ivy<br />
<br />
13. Install ivy-python via pip<br />
# pip install ivy-python<br />
<br />
14. Install the Toolchain for Paparazzi (e.g. [https://aur.archlinux.org/packages/gcc-arm-none-eabi-bin/ gcc-arm-none-eabi-bin] from the AUR)<br />
$pacman -S gcc-arm-none-eabi-bin<br />
15. Install flashing utilities if needed<br />
$ yaourt stlink-git dfu-util<br />
<br />
[[Installation#Getting_the_Source_Code|Download]] and [[Installation#Launching_the_Software|build Paparazzi]]<br />
<br />
== Installing the Cross compiler toolchain ==<br />
<br />
There are currently two different toolchains available that can be used on Linux based systems with Paparazzi. For more information see [[Installation/Linux#ARM_embedded_toolchain]]<br />
<br />
== Installing OCaml packages using OPAM ==<br />
<br />
One possibility to install and manage OCaml packages is [http://opam.ocamlpro.com/ OPAM (OCaml Package Manager)]:<br/><br />
'''Please first check the official [http://opam.ocaml.org/doc/Install.html OPAM install guide] for the simplest method.'''<br/><br />
To install it from the latest git tree run:<br />
<nowiki>git clone https://github.com/OCamlPro/opam.git</nowiki><br />
cd opam<br />
./configure && make<br />
sudo make install<br />
<br />
opam init<br />
eval `opam config env`<br />
<br />
Update your shell environment as per opam init's instructions. E.g. add to your ''~/.profile'':<br />
eval `opam config env`<br />
<br />
Build and install OCaml libs:<br />
opam install ocamlfind xml-light pcre ocamlnet<br />
opam install -v lablgtk<br />
<br />
== IVY ==<br />
<br />
IVY is a simple protocol and a set of open-source libraries and programs that allows applications to broadcast information through text messages, with a subscription mechanism based on regular expressions. The project can be found at: http://www.eei.cena.fr/products/ivy/ <br />
<br />
In the paparazzi project, Ivy is used to send telemetry data to where ever you want.<br />
<br />
NOTE: Do not confuse this IVY with the Apache Ivy project. <br />
<br />
=== Ivy-python ===<br />
<br />
The ivy-python package makes it possible to use the IVY libraries from within the Python programming language. The ivy-python package is architecture independent, so it can be downloaded from the Ubuntu or Debian paparazzi repository.<br />
<br />
The easiest way to instally it on non Debian based systems is using [https://pip.pypa.io/ pip] to install the [https://pypi.python.org/pypi/ivy-python ivy-python package] from [https://pypi.python.org/pypi PyPi - the Python Package Index].<br />
pip install ivy-python<br />
<br />
Or install from the source repository via <br />
<br />
git clone https://gitorious.org/ivybus/ivy-python.git<br />
cd ivy-python<br />
./setup.py install<br />
<br />
=== Ivy-c ===<br />
<br />
To be able to use ivy-c, the libraries need to be installed. <br />
<br />
Required packages (Debian based):<br />
* tk-dev<br />
* libpcre3-dev<br />
* libxt-dev<br />
* pkg-config<br />
* libglib2.0-dev<br />
<br />
Download source, compile and install libraries:<br />
<br />
# mkdir -p /opt/ivy-c <br />
# cd /opt/ivy-c<br />
# svn co https://svn.tls.cena.fr/svn/ivy/ivy-c/trunk<br />
# cd /opt/ivy-c/trunk/src<br />
# make<br />
# make install<br />
<br />
It is possible you get errors of the test module when compiling, just ignore the messages, it is not important for the Paparazzi project. Contact the IVY team to help them also to resolve also the testing makefile issue.<br />
<br />
==== troubleshooting ====<br />
<br />
Error message:<br />
gcc -c -O2 -Wall -Wshadow -fPIC -I/usr/include/tcl8.4 -DTCL_CHANNEL_INTEGRATION ivytcl.c<br />
ivytcl.c:28:17: fatal error: tcl.h: No such file or directory<br />
<br />
The Makefile cannot read the tcl-dev version you have installed and assumes that version 8.4 is installed, but can't find the appropriate folder.<br/><br />
Edit the line 57 of the Makefile from TCLVERS=8.4 according to your installed version, or just delete the 8.4, both work.<br />
<br />
<br />
Can't find 64bit libs:<br />
Your ivy libs were probably installed to /usr/local/lib64 and you have to make symbolic links so that they will be found:<br />
$ sudo ln -s /usr/local/lib64/libivy.so /usr/local/lib64/libivy.so.3 /usr/lib<br />
or <br />
sudo ln -s /usr/local/lib64/libivy.so /usr/local/lib64/libivy.so.3 /usr/local/lib<br />
<br />
<br />
If you get an error relating to ivytestready.c, make the following changes:<br />
mkdir /opt/ivy-c/trunk/tools/Ivy<br />
cd /opt/ivy-c/trunk/tools/Ivy<br />
cp ../../src/ivy.h .<br />
cp ../../src/ivyloop.h .<br />
cp ../../src/ivysocket.h .<br />
cp ../../src/timer.h .<br />
cd ~/develop/ivy-c/trunk/src<br />
make<br />
<br />
This copies files from the src directory to the Ivy folder in tools which did not appear after running svn above.<br />
<br />
=== Ivy-OCaml ===<br />
<br />
ivy-ocaml provides OCaml bindings for ivy-c and is needed for most of the ground segment agents that are written in OCaml like [[Server]] and [[GCS]].<br />
<br />
Download source, compile and install libraries:<br />
<br />
# mkdir -p /opt/ivy-ocaml<br />
# cd /opt/ivy-ocaml<br />
# svn co https://svn.tls.cena.fr/svn/ivy/ivy-ocaml/trunk<br />
# cd /opt/ivy-ocaml/trunk<br />
# make<br />
# make install<br />
<br />
==== ivy-ocaml via OPAM ====<br />
Or use OPAM: While the source repository and debian package is named ''ivy-ocaml'', in OPAM it is only named ''ivy'' (since it is obviously for OCaml).<br />
<br />
$ opam update<br />
$ opam install ivy<br />
<br />
== LPC21ISP ==<br />
<br />
lpc21isp is only needed to serially flash the LPC2148 based autopilots (e.g. [[Lpc21BootloaderUpload bootloader]] for tiny, twog, umarim). LPC21ISP is an in-circuit programming (ISP) tool for the microcontroller used on the Paparazzi autopilot boards. The lpc21isp project is hosted on sourceforge and one can find the source packages and information at http://sourceforge.net/projects/lpc21isp/ <br />
<br />
Get the SVN version via<br />
<br />
$ mkdir -p /opt/lpc21isp<br />
$ cd /opt/lpc21isp<br />
$ svn co https://lpc21isp.svn.sourceforge.net/svnroot/lpc21isp lpc21<br />
<br />
To compile go into the source directory and then do<br />
<br />
$ cd lpc21<br />
$ make -f Makefile clean all<br />
<br />
To install<br />
<br />
$ exportline="PATH=$PATH:/opt/lpc21isp"<br />
$ if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi<br />
$ source ~/.profile<br />
<br />
== Paparazzi-dev Debian/Ubuntu packages ==<br />
<br />
For Ubuntu users, you can install the following packages from standard repository. You can just copy the line(s) and paste into your terminal. But do not copy the $ sign, this symbol is just added on this page to show that it is to be pasted at a normal terminal prompt.<br />
<br />
=== Whole lot in one ===<br />
<br />
sudo apt-get install ocaml libcamlimages-ocaml liblablgtk2-ocaml-dev liblablgtk2-gl-ocaml-dev \<br />
liblablgtk2-gnome-ocaml-dev libxml-light-ocaml-dev libocamlnet-ocaml-dev libpcre-ocaml \<br />
libpcre-ocaml-dev libgnomecanvas2-0 libgnomecanvas2-dev libglade2-0 libglade2-dev make build-essential \<br />
git gnuplot boa m4 libtool libftdi-dev libmpfr-dev tcl8.5-dev xutils-dev<br />
<br />
=== Ocaml and libraries ===<br />
<br />
Ocaml, short for Objective Caml is the most popular variant of the Caml language. The Paparazzi Ground Control Station (GCS) and some of it's tools are crafted in this language.<br />
<br />
* ocaml, ocaml-camlimages-devel, ocaml-lablgtk2-devel, ocaml-xml-light-devel, ocamlnet-ocaml-devel<br />
<br />
$ sudo apt-get install ocaml libcamlimages-ocaml liblablgtk2-ocaml-dev liblablgtk2-gl-ocaml-dev \<br />
liblablgtk2-gnome-ocaml-dev libxml-light-ocaml-dev libocamlnet-ocaml-dev<br />
<br />
=== Gnome canvas Library ===<br />
<br />
The GnomeCanvas is an engine for structured graphics that offers a rich imaging model, high performance rendering, and a powerful, high level API. This widget can be used for flexible display of graphics and for creating interactive user interface elements.<br />
<br />
$ sudo apt-get install libgnomecanvas2-0 libgnomecanvas2-dev<br />
<br />
=== USB Library ===<br />
<br />
The libusb project aims to create a library for use by user level applications to access USB devices regardless of OS. [http://www.libusb.org]<br />
<br />
$ sudo apt-get install libusb-dev<br />
<br />
=== Ocaml PCRE ===<br />
<br />
This OCaml-library interfaces the PCRE (Perl-compatibility regular expressions) C library. it can be used for matching regular expressions which are written in Perl style.<br />
<br />
$ sudo apt-get install libpcre-ocaml libpcre-ocaml-dev<br />
<br />
=== Glade Library ===<br />
<br />
Libglade is a library that performs a similar job to the C source output routines in the GLADE user interface builder. Whereas GLADE's output routines create C source code that must be compiled, libglade builds the interface from an XML file (GLADE's save format) at runtime. This can allow modifying the user interface without recompiling.<br />
<br />
$ sudo apt-get install libglade2-0 libglade2-dev<br />
<br />
=== Tcl/Tk ===<br />
<br />
$ sudo apt-get install tcl-dev<br />
<br />
Also the some utils are required to compile and install Ivy.<br />
<br />
$ sudo apt-get install xutils-dev<br />
<br />
=== Make ===<br />
<br />
GNU Make is an utility which controls the generation of executables and other target files of a program from the program's source files. <br />
<br />
$ sudo apt-get install make<br />
<br />
=== Build essential ===<br />
<br />
$ sudo apt-get install build-essential<br />
<br />
=== Libtool ===<br />
<br />
GNU libtool is a generic library support script. Libtool hides the complexity of using shared libraries behind a consistent, portable interface. Creating the files for Paparazzi software building becomes less cumbersome by using this tool.<br />
<br />
$ sudo apt-get install libtool<br />
<br />
=== libpcre3-dev ===<br />
<br />
Required for compiling Ivy-C.<br />
<br />
$ apt-get install libpcre3-dev<br />
<br />
=== Git Client ===<br />
<br />
Git is a version control system. Version control systems allow many individuals to collaborate on the Paparazzi source code. This is needed to retrieve the latest sourcecode from various packages and Paparazzi sourcecode itself.<br />
<br />
$ sudo apt-get install git<br />
<br />
=== Subversion ===<br />
<br />
Version control system, required for cloning the ivy packages.<br />
<br />
$ apt-get install subversion<br />
<br />
=== GNU Plot ===<br />
<br />
A command-line driven interactive plotting program. Unknow if it is used<br />
<br />
$ sudo apt-get install gnuplot<br />
<br />
=== Meld ===<br />
<br />
Meld is a graphical front end to the diff program. It provides a side-by-side view of the differences between two files. It is used by the Paparazzi Center when configuration changes are not yet saved and the option comes along where one either can keep or view changes made in aircraft- and other configuration files.<br />
<br />
$ sudo apt-get install meld<br />
<br />
=== FTDI library ===<br />
<br />
libftdi is a library that talks to FTDI's 232 type chips, including the popular bitbang mode, using libusb. A library to be able to use with a debugging Autopilot hardware boards.<br />
<br />
$ sudo apt-get install libftdi-dev <br />
<br />
=== MPFR library ===<br />
<br />
The MPFR library is a C library for multiple-precision floating-point computations with correct rounding. MPFR is based on the GMP multiple-precision library. The main goal of MPFR is to provide a library for multiple-precision floating-point computation which is both efficient and has a well-defined semantics.<br />
<br />
$ sudo apt-get install libmpfr-dev<br />
<br />
=== ImageMagick ===<br />
<br />
ImageMagick is a software suite to create, edit, and compose bitmap images. It can read, convert and write images in a variety of formats. Use ImageMagick to translate, flip, mirror, rotate, scale, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves. Being able to modify image based map pictures is a feature that may come in handy one time.<br />
<br />
$ sudo apt-get install imagemagick<br />
<br />
=== Optional on an older OS ===<br />
<br />
If you have an older OS distribution it never hurts to install the following...<br />
<br />
$ sudo apt-get install libx11-6 libx11-dev texinfo libncurses5 libncursesw5 libncursesw5-dev zlibc<br />
<br />
== Paparazzi Main sourcecode ==<br />
<br />
See the main [[Installation#Getting_the_Source_Code]] page<br />
<br />
TIP: <br />
If you get the File "pprz.mli", line 149, characters 78-89: Error: Unbound type constructor Ivy.binding<br />
...this happens when IVY libraries are not yet installed. How to do this, read the part on installing IVY on this page<br />
<br />
<br />
== Useful links ==<br />
<br />
https://launchpad.net/gcc-arm-embedded/<br />
<br />
https://github.com/paparazzi/paparazzi-portability-support<br />
<br />
http://wiki.ubuntuusers.de/GNU_arm-toolchain<br />
<br />
http://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/ARM-Options.html#ARM-Options<br />
<br />
http://mcuprogramming.com/forum/arm/gnu-arm-toolchain-installer/<br />
<br />
http://www.ethernut.de/en/documents/cross-toolchain-osx.html<br />
<br />
http://www.hermann-uwe.de/blog/building-an-arm-cross-toolchain-with-binutils-gcc-newlib-and-gdb-from-source<br />
<br />
[[Category:Software]] [[Category:Developer_Documentation]] [[Category:Installation]]</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=STM32F4_Discovery&diff=19839STM32F4 Discovery2015-05-03T19:21:16Z<p>NeoFromMatrix: /* THT */</p>
<hr />
<div>'''This page is for the [http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/PF252419 STM32F4 Discovery board with STM32F407VGT6], STM32F4 Disco is a familiar board with STM32F401VCT6, do not use this Files for the Disco board ! '''<br />
<br />
{| align=right<br />
|-<br />
|<categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Autopilots</categorytree><br />
|}<br />
<br />
<div style="float: right; width: 65%"><br />
[[Image:STM32F4Discovery_front.jpg|300px]]<br />
[[Image:STM32F4Discovery_back.jpg|300px]]<br />
</div><br />
<br />
__TOC__<br />
<br />
<br />
==Overview==<br />
<br />
* STMicroelectronics STM32F4VGT6 Cortex M4 MCU, up to 168Mhz with floating point unit (FPU), 192 KB RAM, 1024 KB Flash<br />
* on-board STLinkv2 with SWD header (capable of programming onboard or external MCU)<br />
* on-board power regulator for the MCU (3V or 5V Input)<br />
* 1 x user push button<br />
* 4(5) x LED (orange, green, red, blue, green) <br />
* 4(6) x UART (UART1, UART2, UART3, (UART4, UART5), UART6)<br />
* 1(3) x SPI (SPI1, (SPI2, SPI3))<br />
* 2(3) x I2C (I2C1, I2C2, (I2C3))<br />
* 6 x ADC inputs (one is used for BAT voltage)<br />
* 1 x PPM input<br />
* 1 x Spektrum input (with bind pin)<br />
* 97 x 66 mm PCB<br />
* 4 x status LED (USB red, USB green, power, USB OTG green, USB OTG red)<br />
* LIS302DL MEMS 3 axis accelerometer on SPI1<br />
<br />
== Pinout ==<br />
<br />
The Discovery has a male 100 pin (2x25pin on both sides, also accessible on both sides of the pcb) pinout. <br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="60%"<br />
|+'''LED'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''!!width="5%"|''Color''<br />
|-<br />
|PD13||LED_3||Out||above LIS302DL||style="background:orange; color:black"|Orange<br />
|-<br />
|PD12||LED_4||Out||left of LIS302DL||style="background:green; color:black"|Green<br />
|-<br />
|PD14||LED_5||Out||right of LIS302DL||style="background:red; color:black"|Red<br />
|-<br />
|PD15||LED_6||Out||below LIS302DL||style="background:blue; color:black"|Blue<br />
|-<br />
|PA9||LED_9||Out||same as USB power (VBUS, needs to be enabled in header file)||style="background:green; color:black"|Green<br />
|} <br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="60%"<br />
|+'''UART1'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''<br />
|-<br />
|PB6||UART1 TX||Out||UART1 Serial Output, 4k7 pullup for I2C<br />
|-<br />
|PB7||UART1 RX||In||UART1 Serial Input<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="60%"<br />
|+'''UART2'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''<br />
|-<br />
|PD5||UART2 TX||Out||UART2 Serial Output (usb otg power management fault output open drain)<br />
|-<br />
|PD6||UART2 RX||In||UART2 Serial Input, also used for Spektrum input<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="60%"<br />
|+'''UART3'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''<br />
|-<br />
|PD8||UART3 TX||Out||UART3 Serial Output<br />
|-<br />
|PD9||UART3 RX||In||UART3 Serial Input<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="60%"<br />
|+'''UART4 (Can NOT be used if SPI_3 is active!)'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''<br />
|-<br />
|PC10||UART4 TX||Out||UART4 Serial Output<br />
|-<br />
|PC11||UART4 RX||In||UART4 Serial Input<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="60%"<br />
|+'''UART5 (Can NOT be used if SPI_3 is active!)'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''<br />
|-<br />
|PC12||UART5 TX||Out||UART5 Serial Output<br />
|-<br />
|PD2||UART5 RX||In||UART5 Serial Input<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="60%"<br />
|+'''UART6'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''<br />
|-<br />
|PC6||UART6 TX||Out||UART6 Serial Output<br />
|-<br />
|PC7||UART6 RX||In||UART6 Serial Input<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="60%"<br />
|+'''SPI1 (for onboard LIS302DL)'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''<br />
|-<br />
|PA5||SPI1 SCK||I/O||SPI1 Serial clock<br />
|-<br />
|PA6||SPI1 MISO||I/O||SPI1 Master In Slave Out<br />
|-<br />
|PA7||SPI1 MOSI||I/O||SPI1 Master Out Slave In<br />
|-<br />
|PE3||SPI SS2||I/O||SPI1 Select Slave2<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="60%"<br />
|+'''SPI1'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''<br />
|-<br />
|PB3||SPI1 SCK||I/O||SPI1 Serial clock<br />
|-<br />
|PB4||SPI1 MISO||I/O||SPI1 Master In Slave Out<br />
|-<br />
|PB5||SPI1 MOSI||I/O||SPI1 Master Out Slave In<br />
|-<br />
|PE2||SPI SS0||I/O||SPI1 Select Slave0<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="60%"<br />
|+'''SPI2 (Can NOT be used if PWM10 & PWM11 is active!)'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''<br />
|-<br />
|PB13||SPI2 SCK||I/O||SPI2 Serial clock<br />
|-<br />
|PB14||SPI2 MISO||I/O||SPI2 Master In Slave Out<br />
|-<br />
|PB15||SPI2 MOSI||I/O||SPI2 Master Out Slave In<br />
|-<br />
|PE7||SPI SS1||I/O||SPI2 Select Slave1<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="60%"<br />
|+'''SPI3 (Can NOT be used if UART4 & UART5 is active!)'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''<br />
|-<br />
|PC10||SPI3 SCK||I/O||SPI3 Serial clock<br />
|-<br />
|PC11||SPI3 MISO||I/O||SPI3 Master In Slave Out<br />
|-<br />
|PC12||SPI3 MOSI||I/O||SPI3 Master Out Slave In<br />
|-<br />
|PE3||SPI SS2||I/O||SPI3 Select Slave2 (also used for LIS302DL (SPI1) Slave Select)<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="60%"<br />
|+'''I2C1'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''<br />
|-<br />
|PB8||I2C1 SCL||I/O||I2C1 Serial Clock<br />
|-<br />
|PB9||I2C1 SDA||I/O||I2C1 Serial Data<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="60%"<br />
|+'''I2C2'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''<br />
|-<br />
|PB10||I2C2 SCL||I/O||I2C2 Serial Clock (also used for MP45DT02 MEMS MIC clock in)<br />
|-<br />
|PB11||I2C2 SDA||I/O||I2C2 Serial Data<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="60%"<br />
|+'''I2C3 (Can NOT be used if Spektrum bind / PPM input is active!)'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''<br />
|-<br />
|PA8||I2C3 SCL||I/O||I2C3 Serial Clock<br />
|-<br />
|PC9||I2C3 SDA||I/O||I2C3 Serial Data<br />
|}<br />
Note: is disabled in header file, PA8 is used as Spektrum bind pin, PC9 is used as PPM (not Spektrum) input<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="60%"<br />
|+'''ADC'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''<br />
|-<br />
|PB1||AUX1||I/O||ADC_1<br />
|-<br />
|PC5||AUX2||I/O||ADC_2<br />
|-<br />
|PC4||AUX3||I/O||ADC_3<br />
|-<br />
|PA4||AUX4/BAT||I/O||ADC_4, is used for BAT voltage<br />
|-<br />
|PC1||AUX5||I/O||ADC_5<br />
|-<br />
|PC2||AUX6||I/O||ADC_6<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="60%"<br />
|+'''PWM'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''<br />
|-<br />
|PE9||PWM0||Out||Servo 1<br />
|-<br />
|PE11||PWM1||Out||Servo 2<br />
|-<br />
|PE13||PWM2||Out||Servo 3<br />
|-<br />
|PE14||PWM3||Out||Servo 4<br />
|-<br />
|PE5||PWM4||Out||Servo 5<br />
|-<br />
|PE6||PWM5||Out||Servo 6<br />
|-<br />
|PA3||PWM6||Out||Servo 7<br />
|-<br />
|PA2||PWM7||Out||Servo 8<br />
|-<br />
|PA1||PWM8||Out||Servo 9<br />
|-<br />
|PA0||PWM9||Out||Servo 10<br />
|-<br />
|PB14||PWM10||Out||Servo 11, Can not be used if SPI2 is active<br />
|-<br />
|PB15||PWM11||Out||Servo 12, Can not be used if SPI2 is active<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="60%"<br />
|+'''PPM'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''<br />
|-<br />
|PC9||PPM||In||PPM input (remember, you need 100 Ohm serial termination in order to use this) <br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="60%"<br />
|+'''Spektrum'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''<br />
|-<br />
|PA8||Bind||Out||Spektrum bind pin<br />
|-<br />
|PA10||PPM||IN||Spektrum PPM in<br />
|}<br />
<br />
<br />
=== Jumper ===<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="60%"<br />
|+'''Jumper'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''<br />
|-<br />
|JP1||JP1||Switch||MCU Current can be measured here<br />
|-<br />
|CN3||CN3||Switch||closed: STLinkV2 is connected to onboard MCU, open: is not connectec to onboard, only external header<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="60%"<br />
|+'''Soolder Jumper'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''<br />
|-<br />
|SB17||SB17||Switch||Bypass for JP1, close this for security ! (if JP1 gets loose there is no power supply for the mcu)<br />
|}<br />
<br />
==Daughterboard==<br />
Currently we have two different breakout/baughter boards.<br />
<br />
=== SMD & Molex ===<br />
<br />
Another option with Molex connectors, levelshifters for I2C and SPI, as well as connectors for Spektrum satellites and a can phy would be:<br />
<br />
[[Image:DiscoveryBreakout1_small.jpg|300px]]<br />
[[Image:DiscoveryBreakout2_small.jpg|300px]]<br />
<br />
Currently under testing, eagle files are coming, when its completely finished and airworthy :-)<br />
<br />
=== THT ===<br />
<br />
Target for this board is to be a ultra low cost THT daughterboard which should provide as many functions as possible. Also it should be as simple as possible (hence no SMD Components were used).<br />
<br />
'''Notes''' <br/><br />
<br />
* Tall screw terminals can touch the THT solder joints from the discovery board. No electrical but a mechanical contact can appear. Don't force both pcb's all the way together (leave a small gap).<br />
* Only mount the components needed.<br />
* If [[IR_Sensors]] are used used, maybe the diodes shouldn't be mounted and the voltage divider should be changed.<br />
* If you use the 22k/2.2k voltage divider for the BAT input, you need to change the VoltageOfAdc see [[Airframe_Configuration#Battery]].<br />
<br />
'''Servo Power options''' <br/><br />
<br />
* External power source (to power servos with a higher voltage or an other voltage regulator, only GND stays connected).<br />
* Power servos from the 5V rail, solder the two solder bridges near the three row header.<br />
<br />
The servo rail also powers the RC receiver directly (PPM and Spektrum), take care of that if this rail runs on a higher voltage than 5V!<br/><br />
Servo and 5V net share the same GND!<br />
<br />
'''IMU mounting options''' <br/><br />
<br />
* Drotek 10 DOF can be soldered on the appropriate footprint. (phi, theta and psi need to be 180 degree offset)<br />
* Other IMUs (e.g. MPU6050 breakout) can be soldered on the prototyling area. Use wires to connect it to the Droteks I2C2 pins e.g..<br />
*Mount IMU elsewhere and connect it with cables.<br />
<br />
'''BAT voltage'''<br/><br />
<br />
If you use the 22k/2.2k Resistor divider, you will need to redefine the values for the ADC conversation.<br />
{{Box Code|conf/airframes/myplane.xml|<br />
<source lang="xml"><br />
<section name="BAT"><br />
...<br />
<define name="VOLTAGE_ADC_SCALE" value="0.008864469"/> <!-- R1 (Bat - ADC input) = 22k, R2 (ADC input - GND) = 2.2K---><br />
<define name="VOLTAGE_OFFSET" value="0" unit="V"/><br />
<define name="VoltageOfAdc(adc)" value="(VOLTAGE_ADC_SCALE * adc + VOLTAGE_OFFSET)"/><br />
</section><br />
</source><br />
}}<br />
Also see [[Airframe_Configuration#Battery]].<br />
<br />
<br />
[[File:Stm32f4discovery_daughterboard.jpg|400px]]<br />
[[File:Stm32f4discovery_with_daughterboard.jpg|400px]]<br />
<br />
==Firmware Flashing==<br />
<br />
'''FLASH_MODE=STLINK''' is set as default<br />
<br />
STM32F4 Discovery can mainly be programmed in two different ways:<br />
<br />
===STLINK===<br />
<br />
* with onboard STLinkV2 over SWD<br />
* required hardware: usb to mini USB cable<br />
* required software: st_flash and st_util from [https://github.com/texane/stlink Texane]<br />
* more information: [[STLink]] page<br />
<br />
===DFU-UTIL===<br />
<br />
* with the MCU native (embedded in rom) DFU USB bootloader over the micro USB AB connector<br />
* required hardware: USB to micro and USB to mini usb cable <br />
* required external software: dfu-util <br />
* push MCU in DFU mode: connect mini(for power) and micro USB to PC, connect pin BOOT0 with 3V, press reset button(LED LD7 should light up now), disconnect BOOT0<br />
* more information: [[DFU]] page<br />
<br />
=Supplier=<br />
<br />
THe STM discovery boards look all quite alike. To make sure you get the right board here a direct [[http://nl.farnell.com/stmicroelectronics/stm32f4discovery/stm32f407-usb-otg-discovery-kit/dp/2009276 link at Farnell]]<br />
Whatever supplier yo choose make sure it is a STM32F407 ,mind the 07 in the end, board.<br />
<br />
[[Category:Autopilots]]</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=Debug_Probes&diff=19808Debug Probes2015-04-25T11:32:07Z<p>NeoFromMatrix: /* Upgrade BMP firmware */ typo</p>
<hr />
<div><br />
__TOC__<br />
<br />
These various debug probes can be used for flashing and debugging Paparazzi hardware, some can even as USB-UART adapters. <br/><br />
Most are compatible with the currently used STM32 platform, some also with the older LPC 21xx.<br />
<br />
Debug probes for Atmel/AVR and SiLabs (ESC Controller chips) are located on the [[ESC]] page since those Microcontrollers are note more used as main processors.<br />
<br />
==Debug Protocols / Interfaces==<br />
<br />
There are two different relevant Protocolls / Interfaces for flashing and debugging for STM32:<br/><br />
<br />
Note: Some STM32 MCUs can also be flashed via Serial and or USB DFU! But SWD and JTAG provide (much better) debugging capabilities.<br />
<br />
===SWD===<br />
<br />
[http://www.arm.com/products/system-ip/debug-trace/coresight-soc-components/serial-wire-debug.php ARM Serial Wire Debug (SWD)] is a program and debug protocol for ARM processors. It's a low pin count and high-performance alternative and replacement to JTAG.<br />
<br />
===JTAG===<br />
<br />
JTAG is a industry standard on-chip debugging protocoll. It can be used for one or more chips (daisy chained), for interfacing with the chip as well as flashing software.<br />
<br />
[[DevGuide/OpenOCD]] can be used for interfacing with JTAG hardware (e.g. FTDI chips).<br />
<br />
==[[CricketProbe/v1.00 | CricketProbe v1.00]]==<br />
<br />
[[Image:CricketProbe_v100.jpg|300px|left|link=CricketProbe/v1.00 |CricketProbe v1.00 page]]<br />
<br />
The CricketProbe is a programming and debugging tool for ARM Cortex MCU, based on [http://www.blacksphere.co.nz Black Sphere Technologies] [http://www.blacksphere.co.nz/main/blackmagic Black Magic Probe].<br />
<br />
<br style="clear:both"><br />
<br />
==Lyorak Probe==<br />
<br />
[[Image:Lyorak_front.jpg|300px|Lyorak probe]] <br />
[[Image:Lyorak_pinout.jpeg|500px|Lyorak probe pinout]] <br />
<br />
The Lyorak probe is a programming and debugging tool for ARM Cortex MCU, based on the [http://www.blacksphere.co.nz/main/blackmagic Black Magic Probe]. <br/><br />
Designed with 1206 SMD components for easy assmbly and a CAN interface.<br />
<br />
<br style="clear:both"><br />
<br />
===Documentation===<br />
<br />
[https://github.com/molnarkares/blackmagic/tree/master/hardware/contrib/lyorak molnarkares/blackmagic git repo (fork from blackmagic)]<br />
<br />
=Black Magic Probe=<br />
<br />
[[Image:BMPM_1_top.jpg|300px|Black Magic Probe]]<br />
[[Image:BMPM_1_bottom.jpg|300px|Black Magic Probe]]<br />
<br />
This is the original [http://www.blacksphere.co.nz/main/blackmagic Black Magic Probe] from [http://www.blacksphere.co.nz Black Sphere Technologies], a programming and debugging tool for ARM Cortex MCU.<br />
<br />
<br style="clear:both"><br />
<br />
===Documentation===<br />
<br />
[https://github.com/blacksphere/blackmagic blacksphere/blackmagic git repo]<br />
[http://www.blacksphere.co.nz/main/index.php/blackmagic] <br />
[http://1bitsquared.com/collections/supporting-hardware/products/black-magic-probe Buy at 1bitsquared for 65$]<br />
<br />
=[[STLink]]=<br />
<br />
[[Image:St-link.jpg|300px]]<br />
<br />
Most STM discovery / eval boards comes with a [http://www.st.com/web/catalog/tools/FM146/CL1984/SC724/SS1677/PF251168 ST-Link V2] on board, with one exception; the STM32VL version, that board comes with ST-Link V1.<br />
<br />
These can be used with [https://github.com/texane/stlink texane’s] tools, or reflashed with [[STLink#Update_the_ST-Link_to_blackmagic_probe| the blackmagic firmware]].<br />
<br />
<br style="clear:both"><br />
<br />
==Clones==<br />
<br />
There are some variations of the STLink available. Some with the same STM32F103C8T6 MCU, some with one below.<br/><br />
More informations on the [[STLink#Clones]] page.<br/><br />
Again, these can be used with (texanes) STLink or Blackmagic software.<br />
<br />
=FLOSS JTAG=<br />
<br />
[[Image:Jtag-up.jpg|300px|FLOSS JTAG top]]<br />
[[Image:Jtag-down.jpg|300px|FLOSS JTAG bottom]]<br />
<br />
The FLOSS JTAG is based on an FTDI 2232HL chip that allows two simultaneous USB connections, which means that FLOSS JTAG allows JTAG and UART simultaneously.<br/><br />
<br />
The upper side contains the JTAG connector and two sets of RX/TX LEDs for JTAG and UART/COM interface separately. The JTAG connector is 2x5 pins, 0.05-inch pitch, and is compatible with the Samtec FFSD-05-D-06.00-01-N-RW-R ribbon cable.<br />
<br />
On the bottom side there is 4 pin UART connector, which contains (from top to bottom on the image, or color dots): Ground (black), RX (orange), TX (yellow), and +5V (red) <br />
<br />
<br style="clear:both"><br />
<br />
Can be used with [[DevGuide/OpenOCD]] software.<br />
===Documentation===<br />
<br />
[http://randomprojects.org/wiki/Floss-JTAG randomprojects.org/wiki/Floss-JTAG]<br />
<br />
=FT2232H Mini Module=<br />
<br />
[[Image:AlternativeFlossJtag.png|300px|FT2232H Mini Modules as JTAG adapter]]<br />
[[Image:FT2232H_Mini_Module_front.jpg|200px|Top with all necessary connections]]<br />
[[Image:FT2232H_Mini_Module_back.jpg|200px|Bottom with pin headers]]<br />
<br />
<br style="clear:both"><br />
<br />
The FT2232H Mini modules can be used with blackmagic firmware or as FLOSS-JTAG device. <br/><br />
<br />
'''Important'''<br />
<br />
Out of the box, there is NO power supply for the FT2232H because this can either done with USB or external 5V.<br/><br />
The pictures above show two different PCB versions. The suggested connections only apply to the right (latest) layout.<br />
<br />
Connect: (for power supply over USB)<br />
* CN3 pin 1 to CN3 pin 3<br />
* CN2 pin group 1,3,5 to CN2 pin group 11,21 and to CN3 pin group 12,22<br />
<br />
'''Pinout'''<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="6"<br />
|+'''UART'''<br />
!''Use''!!''Pin''!!''Name''<br />
|-<br />
|UART1 RX ||CN2-10||ADBUS1<br />
|-<br />
|UART1 TX ||CN2-7||ADBUS0<br />
|-<br />
|UART2 RX ||CN3-25||BDBUS1<br />
|-<br />
|UART2 TX ||CN3-26||BDBUS0<br />
|}<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="6"<br />
|+'''JTAG'''<br />
!''Use''!!''Pin''!!''Name''<br />
|-<br />
|JTAG1 TCK ||CN2-7||ADBUS0<br />
|-<br />
|JTAG1 TDI ||CN2-10||ADBUS1<br />
|-<br />
|JTAG1 TDO ||CN2-9||ADBUS2<br />
|-<br />
|JTAG1 TMS ||CN2-12||ADBUS3<br />
|-<br />
|JTAG2 TCK ||CN3-26||BDBUS0<br />
|-<br />
|JTAG2 TDI ||CN3-25||BDBUS1<br />
|-<br />
|JTAG2 TDO ||CN3-24||BDBUS2<br />
|-<br />
|JTAG2 TMS ||CN3-23||BDBUS3<br />
|}<br />
<br />
===Blackmagic firmware===<br />
<br />
First, get the VID/PID for your FT2232 device using 'lsusb'. Edit the file<br />
'src/libftdi/platform.h' and change the VID/PID to match your hardware.<br />
Compile the application with the command:<br />
<br />
make PROBE_HOST=libftdi<br />
<br />
===Use as FLOSS-JTAG===<br />
<br />
With the tool "FT_Prog" change the description the FT2232H to "FLOSS-JTAG".<br />
<br />
===Documentation===<br />
<br />
[http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT2232H.pdf FT2232H Datasheet] <br/><br />
[http://www.ftdichip.com/Support/Documents/DataSheets/Modules/DS_FT2232H_Mini_Module.pdf FT2232H Mini Module Datatsheet] <br/><br />
[http://at.mouser.com/ProductDetail/FTDI/FT2232H-MINI-MODULE/?qs=sGAEpiMZZMvOu2nvEqRMlAhGRrWaSCdm Mouser shop 22€]<br />
<br />
=Blackmagic Probe usage=<br />
<br />
In the wiki (under [Developer_Guide]) is already some helpful information:<br />
* Use Blackmagic Probe with Eclipse [[RT_Paparazzi#Debugging_with_an_Eclipse_IDE]].<br />
* General OpenOCD/GDB commands in reagards of the BMP, also about SWD [[DevGuide/GDB_OpenOCD_Debug#Debugging_with_GDB_over_JTAG]] [[DevGuide/GDB_OpenOCD_Debug#Black_Magic_Probe]].<br />
<br />
===Upgrade BMP firmware===<br />
<br />
Check firmware version:<br />
$ arm-none-eabi-gdb<br />
(gdb) target extended-remote /dev/ttyACM0<br />
(gdb) monitor version<br />
<br />
Download source from git, compile:<br />
$ git clone https://github.com/blacksphere/blackmagic<br />
$ cd blackmagic<br />
$ git submodule init<br />
$ git submodule update<br />
$ make<br />
$ cd src<br />
$ make clean<br />
$ make PROBE_HOST=native<br />
$ cd ../scripts<br />
Connect the Blackmagic Probe to USB while holding down the button for firmware update, then start "stm32_mem.py".<br />
$ stm32_mem.py ../src/blackmagic.bin<br />
<br />
You can build different targets (Hardware Platforms), default value is;<br />
<br />
$ make PROBE_HOST=native<br />
<br />
[[Category:Hardware]]</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=STM32F4_Discovery&diff=19807STM32F4 Discovery2015-04-25T10:20:04Z<p>NeoFromMatrix: /* THT */</p>
<hr />
<div>'''This page is for the [http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/PF252419 STM32F4 Discovery board with STM32F407VGT6], STM32F4 Disco is a familiar board with STM32F401VCT6, do not use this Files for the Disco board ! '''<br />
<br />
{| align=right<br />
|-<br />
|<categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Autopilots</categorytree><br />
|}<br />
<br />
<div style="float: right; width: 65%"><br />
[[Image:STM32F4Discovery_front.jpg|300px]]<br />
[[Image:STM32F4Discovery_back.jpg|300px]]<br />
</div><br />
<br />
__TOC__<br />
<br />
<br />
==Overview==<br />
<br />
* STMicroelectronics STM32F4VGT6 Cortex M4 MCU, up to 168Mhz with floating point unit (FPU), 192 KB RAM, 1024 KB Flash<br />
* on-board STLinkv2 with SWD header (capable of programming onboard or external MCU)<br />
* on-board power regulator for the MCU (3V or 5V Input)<br />
* 1 x user push button<br />
* 4(5) x LED (orange, green, red, blue, green) <br />
* 4(6) x UART (UART1, UART2, UART3, (UART4, UART5), UART6)<br />
* 1(3) x SPI (SPI1, (SPI2, SPI3))<br />
* 2(3) x I2C (I2C1, I2C2, (I2C3))<br />
* 6 x ADC inputs (one is used for BAT voltage)<br />
* 1 x PPM input<br />
* 1 x Spektrum input (with bind pin)<br />
* 97 x 66 mm PCB<br />
* 4 x status LED (USB red, USB green, power, USB OTG green, USB OTG red)<br />
* LIS302DL MEMS 3 axis accelerometer on SPI1<br />
<br />
== Pinout ==<br />
<br />
The Discovery has a male 100 pin (2x25pin on both sides, also accessible on both sides of the pcb) pinout. <br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="60%"<br />
|+'''LED'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''!!width="5%"|''Color''<br />
|-<br />
|PD13||LED_3||Out||above LIS302DL||style="background:orange; color:black"|Orange<br />
|-<br />
|PD12||LED_4||Out||left of LIS302DL||style="background:green; color:black"|Green<br />
|-<br />
|PD14||LED_5||Out||right of LIS302DL||style="background:red; color:black"|Red<br />
|-<br />
|PD15||LED_6||Out||below LIS302DL||style="background:blue; color:black"|Blue<br />
|-<br />
|PA9||LED_9||Out||same as USB power (VBUS, needs to be enabled in header file)||style="background:green; color:black"|Green<br />
|} <br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="60%"<br />
|+'''UART1'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''<br />
|-<br />
|PB6||UART1 TX||Out||UART1 Serial Output, 4k7 pullup for I2C<br />
|-<br />
|PB7||UART1 RX||In||UART1 Serial Input<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="60%"<br />
|+'''UART2'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''<br />
|-<br />
|PD5||UART2 TX||Out||UART2 Serial Output (usb otg power management fault output open drain)<br />
|-<br />
|PD6||UART2 RX||In||UART2 Serial Input, also used for Spektrum input<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="60%"<br />
|+'''UART3'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''<br />
|-<br />
|PD8||UART3 TX||Out||UART3 Serial Output<br />
|-<br />
|PD9||UART3 RX||In||UART3 Serial Input<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="60%"<br />
|+'''UART4 (Can NOT be used if SPI_3 is active!)'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''<br />
|-<br />
|PC10||UART4 TX||Out||UART4 Serial Output<br />
|-<br />
|PC11||UART4 RX||In||UART4 Serial Input<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="60%"<br />
|+'''UART5 (Can NOT be used if SPI_3 is active!)'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''<br />
|-<br />
|PC12||UART5 TX||Out||UART5 Serial Output<br />
|-<br />
|PD2||UART5 RX||In||UART5 Serial Input<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="60%"<br />
|+'''UART6'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''<br />
|-<br />
|PC6||UART6 TX||Out||UART6 Serial Output<br />
|-<br />
|PC7||UART6 RX||In||UART6 Serial Input<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="60%"<br />
|+'''SPI1 (for onboard LIS302DL)'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''<br />
|-<br />
|PA5||SPI1 SCK||I/O||SPI1 Serial clock<br />
|-<br />
|PA6||SPI1 MISO||I/O||SPI1 Master In Slave Out<br />
|-<br />
|PA7||SPI1 MOSI||I/O||SPI1 Master Out Slave In<br />
|-<br />
|PE3||SPI SS2||I/O||SPI1 Select Slave2<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="60%"<br />
|+'''SPI1'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''<br />
|-<br />
|PB3||SPI1 SCK||I/O||SPI1 Serial clock<br />
|-<br />
|PB4||SPI1 MISO||I/O||SPI1 Master In Slave Out<br />
|-<br />
|PB5||SPI1 MOSI||I/O||SPI1 Master Out Slave In<br />
|-<br />
|PE2||SPI SS0||I/O||SPI1 Select Slave0<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="60%"<br />
|+'''SPI2 (Can NOT be used if PWM10 & PWM11 is active!)'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''<br />
|-<br />
|PB13||SPI2 SCK||I/O||SPI2 Serial clock<br />
|-<br />
|PB14||SPI2 MISO||I/O||SPI2 Master In Slave Out<br />
|-<br />
|PB15||SPI2 MOSI||I/O||SPI2 Master Out Slave In<br />
|-<br />
|PE7||SPI SS1||I/O||SPI2 Select Slave1<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="60%"<br />
|+'''SPI3 (Can NOT be used if UART4 & UART5 is active!)'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''<br />
|-<br />
|PC10||SPI3 SCK||I/O||SPI3 Serial clock<br />
|-<br />
|PC11||SPI3 MISO||I/O||SPI3 Master In Slave Out<br />
|-<br />
|PC12||SPI3 MOSI||I/O||SPI3 Master Out Slave In<br />
|-<br />
|PE3||SPI SS2||I/O||SPI3 Select Slave2 (also used for LIS302DL (SPI1) Slave Select)<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="60%"<br />
|+'''I2C1'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''<br />
|-<br />
|PB8||I2C1 SCL||I/O||I2C1 Serial Clock<br />
|-<br />
|PB9||I2C1 SDA||I/O||I2C1 Serial Data<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="60%"<br />
|+'''I2C2'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''<br />
|-<br />
|PB10||I2C2 SCL||I/O||I2C2 Serial Clock (also used for MP45DT02 MEMS MIC clock in)<br />
|-<br />
|PB11||I2C2 SDA||I/O||I2C2 Serial Data<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="60%"<br />
|+'''I2C3 (Can NOT be used if Spektrum bind / PPM input is active!)'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''<br />
|-<br />
|PA8||I2C3 SCL||I/O||I2C3 Serial Clock<br />
|-<br />
|PC9||I2C3 SDA||I/O||I2C3 Serial Data<br />
|}<br />
Note: is disabled in header file, PA8 is used as Spektrum bind pin, PC9 is used as PPM (not Spektrum) input<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="60%"<br />
|+'''ADC'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''<br />
|-<br />
|PB1||AUX1||I/O||ADC_1<br />
|-<br />
|PC5||AUX2||I/O||ADC_2<br />
|-<br />
|PC4||AUX3||I/O||ADC_3<br />
|-<br />
|PA4||AUX4/BAT||I/O||ADC_4, is used for BAT voltage<br />
|-<br />
|PC1||AUX5||I/O||ADC_5<br />
|-<br />
|PC2||AUX6||I/O||ADC_6<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="60%"<br />
|+'''PWM'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''<br />
|-<br />
|PE9||PWM0||Out||Servo 1<br />
|-<br />
|PE11||PWM1||Out||Servo 2<br />
|-<br />
|PE13||PWM2||Out||Servo 3<br />
|-<br />
|PE14||PWM3||Out||Servo 4<br />
|-<br />
|PE5||PWM4||Out||Servo 5<br />
|-<br />
|PE6||PWM5||Out||Servo 6<br />
|-<br />
|PA3||PWM6||Out||Servo 7<br />
|-<br />
|PA2||PWM7||Out||Servo 8<br />
|-<br />
|PA1||PWM8||Out||Servo 9<br />
|-<br />
|PA0||PWM9||Out||Servo 10<br />
|-<br />
|PB14||PWM10||Out||Servo 11, Can not be used if SPI2 is active<br />
|-<br />
|PB15||PWM11||Out||Servo 12, Can not be used if SPI2 is active<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="60%"<br />
|+'''PPM'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''<br />
|-<br />
|PC9||PPM||In||PPM input (remember, you need 100 Ohm serial termination in order to use this) <br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="60%"<br />
|+'''Spektrum'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''<br />
|-<br />
|PA8||Bind||Out||Spektrum bind pin<br />
|-<br />
|PA10||PPM||IN||Spektrum PPM in<br />
|}<br />
<br />
<br />
=== Jumper ===<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="60%"<br />
|+'''Jumper'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''<br />
|-<br />
|JP1||JP1||Switch||MCU Current can be measured here<br />
|-<br />
|CN3||CN3||Switch||closed: STLinkV2 is connected to onboard MCU, open: is not connectec to onboard, only external header<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="60%"<br />
|+'''Soolder Jumper'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''<br />
|-<br />
|SB17||SB17||Switch||Bypass for JP1, close this for security ! (if JP1 gets loose there is no power supply for the mcu)<br />
|}<br />
<br />
==Daughterboard==<br />
Currently we have two different breakout/baughter boards.<br />
<br />
=== SMD & Molex ===<br />
<br />
Another option with Molex connectors, levelshifters for I2C and SPI, as well as connectors for Spektrum satellites and a can phy would be:<br />
<br />
[[Image:DiscoveryBreakout1_small.jpg|300px]]<br />
[[Image:DiscoveryBreakout2_small.jpg|300px]]<br />
<br />
Currently under testing, eagle files are coming, when its completely finished and airworthy :-)<br />
<br />
=== THT ===<br />
<br />
Target for this board is to be a ultra low cost THT daughterboard which should provide as many functions as possible. Also it should be as simple as possible (hence no SMD Components were used).<br />
<br />
'''Notes''' <br/><br />
* Tall screw terminals can touch the THT solder joints from the discovery board. No electrical but a mechanical contact can appear. Don't force both pcb's all the way together (leave a small gap).<br />
* Only mount the components needed.<br />
* If [[IR_Sensors]] are used used, maybe the diodes shouldn't be mounted and the voltage divider should be changed.<br />
* If you use the 22k/2.2k voltage divider for the BAT input, you need to change the VoltageOfAdc see [[Airframe_Configuration#Battery]].<br />
<br />
'''Servo Power options''' <br/><br />
*External power source (to power servos with a higher voltage or an other voltage regulator, only GND stays connected).<br />
*Power servos from the 5V rail, solder the two solder bridges benesth the three row header.<br />
<br />
The servo rail also powers the RC receiver directly (PPM and Spektrum), take care of that if this rail runs on a higher voltage than 5V!<br/><br />
Servo and 5V net share the same GND!<br />
<br />
'''IMU mounting options''' <br/><br />
*Drotek 10 DOF can be soldered on the appropriate footprint. (If mounted with the analog header facing front and pcb level with the wing, phi, theta and psi need to be 180 degree offset)<br />
*Other 6/9/10DOM IMU, can be soldered on the prototyling area. Use wires to make connections between the e.g. the Drotek footprint and the IMU (if the other IMU one has a different pinout)<br />
*Mount IMU elsewhere and connect it with cables.<br />
<br />
'''BAT voltage'''<br/><br />
If you use the 22k/2.2k Resistor divider, you will need to redefine the values for the ADC conversation.<br />
{{Box Code|conf/airframes/myplane.xml|<br />
<source lang="xml"><br />
<section name="BAT"><br />
...<br />
<define name="VOLTAGE_ADC_SCALE" value="0.008864469"/> <!-- R1 (Bat - ADC input) = 22k, R2 (ADC input - GND) = 2.2K---><br />
<define name="VOLTAGE_OFFSET" value="0" unit="V"/><br />
<define name="VoltageOfAdc(adc)" value="(VOLTAGE_ADC_SCALE * adc + VOLTAGE_OFFSET)"/><br />
</section><br />
</source><br />
}}<br />
Also see [[Airframe_Configuration#Battery]].<br />
<br />
<br />
[[File:Stm32f4discovery_daughterboard.jpg|400px]]<br />
[[File:Stm32f4discovery_with_daughterboard.jpg|400px]]<br />
<br />
==Firmware Flashing==<br />
<br />
'''FLASH_MODE=STLINK''' is set as default<br />
<br />
STM32F4 Discovery can mainly be programmed in two different ways:<br />
<br />
===STLINK===<br />
<br />
* with onboard STLinkV2 over SWD<br />
* required hardware: usb to mini USB cable<br />
* required software: st_flash and st_util from [https://github.com/texane/stlink Texane]<br />
* more information: [[STLink]] page<br />
<br />
===DFU-UTIL===<br />
<br />
* with the MCU native (embedded in rom) DFU USB bootloader over the micro USB AB connector<br />
* required hardware: USB to micro and USB to mini usb cable <br />
* required external software: dfu-util <br />
* push MCU in DFU mode: connect mini(for power) and micro USB to PC, connect pin BOOT0 with 3V, press reset button(LED LD7 should light up now), disconnect BOOT0<br />
* more information: [[DFU]] page<br />
<br />
[[Category:Autopilots]]</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=STLink&diff=19806STLink2015-04-25T10:19:25Z<p>NeoFromMatrix: /* BMP Method */</p>
<hr />
<div><div style="float: right; width: 20%"><br />
<categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Firmware Flashing</categorytree><br />
</div><br />
<br />
<div style="float: right; width: 60%"><br />
[[Image:St-link.jpg|right|450px]]<br />
</div><br />
__TOC__<br />
<br />
<br />
Every STM discovery / eval board comes with a [http://www.st.com/web/catalog/tools/FM146/CL1984/SC724/SS1677/PF251168 ST-Link V2] on board, with one exception; the STM32VL version comes with a ST-Link V1.<br />
<br />
==SWD Header==<br />
<br />
[[Image:swd_header_discovery_board.png|250px|Pinout with Apogee connector]]<br />
<br />
==Install Software==<br />
<br />
The ''st-flash'' and ''st-util'' tools are needed, provied by [https://github.com/texane/stlink texane]<br />
<br />
Download and compile<br />
$ cd /opt<br />
$ git clone git://github.com/texane/stlink.git stlink<br />
$ cd stlink<br />
$ ./autogen.sh<br />
$ ./configure<br />
$ make<br />
<br />
Set enviroment variable<br />
$ exportline="PATH=$PATH:/opt/stlink"<br />
$ if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi<br />
$ source ~/.profile<br />
<br />
Add udev rules <br />
$ sudo cp /opt/stlink/49-stlinkv*.rules /etc/udev/rules.d<br />
$ sudo udevadm control --reload-rules<br />
<br />
ST-LinkV1 requires a bit different treatment, read the [https://github.com/texane/stlink/blob/master/README Readme.txt]<br />
<br />
==Airframe.xml setup==<br />
<br />
Connect the ST-Link to the MCU.<br />
If a complete STM32Fx-Discovery board is used, CN3 jumpers need to be set. To program a external MCU, remove CN3 jumpers and connect the external MCU with the SWD header.<br />
<br />
To use SWD via STLink as default:<br/><br />
Set '''FLASH_MODE=STLINK'''<br/><br />
<br />
==Update the ST-Link to blackmagic probe==<br />
<br />
The STM32F103 (STLink MCU) can be flashed with the blackmagic's firware.<br/><br />
<br />
===Two STLinkV2 Method===<br />
<br />
Use one STLink to flash another<br />
<br />
Hardware Setup:<br />
One STLinkV2 (connected via USB) is programming the other one. Change the 4 Solder jumpers on the bottom of the target STLinkV2 from "DEFAULT" to "REVERSED".<br/><br />
<br />
Connections between the two STLinks<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="6"<br />
|+'''Connections [Header-Pin]'''<br />
!''Use''!!''From Programmer''!!''To Target''<br />
|-<br />
|5V||P2-5V||P2-5V<br />
|-<br />
|SWDIO||CN2-4||CN3-2<br />
|-<br />
|SWDCLK||CN2-2||CN3-3<br />
|-<br />
|GND||CN2-3||CN3-4<br />
|}<br />
<br />
Download and build the Firmware<br />
git clone https://github.com/blacksphere/blackmagic<br />
cd blackmagic<br />
git submodule init<br />
git submodule update<br />
make<br />
cd src<br />
make clean<br />
make PROBE_HOST=stlink<br />
<br />
Remove the readout protection, erase and flash<br />
openocd -f interface/stlink-v2.cfg -f target/stm32f1x_stlink.cfg -c "init" -c "halt" -c "stm32f1x unlock 0" -c "shutdown"<br />
st-flash erase<br />
st-flash --reset write blackmagic.bin 0x8002000<br />
st-flash write blackmagic_dfu.bin 0x8000000<br />
<br />
====Documentation====<br />
<br />
[http://esden.net/2014/12/29/black-magic-discovery Black Magic Discovery from Esden] <-- This also describes how to remove the read out protection. <br/><br />
[http://embdev.net/articles/STM_Discovery_as_Black_Magic_Probe embdev.net page]<br />
<br />
===BMP Method===<br />
<br />
Use a BMP to flash a STLink<br />
<br />
Transfer the solder jumpers from "Default" to "Reversed" and build the firmware as descibed above.<br/><br />
Connect the BMP to the CN2 header (see Pinout above).<br />
<br />
Start gdb, erase the option bytes and flash BMP<br />
(gdb) target extended-remote /dev/ttyACM0<br />
(gdb) mon swdp_scan<br />
(gdb) att 1 <br />
(gdb) mon option erase<br />
(gdb) load /dir/to/blackmagic<br />
(gdb) load /dir/to/blackmagic_dfu<br />
(gdb) detach<br />
<br />
The option bytes do not cover the Readout Protection (RDP), but the RDP is disabled anyhow...<br />
<br />
'''Error at loading a new image after removing RDP'''<br />
<br />
Error erasing flash with vFlashErase packet<br />
If this occurs powercycle the target (disconnect and reconnect the 3V3 connection), swd scan, attach and try loading the image again. Usually the reset of the RDP requires a flash erase (done by mon option erase) and reset.<br />
<br />
Probably this can also be done via gdb.<br />
<br />
==Clones==<br />
<br />
There are also some chinese clones out there. Some with the identical MCU, and some also with an other.<br />
<br />
See also https://github.com/blacksphere/blackmagic/issues/62<br />
<br />
===Red PCB===<br />
<br />
[[Image:Red_clone_front.jpg|250px]]<br />
[[Image:Red_clone_back.jpg|250px]]<br />
<br />
* STM32F103C8T6<br />
<br />
Programming header (1.27mm, populated on the images) from the Mini USB to the Pin header (right to left on the image), used for programming the onboard MCU.<br />
<br />
# SWDIO<br />
# GND<br />
# SWDCLK<br />
# 3V3 <br />
<br />
===Blue PCB===<br />
<br />
===Aluminium housing===<br />
[[Category:Firmware Flashing]] [[Category:Developer_Documentation]]</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=STLink&diff=19805STLink2015-04-25T09:36:26Z<p>NeoFromMatrix: </p>
<hr />
<div><div style="float: right; width: 20%"><br />
<categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Firmware Flashing</categorytree><br />
</div><br />
<br />
<div style="float: right; width: 60%"><br />
[[Image:St-link.jpg|right|450px]]<br />
</div><br />
__TOC__<br />
<br />
<br />
Every STM discovery / eval board comes with a [http://www.st.com/web/catalog/tools/FM146/CL1984/SC724/SS1677/PF251168 ST-Link V2] on board, with one exception; the STM32VL version comes with a ST-Link V1.<br />
<br />
==SWD Header==<br />
<br />
[[Image:swd_header_discovery_board.png|250px|Pinout with Apogee connector]]<br />
<br />
==Install Software==<br />
<br />
The ''st-flash'' and ''st-util'' tools are needed, provied by [https://github.com/texane/stlink texane]<br />
<br />
Download and compile<br />
$ cd /opt<br />
$ git clone git://github.com/texane/stlink.git stlink<br />
$ cd stlink<br />
$ ./autogen.sh<br />
$ ./configure<br />
$ make<br />
<br />
Set enviroment variable<br />
$ exportline="PATH=$PATH:/opt/stlink"<br />
$ if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi<br />
$ source ~/.profile<br />
<br />
Add udev rules <br />
$ sudo cp /opt/stlink/49-stlinkv*.rules /etc/udev/rules.d<br />
$ sudo udevadm control --reload-rules<br />
<br />
ST-LinkV1 requires a bit different treatment, read the [https://github.com/texane/stlink/blob/master/README Readme.txt]<br />
<br />
==Airframe.xml setup==<br />
<br />
Connect the ST-Link to the MCU.<br />
If a complete STM32Fx-Discovery board is used, CN3 jumpers need to be set. To program a external MCU, remove CN3 jumpers and connect the external MCU with the SWD header.<br />
<br />
To use SWD via STLink as default:<br/><br />
Set '''FLASH_MODE=STLINK'''<br/><br />
<br />
==Update the ST-Link to blackmagic probe==<br />
<br />
The STM32F103 (STLink MCU) can be flashed with the blackmagic's firware.<br/><br />
<br />
===Two STLinkV2 Method===<br />
<br />
Use one STLink to flash another<br />
<br />
Hardware Setup:<br />
One STLinkV2 (connected via USB) is programming the other one. Change the 4 Solder jumpers on the bottom of the target STLinkV2 from "DEFAULT" to "REVERSED".<br/><br />
<br />
Connections between the two STLinks<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="6"<br />
|+'''Connections [Header-Pin]'''<br />
!''Use''!!''From Programmer''!!''To Target''<br />
|-<br />
|5V||P2-5V||P2-5V<br />
|-<br />
|SWDIO||CN2-4||CN3-2<br />
|-<br />
|SWDCLK||CN2-2||CN3-3<br />
|-<br />
|GND||CN2-3||CN3-4<br />
|}<br />
<br />
Download and build the Firmware<br />
git clone https://github.com/blacksphere/blackmagic<br />
cd blackmagic<br />
git submodule init<br />
git submodule update<br />
make<br />
cd src<br />
make clean<br />
make PROBE_HOST=stlink<br />
<br />
Remove the readout protection, erase and flash<br />
openocd -f interface/stlink-v2.cfg -f target/stm32f1x_stlink.cfg -c "init" -c "halt" -c "stm32f1x unlock 0" -c "shutdown"<br />
st-flash erase<br />
st-flash --reset write blackmagic.bin 0x8002000<br />
st-flash write blackmagic_dfu.bin 0x8000000<br />
<br />
====Documentation====<br />
<br />
[http://esden.net/2014/12/29/black-magic-discovery Black Magic Discovery from Esden] <-- This also describes how to remove the read out protection. <br/><br />
[http://embdev.net/articles/STM_Discovery_as_Black_Magic_Probe embdev.net page]<br />
<br />
===BMP Method===<br />
<br />
Use a BMP to flash a STLink<br />
<br />
Transfer the solder jumpers from "Default" to "Reversed" and build the firmware as descibed above.<br/><br />
Connect the BMP to the CN2 header (see Pinout above).<br />
<br />
Start gdb, erase the option bytes and flash BMP<br />
(gdb) target extended-remote /dev/ttyACM0<br />
(gdb) mon swdp_scan<br />
(gdb) att 1 <br />
(gdb) mon option erase<br />
(gdb) load /dir/to/blackmagic<br />
(gdb) load /dir/to/blackmagic_dfu<br />
(gdb) detach<br />
<br />
The option bytes do not cover the Readout Protection (RDP), but the RDP is disabled anyhow...<br />
<br />
==Clones==<br />
<br />
There are also some chinese clones out there. Some with the identical MCU, and some also with an other.<br />
<br />
See also https://github.com/blacksphere/blackmagic/issues/62<br />
<br />
===Red PCB===<br />
<br />
[[Image:Red_clone_front.jpg|250px]]<br />
[[Image:Red_clone_back.jpg|250px]]<br />
<br />
* STM32F103C8T6<br />
<br />
Programming header (1.27mm, populated on the images) from the Mini USB to the Pin header (right to left on the image), used for programming the onboard MCU.<br />
<br />
# SWDIO<br />
# GND<br />
# SWDCLK<br />
# 3V3 <br />
<br />
===Blue PCB===<br />
<br />
===Aluminium housing===<br />
[[Category:Firmware Flashing]] [[Category:Developer_Documentation]]</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=File:Stlinkv2_clone_red_back.jpg&diff=19804File:Stlinkv2 clone red back.jpg2015-04-25T09:25:58Z<p>NeoFromMatrix: STLink clone (red PCB) back</p>
<hr />
<div>STLink clone (red PCB) back</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=File:Stlinkv2_clone_red_front.jpg&diff=19803File:Stlinkv2 clone red front.jpg2015-04-25T09:25:14Z<p>NeoFromMatrix: STLink clone (red PCB) front</p>
<hr />
<div>STLink clone (red PCB) front</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=Debug_Probes&diff=19802Debug Probes2015-04-25T08:25:47Z<p>NeoFromMatrix: /* STLink */</p>
<hr />
<div><br />
__TOC__<br />
<br />
These various debug probes can be used for flashing and debugging Paparazzi hardware, some can even as USB-UART adapters. <br/><br />
Most are compatible with the currently used STM32 platform, some also with the older LPC 21xx.<br />
<br />
Debug probes for Atmel/AVR and SiLabs (ESC Controller chips) are located on the [[ESC]] page since those Microcontrollers are note more used as main processors.<br />
<br />
==Debug Protocols / Interfaces==<br />
<br />
There are two different relevant Protocolls / Interfaces for flashing and debugging for STM32:<br/><br />
<br />
Note: Some STM32 MCUs can also be flashed via Serial and or USB DFU! But SWD and JTAG provide (much better) debugging capabilities.<br />
<br />
===SWD===<br />
<br />
[http://www.arm.com/products/system-ip/debug-trace/coresight-soc-components/serial-wire-debug.php ARM Serial Wire Debug (SWD)] is a program and debug protocol for ARM processors. It's a low pin count and high-performance alternative and replacement to JTAG.<br />
<br />
===JTAG===<br />
<br />
JTAG is a industry standard on-chip debugging protocoll. It can be used for one or more chips (daisy chained), for interfacing with the chip as well as flashing software.<br />
<br />
[[DevGuide/OpenOCD]] can be used for interfacing with JTAG hardware (e.g. FTDI chips).<br />
<br />
==[[CricketProbe/v1.00 | CricketProbe v1.00]]==<br />
<br />
[[Image:CricketProbe_v100.jpg|300px|left|link=CricketProbe/v1.00 |CricketProbe v1.00 page]]<br />
<br />
The CricketProbe is a programming and debugging tool for ARM Cortex MCU, based on [http://www.blacksphere.co.nz Black Sphere Technologies] [http://www.blacksphere.co.nz/main/blackmagic Black Magic Probe].<br />
<br />
<br style="clear:both"><br />
<br />
==Lyorak Probe==<br />
<br />
[[Image:Lyorak_front.jpg|300px|Lyorak probe]] <br />
[[Image:Lyorak_pinout.jpeg|500px|Lyorak probe pinout]] <br />
<br />
The Lyorak probe is a programming and debugging tool for ARM Cortex MCU, based on the [http://www.blacksphere.co.nz/main/blackmagic Black Magic Probe]. <br/><br />
Designed with 1206 SMD components for easy assmbly and a CAN interface.<br />
<br />
<br style="clear:both"><br />
<br />
===Documentation===<br />
<br />
[https://github.com/molnarkares/blackmagic/tree/master/hardware/contrib/lyorak molnarkares/blackmagic git repo (fork from blackmagic)]<br />
<br />
=Black Magic Probe=<br />
<br />
[[Image:BMPM_1_top.jpg|300px|Black Magic Probe]]<br />
[[Image:BMPM_1_bottom.jpg|300px|Black Magic Probe]]<br />
<br />
This is the original [http://www.blacksphere.co.nz/main/blackmagic Black Magic Probe] from [http://www.blacksphere.co.nz Black Sphere Technologies], a programming and debugging tool for ARM Cortex MCU.<br />
<br />
<br style="clear:both"><br />
<br />
===Documentation===<br />
<br />
[https://github.com/blacksphere/blackmagic blacksphere/blackmagic git repo]<br />
[http://www.blacksphere.co.nz/main/index.php/blackmagic] <br />
[http://1bitsquared.com/collections/supporting-hardware/products/black-magic-probe Buy at 1bitsquared for 65$]<br />
<br />
=[[STLink]]=<br />
<br />
[[Image:St-link.jpg|300px]]<br />
<br />
Most STM discovery / eval boards comes with a [http://www.st.com/web/catalog/tools/FM146/CL1984/SC724/SS1677/PF251168 ST-Link V2] on board, with one exception; the STM32VL version, that board comes with ST-Link V1.<br />
<br />
These can be used with [https://github.com/texane/stlink texane’s] tools, or reflashed with [[STLink#Update_the_ST-Link_to_blackmagic_probe| the blackmagic firmware]].<br />
<br />
<br style="clear:both"><br />
<br />
==Clones==<br />
<br />
There are some variations of the STLink available. Some with the same STM32F103C8T6 MCU, some with one below.<br/><br />
More informations on the [[STLink#Clones]] page.<br/><br />
Again, these can be used with (texanes) STLink or Blackmagic software.<br />
<br />
=FLOSS JTAG=<br />
<br />
[[Image:Jtag-up.jpg|300px|FLOSS JTAG top]]<br />
[[Image:Jtag-down.jpg|300px|FLOSS JTAG bottom]]<br />
<br />
The FLOSS JTAG is based on an FTDI 2232HL chip that allows two simultaneous USB connections, which means that FLOSS JTAG allows JTAG and UART simultaneously.<br/><br />
<br />
The upper side contains the JTAG connector and two sets of RX/TX LEDs for JTAG and UART/COM interface separately. The JTAG connector is 2x5 pins, 0.05-inch pitch, and is compatible with the Samtec FFSD-05-D-06.00-01-N-RW-R ribbon cable.<br />
<br />
On the bottom side there is 4 pin UART connector, which contains (from top to bottom on the image, or color dots): Ground (black), RX (orange), TX (yellow), and +5V (red) <br />
<br />
<br style="clear:both"><br />
<br />
Can be used with [[DevGuide/OpenOCD]] software.<br />
===Documentation===<br />
<br />
[http://randomprojects.org/wiki/Floss-JTAG randomprojects.org/wiki/Floss-JTAG]<br />
<br />
=FT2232H Mini Module=<br />
<br />
[[Image:AlternativeFlossJtag.png|300px|FT2232H Mini Modules as JTAG adapter]]<br />
[[Image:FT2232H_Mini_Module_front.jpg|200px|Top with all necessary connections]]<br />
[[Image:FT2232H_Mini_Module_back.jpg|200px|Bottom with pin headers]]<br />
<br />
<br style="clear:both"><br />
<br />
The FT2232H Mini modules can be used with blackmagic firmware or as FLOSS-JTAG device. <br/><br />
<br />
'''Important'''<br />
<br />
Out of the box, there is NO power supply for the FT2232H because this can either done with USB or external 5V.<br/><br />
The pictures above show two different PCB versions. The suggested connections only apply to the right (latest) layout.<br />
<br />
Connect: (for power supply over USB)<br />
* CN3 pin 1 to CN3 pin 3<br />
* CN2 pin group 1,3,5 to CN2 pin group 11,21 and to CN3 pin group 12,22<br />
<br />
'''Pinout'''<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="6"<br />
|+'''UART'''<br />
!''Use''!!''Pin''!!''Name''<br />
|-<br />
|UART1 RX ||CN2-10||ADBUS1<br />
|-<br />
|UART1 TX ||CN2-7||ADBUS0<br />
|-<br />
|UART2 RX ||CN3-25||BDBUS1<br />
|-<br />
|UART2 TX ||CN3-26||BDBUS0<br />
|}<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="6"<br />
|+'''JTAG'''<br />
!''Use''!!''Pin''!!''Name''<br />
|-<br />
|JTAG1 TCK ||CN2-7||ADBUS0<br />
|-<br />
|JTAG1 TDI ||CN2-10||ADBUS1<br />
|-<br />
|JTAG1 TDO ||CN2-9||ADBUS2<br />
|-<br />
|JTAG1 TMS ||CN2-12||ADBUS3<br />
|-<br />
|JTAG2 TCK ||CN3-26||BDBUS0<br />
|-<br />
|JTAG2 TDI ||CN3-25||BDBUS1<br />
|-<br />
|JTAG2 TDO ||CN3-24||BDBUS2<br />
|-<br />
|JTAG2 TMS ||CN3-23||BDBUS3<br />
|}<br />
<br />
===Blackmagic firmware===<br />
<br />
First, get the VID/PID for your FT2232 device using 'lsusb'. Edit the file<br />
'src/libftdi/platform.h' and change the VID/PID to match your hardware.<br />
Compile the application with the command:<br />
<br />
make PROBE_HOST=libftdi<br />
<br />
===Use as FLOSS-JTAG===<br />
<br />
With the tool "FT_Prog" change the description the FT2232H to "FLOSS-JTAG".<br />
<br />
===Documentation===<br />
<br />
[http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT2232H.pdf FT2232H Datasheet] <br/><br />
[http://www.ftdichip.com/Support/Documents/DataSheets/Modules/DS_FT2232H_Mini_Module.pdf FT2232H Mini Module Datatsheet] <br/><br />
[http://at.mouser.com/ProductDetail/FTDI/FT2232H-MINI-MODULE/?qs=sGAEpiMZZMvOu2nvEqRMlAhGRrWaSCdm Mouser shop 22€]<br />
<br />
=Blackmagic Probe usage=<br />
<br />
In the wiki (under [Developer_Guide]) is already some helpful information:<br />
* Use Blackmagic Probe with Eclipse [[RT_Paparazzi#Debugging_with_an_Eclipse_IDE]].<br />
* General OpenOCD/GDB commands in reagards of the BMP, also about SWD [[DevGuide/GDB_OpenOCD_Debug#Debugging_with_GDB_over_JTAG]] [[DevGuide/GDB_OpenOCD_Debug#Black_Magic_Probe]].<br />
<br />
===Upgrade BMP firmware===<br />
<br />
Check firmware version:<br />
$ arm-none-eabi-gdb<br />
(gdb) target extended-remote /dev/ttyACM0<br />
(gdb) monitor version<br />
<br />
Download source from git, compile:<br />
$ git clone https://github.com/blacksphere/blackmagic<br />
$ cd blackmagic<br />
$ git submodule init<br />
$ git submodule update<br />
$ make<br />
$ cd src<br />
$ make clean<br />
$ make PROBE_HOST=naive<br />
$ cd ../scripts<br />
Connect the Blackmagic Probe to USB while holding down the button for firmware update, then start "stm32_mem.py".<br />
$ stm32_mem.py ../src/blackmagic.bin<br />
<br />
You can build different targets (Hardware Platforms), default value is;<br />
<br />
$ make PROBE_HOST=naive<br />
<br />
[[Category:Hardware]]</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=STLink&diff=19801STLink2015-04-24T21:57:46Z<p>NeoFromMatrix: </p>
<hr />
<div><div style="float: right; width: 20%"><br />
<categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Firmware Flashing</categorytree><br />
</div><br />
<br />
<div style="float: right; width: 60%"><br />
[[Image:St-link.jpg|right|450px]]<br />
</div><br />
__TOC__<br />
<br />
<br />
Every STM discovery / eval board comes with a [http://www.st.com/web/catalog/tools/FM146/CL1984/SC724/SS1677/PF251168 ST-Link V2] on board, with one exception; the STM32VL version comes with a ST-Link V1.<br />
<br />
==SWD Header==<br />
<br />
[[Image:swd_header_discovery_board.png|250px|Pinout with Apogee connector]]<br />
<br />
==Install Software==<br />
<br />
The ''st-flash'' and ''st-util'' tools are needed, provied by [https://github.com/texane/stlink texane]<br />
<br />
Download and compile<br />
$ cd /opt<br />
$ git clone git://github.com/texane/stlink.git stlink<br />
$ cd stlink<br />
$ ./autogen.sh<br />
$ ./configure<br />
$ make<br />
<br />
Set enviroment variable<br />
$ exportline="PATH=$PATH:/opt/stlink"<br />
$ if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi<br />
$ source ~/.profile<br />
<br />
Add udev rules <br />
$ sudo cp /opt/stlink/49-stlinkv*.rules /etc/udev/rules.d<br />
$ sudo udevadm control --reload-rules<br />
<br />
ST-LinkV1 requires a bit different treatment, read the [https://github.com/texane/stlink/blob/master/README Readme.txt]<br />
<br />
==Airframe.xml setup==<br />
<br />
Connect the ST-Link to the MCU.<br />
If a complete STM32Fx-Discovery board is used, CN3 jumpers need to be set. To program a external MCU, remove CN3 jumpers and connect the external MCU with the SWD header.<br />
<br />
To use SWD via STLink as default:<br/><br />
Set '''FLASH_MODE=STLINK'''<br/><br />
<br />
==Update the ST-Link to blackmagic probe==<br />
<br />
The STM32F103 (STLink MCU) can be flashed with the blackmagic's firware.<br/><br />
<br />
===Two STLinkV2 Method===<br />
<br />
Use one STLink to flash another<br />
<br />
Hardware Setup:<br />
One STLinkV2 (connected via USB) is programming the other one. Change the 4 Solder jumpers on the bottom of the target STLinkV2 from "DEFAULT" to "REVERSED".<br/><br />
<br />
Connections between the two STLinks<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="6"<br />
|+'''Connections [Header-Pin]'''<br />
!''Use''!!''From Programmer''!!''To Target''<br />
|-<br />
|5V||P2-5V||P2-5V<br />
|-<br />
|SWDIO||CN2-4||CN3-2<br />
|-<br />
|SWDCLK||CN2-2||CN3-3<br />
|-<br />
|GND||CN2-3||CN3-4<br />
|}<br />
<br />
Download and build the Firmware<br />
git clone https://github.com/blacksphere/blackmagic<br />
cd blackmagic<br />
git submodule init<br />
git submodule update<br />
make<br />
cd src<br />
make clean<br />
make PROBE_HOST=stlink<br />
<br />
Remove the readout protection, erase and flash<br />
openocd -f interface/stlink-v2.cfg -f target/stm32f1x_stlink.cfg -c "init" -c "halt" -c "stm32f1x unlock 0" -c "shutdown"<br />
st-flash erase<br />
st-flash --reset write blackmagic.bin 0x8002000<br />
st-flash write blackmagic_dfu.bin 0x8000000<br />
<br />
===Documentation===<br />
<br />
[http://esden.net/2014/12/29/black-magic-discovery Black Magic Discovery from Esden] <-- This also describes how to remove the read out protection. <br/><br />
[http://embdev.net/articles/STM_Discovery_as_Black_Magic_Probe embdev.net page]<br />
<br />
==BMP Method==<br />
<br />
Use a BMP to flash a STLink<br />
<br />
Transfer the solder jumpers from "Default" to "Reversed" and build the firmware as descibed above.<br/><br />
Connect the BMP to the CN2 header (see Pinout above).<br />
<br />
Start gdb, erase the option bytes and flash BMP<br />
(gdb) target extended-remote /dev/ttyACM0<br />
(gdb) mon swdp_scan<br />
(gdb) att 1 <br />
(gdb) mon option erase<br />
(gdb) load /dir/to/blackmagic<br />
(gdb) load /dir/to/blackmagic_dfu<br />
(gdb) detach<br />
<br />
The option bytes do not cover the Readout Protection (RDP), but the RDP is disabled anyhow...<br />
<br />
==Clones==<br />
<br />
There are also some chinese clones out there. Some with the identical MCU, and some also with an other.<br />
<br />
See also https://github.com/blacksphere/blackmagic/issues/62<br />
<br />
[[Category:Firmware Flashing]] [[Category:Developer_Documentation]]</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=STLink&diff=19800STLink2015-04-24T21:36:55Z<p>NeoFromMatrix: /* BMP Method */</p>
<hr />
<div><div style="float: right; width: 20%"><br />
<categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Firmware Flashing</categorytree><br />
</div><br />
<br />
<div style="float: right; width: 60%"><br />
[[Image:St-link.jpg|right|450px]]<br />
</div><br />
__TOC__<br />
<br />
<br />
Every STM discovery / eval board comes with a [http://www.st.com/web/catalog/tools/FM146/CL1984/SC724/SS1677/PF251168 ST-Link V2] on board, with one exception; the STM32VL version comes with a ST-Link V1.<br />
<br />
==SWD Header==<br />
<br />
[[Image:swd_header_discovery_board.png|250px|Pinout with Apogee connector]]<br />
<br />
==Install Software==<br />
<br />
The ''st-flash'' and ''st-util'' tools are needed, provied by [https://github.com/texane/stlink texane]<br />
<br />
Download and compile<br />
$ cd /opt<br />
$ git clone git://github.com/texane/stlink.git stlink<br />
$ cd stlink<br />
$ ./autogen.sh<br />
$ ./configure<br />
$ make<br />
<br />
Set enviroment variable<br />
$ exportline="PATH=$PATH:/opt/stlink"<br />
$ if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi<br />
$ source ~/.profile<br />
<br />
Add udev rules <br />
$ sudo cp /opt/stlink/49-stlinkv*.rules /etc/udev/rules.d<br />
$ sudo udevadm control --reload-rules<br />
<br />
ST-LinkV1 requires a bit different treatment, read the [https://github.com/texane/stlink/blob/master/README Readme.txt]<br />
<br />
==Airframe.xml setup==<br />
<br />
Connect the ST-Link to the MCU.<br />
If a complete STM32Fx-Discovery board is used, CN3 jumpers need to be set. To program a external MCU, remove CN3 jumpers and connect the external MCU with the SWD header.<br />
<br />
To use SWD via STLink as default:<br/><br />
Set '''FLASH_MODE=STLINK'''<br/><br />
<br />
==Update the ST-Link to blackmagic probe==<br />
<br />
The STM32F103 (STLink MCU) can be flashed with the blackmagic's firware.<br/><br />
<br />
===Two STLinkV2 Method===<br />
<br />
Use one STLink to flash another<br />
<br />
Hardware Setup:<br />
One STLinkV2 (connected via USB) is programming the other one. Change the 4 Solder jumpers on the bottom of the target STLinkV2 from "DEFAULT" to "REVERSED".<br/><br />
<br />
Connections between the two STLinks<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="6"<br />
|+'''Connections [Header-Pin]'''<br />
!''Use''!!''From Programmer''!!''To Target''<br />
|-<br />
|5V||P2-5V||P2-5V<br />
|-<br />
|SWDIO||CN2-4||CN3-2<br />
|-<br />
|SWDCLK||CN2-2||CN3-3<br />
|-<br />
|GND||CN2-3||CN3-4<br />
|}<br />
<br />
Download and build the Firmware<br />
git clone https://github.com/blacksphere/blackmagic<br />
cd blackmagic<br />
git submodule init<br />
git submodule update<br />
make<br />
cd src<br />
make clean<br />
make PROBE_HOST=stlink<br />
<br />
Remove the readout protection, erase and flash<br />
openocd -f interface/stlink-v2.cfg -f target/stm32f1x_stlink.cfg -c "init" -c "halt" -c "stm32f1x unlock 0" -c "shutdown"<br />
st-flash erase<br />
st-flash --reset write blackmagic.bin 0x8002000<br />
st-flash write blackmagic_dfu.bin 0x8000000<br />
<br />
===Documentation===<br />
<br />
[http://esden.net/2014/12/29/black-magic-discovery Black Magic Discovery from Esden] <-- This also describes how to remove the read out protection. <br/><br />
[http://embdev.net/articles/STM_Discovery_as_Black_Magic_Probe embdev.net page]<br />
<br />
==BMP Method==<br />
<br />
Use a BMP to flash a STLink<br />
<br />
Transfer the solder jumpers from "Default" to "Reversed" and build the firmware as descibed above.<br/><br />
Connect the BMP to the CN2 header (see Pinout above).<br />
<br />
Start gdb, erase the option bytes and flash BMP<br />
(gdb) target extended-remote /dev/ttyACM0<br />
(gdb) mon swdp_scan<br />
(gdb) att 1 <br />
(gdb) mon option erase<br />
(gdb) load /dir/to/blackmagic<br />
(gdb) load /dir/to/blackmagic_dfu<br />
(gdb) detach<br />
<br />
The option bytes do not cover the Readout Protection (RDP), but the RDP is disabled anyhow...<br />
<br />
[[Category:Firmware Flashing]] [[Category:Developer_Documentation]]</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=STLink&diff=19744STLink2015-04-14T12:47:36Z<p>NeoFromMatrix: /* Update the ST-Link to blackmagic probe */</p>
<hr />
<div><div style="float: right; width: 20%"><br />
<categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Firmware Flashing</categorytree><br />
</div><br />
<br />
<div style="float: right; width: 60%"><br />
[[Image:St-link.jpg|right|450px]]<br />
</div><br />
__TOC__<br />
<br />
<br />
Every STM discovery / eval board comes with a [http://www.st.com/web/catalog/tools/FM146/CL1984/SC724/SS1677/PF251168 ST-Link V2] on board, with one exception; the STM32VL version comes with a ST-Link V1.<br />
<br />
==SWD Header==<br />
<br />
[[Image:swd_header_discovery_board.png|250px|Pinout with Apogee connector]]<br />
<br />
==Install Software==<br />
<br />
The ''st-flash'' and ''st-util'' tools are needed, provied by [https://github.com/texane/stlink texane]<br />
<br />
Download and compile<br />
$ cd /opt<br />
$ git clone git://github.com/texane/stlink.git stlink<br />
$ cd stlink<br />
$ ./autogen.sh<br />
$ ./configure<br />
$ make<br />
<br />
Set enviroment variable<br />
$ exportline="PATH=$PATH:/opt/stlink"<br />
$ if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi<br />
$ source ~/.profile<br />
<br />
Add udev rules <br />
$ sudo cp /opt/stlink/49-stlinkv*.rules /etc/udev/rules.d<br />
$ sudo udevadm control --reload-rules<br />
<br />
ST-LinkV1 requires a bit different treatment, read the [https://github.com/texane/stlink/blob/master/README Readme.txt]<br />
<br />
==Airframe.xml setup==<br />
<br />
Connect the ST-Link to the MCU.<br />
If a complete STM32Fx-Discovery board is used, CN3 jumpers need to be set. To program a external MCU, remove CN3 jumpers and connect the external MCU with the SWD header.<br />
<br />
To use SWD via STLink as default:<br/><br />
Set '''FLASH_MODE=STLINK'''<br/><br />
<br />
==Update the ST-Link to blackmagic probe==<br />
<br />
The STM32F103 (STLink MCU) can be flashed with the blackmagic's firware.<br/><br />
<br />
===Two STLinkV2 Method===<br />
<br />
Use one STLink to flash another<br />
<br />
Hardware Setup:<br />
One STLinkV2 (connected via USB) is programming the other one. Change the 4 Solder jumpers on the bottom of the target STLinkV2 from "DEFAULT" to "REVERSED".<br/><br />
<br />
Connections between the two STLinks<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="6"<br />
|+'''Connections [Header-Pin]'''<br />
!''Use''!!''From Programmer''!!''To Target''<br />
|-<br />
|5V||P2-5V||P2-5V<br />
|-<br />
|SWDIO||CN2-4||CN3-2<br />
|-<br />
|SWDCLK||CN2-2||CN3-3<br />
|-<br />
|GND||CN2-3||CN3-4<br />
|}<br />
<br />
Download and build the Firmware<br />
git clone https://github.com/blacksphere/blackmagic<br />
cd blackmagic<br />
git submodule init<br />
git submodule update<br />
make<br />
cd src<br />
make clean<br />
make PROBE_HOST=stlink<br />
<br />
Remove the readout protection, erase and flash<br />
openocd -f interface/stlink-v2.cfg -f target/stm32f1x_stlink.cfg -c "init" -c "halt" -c "stm32f1x unlock 0" -c "shutdown"<br />
st-flash erase<br />
st-flash --reset write blackmagic.bin 0x8002000<br />
st-flash write blackmagic_dfu.bin 0x8000000<br />
<br />
===Documentation===<br />
<br />
[http://esden.net/2014/12/29/black-magic-discovery Black Magic Discovery from Esden] <-- This also describes how to remove the read out protection. <br/><br />
[http://embdev.net/articles/STM_Discovery_as_Black_Magic_Probe embdev.net page]<br />
<br />
==BMP Method==<br />
<br />
Use a BMP to flash a STLink<br />
<br />
Transfer the solder jumpers from "Default" to "Reversed" and build the firmware as descibed above.<br/><br />
Connect the BMP to the CN2 header (see Pinout above).<br />
<br />
Start gdb, erase the option bytes and flash BMP<br />
(gdb) target extended-remote /dev/ttyACM0<br />
(gdb) mon swdp_scan<br />
(gdb) att 1 <br />
(gdb) mon option erase<br />
(gdb) load /dir/to/blackmagic<br />
(gdb) load /dir/to/blackmagic_dfu<br />
(gdb) detach<br />
<br />
The option bytes do not cover the Readout Protection (RDP), but it seems that this command erases it also.<br />
<br />
[[Category:Firmware Flashing]] [[Category:Developer_Documentation]]</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=DevGuide/GDB_OpenOCD_Debug&diff=19742DevGuide/GDB OpenOCD Debug2015-04-14T10:31:41Z<p>NeoFromMatrix: </p>
<hr />
<div>== GDB ==<br />
<br />
Commands can often be issued without typing the entire command. Here are some commonly used commands; many of them can be invoked using only the first letter:<br />
(gdb) quit – exit the debugger<br />
(gdb) file – load an executable file<br />
(gdb) break line-number/function name -- Set a break-point on a line/at start of function<br />
(gdb) run <args> -- start running the program; if there are command-line arguments, put them after the run invocation<br />
(gdb) cont -- continue running, after a break<br />
(gdb) next -- Next program line (step over function calls)<br />
(gdb) step -- Step into function calls.<br />
(gdb) finish - Step out of the present function<br />
(gdb) print expression -- Show value of a variable or expression<br />
(gdb) list – List 10 lines of the program being debugged. The sixth line is the preset statement. Subsequent, consecutive entry of list will list the next 10 lines.<br />
(gdb) where – obtain a backtrace showing all function calls before the current statement<br />
(gdb) up – Move to the function that called the present function. Useful if your program crashes in a library function; use up to get to the last function call in your program<br />
(gdb) down – Reverses the action of up<br />
(gdb) delete – Removes breakpoint by number (see example following). If no number, all deleted.<br />
(gdb) kill – Terminates the program.<br />
<br />
== GDB - OpenOCD - Floss JTAG ==<br />
<br />
Connecting OpenOCD to a Floss JTAG (Lisa/L in this case) an GDB to OpenOCD.<br />
<br />
# Start openocd in a new shell since this process needs to remain running.<br />
#* STM targets<br />
#: To connect to the Lisa/L board run the command<br />
#:<pre>openocd -f interface/lisa-l.cfg -f board/lisa-l.cfg</pre><br />
#: To connect to the Lisa/M board via FLOSS-JTAG run the command:<br />
#:<pre>openocd -f interface/flossjtag.cfg -f board/lisa-l.cfg</pre><br />
#* NXP LPC targets<br />
#: To connect to the LPC based board via OLIMEX ARM-USB-OCD dongle run the command:<br />
#:<pre>openocd -f interface/olimex-arm-usb-ocd.cfg -f target/lpc2148.cfg</pre><br />
#: To connect to the LPC based board via OLIMEX ARM-USB-OCD-H dongle run the command:<br />
#:<pre>openocd -f interface/olimex-arm-usb-ocd-h.cfg -f target/lpc2148.cfg</pre><br />
<br />
# Compiler Debug Options<br />
#: On LPC target build your ap file with debug options. See https://github.com/elemhsb/paparazzi/blob/v4.0/conf/Makefile.lpc21 .<br />
<br />
# Start GDB with an argument of the elf file created and uploaded to the board.<br />
#: If you programmed with the ap target then the command would be along the lines of<br />
#:<pre>/opt/paparazzi/arm-multilib/bin/arm-none-eabi-gdb var/<airframe>/ap/ap.elf</pre><br />
#: Replace <airframe> with the name of the airframe that has been built.<br />
<br />
# Now connect GDB to the board <br />
#:<pre>target remote localhost:3333</pre><br />
# Now we need to set some break points in the code.<br />
#: In this example the ap target was part of the rotorcraft and main.c contains the main program. Open rotorcraft sw/airborne/firmwares/rotorcraft/main.c and find a line at which you'd like to set a break point.<br />
#: <pre>break main.c:113</pre><br />
# Stop the currently running code<br />
#: <pre>monitor reset halt</pre><br />
# Reset the code back to the start<br />
#: <pre>monitor reset init</pre><br />
# Now we can run the program which will stop at the break point we set.<br />
#:<pre>continue</pre><br />
<br />
== Black Magic Probe specific ==<br />
<br />
# Start GDB for arm<br />
#: Open GDB with the correct binary file<br />
#:<pre>/opt/paparazzi/arm-multilib/bin/arm-none-eabi-gdb ./var/AIRFRAME/ap/ap.elf</pre><br />
#: Set Black Magic Probe as Target over the serial link (see ls /dev/ttyACM*):<br />
#:<pre>target extended-remote /dev/ttyACM0</pre><br />
#: Probe via JTAG to get a list of devices:<br />
#:<pre>mon jtag_scan</pre><br />
#: (for [[Lisa/S]], use ''swdp_scan'' instead of ''jtag_scan'')<br />
#:<br />
#: Attach to a device:<br />
#:<pre>attach 1</pre><br />
# Happy Debugging!<br />
<br />
=== Useful GDB commands ===<br />
<br />
Also look at [[DevGuide/GDB_OpenOCD_Debug#GDB]] for general GDB commands<br />
<br />
To display some commands for BMP<br />
monitor help<br />
example output fot STM32F4<br />
<pre><br />
General commands:<br />
version -- Display firmware version info<br />
help -- Display help for monitor commands<br />
jtag_scan -- Scan JTAG chain for devices<br />
swdp_scan -- Scan SW-DP for devices<br />
targets -- Display list of available targets<br />
morse -- Display morse error message<br />
connect_srst -- Configure connect under SRST: (enable|disable)<br />
ARM Cortex-M specific commands:<br />
vector_catch -- Catch exception vectors<br />
STM32F4 specific commands:<br />
erase_mass -- Erase entire flash memory<br />
option -- Manipulate option bytes<br />
<br />
</pre><br />
<br />
* We probably want to ignore the interrupt calls for the moment so we can step through the code as it's being called. Note that we don't always want to do this. (STM32 command only)<br />
*:<pre>monitor cortex_m3 maskisr on</pre><br />
* A stack trace can be printed with the command<br />
*:<pre>bt</pre><br />
* show the variable of a variable<br />
*:<pre>print i2c1.status</pre><br />
* Show (eXamine) the value of the 9 bytes hardware register at address 0x40005800 and show them in hex format:<br />
*:<pre>x/9x 0x40005800</pre><br />
* In some cases you may not be able to access some memory areas in the mcu, in that case you should try:<br />
*:<pre>set mem inaccessible-by-default off</pre><br />
<br />
=== .gdbinit for BMP ===<br />
<br />
The standard commands like setting the ttyACM0 port, searching for targets and attaching one can be automated. Either with a ".gdbinit" file or if your work with Eclipse, there is a box at Debug configutations/Startup.<br />
<br />
One Example from [http://docs.armstrap.org/en/latest/getting-started-eclipse-development-tools.html| armstrap]<br />
<br />
<pre><br />
target extended-remote /dev/ttyACM0<br />
mon swdp_scan<br />
attach 1<br />
monitor vector_catch disable hard<br />
set mem inaccessible-by-default off<br />
set print pretty<br />
</pre><br />
<br />
=== Setting up .gdbinit for BMP and gdb-regview ===<br />
<br />
If you use gdb just with a BMP, you can set some initialization commands in ~/.gdbinit that will run when gdb is started, improving workflow.<br />
<br />
A very useful plug-in called gdb-regview [https://github.com/fnoble/gdb-regview (available on GitHub)] can really speedup debugging stm32 processors by providing a pretty-printed summary of register contents.<br />
<br />
A sample file for debugging Lisa/M 2.0 would be:<br />
<pre><br />
set target-async on<br />
set mem inaccessible-by-default off<br />
#for gdb-regview plugin<br />
source /path/to/gdb-regview/gdb-regview.py<br />
regview load /path/to/gdb-regview/defs/STM32F10X_CL.xml<br />
tar ext /dev/BMP_DEVICE<br />
mon version<br />
mon swdp_scan<br />
att 1<br />
</pre><br />
<br />
This should be saved in <tt>~/.gdbinit</tt>.<br />
<br />
Then, after one starts gdb as described above, you can view registers easily, for example:<br />
<pre>(gdb) regview show ADC_CR1</pre><br />
<br />
=== Load new binary from gdb with BMP ===<br />
<br />
It is also easy to rebuild and reload a program from inside gdb. Calling make from the gdb command line will call make in your current directory:<br />
<pre>(gdb) make</pre><br />
<br />
To load a new elf file into gdb after compiling elsewhere (only required when changing the name of the file):<br />
<pre>(gdb) file file_name.elf</pre><br />
<br />
To upload the binary as per the currently loaded elf:<br />
<pre>(gdb) load</pre><br />
This assumes you have attached to the target already (as per the .gdbinit example just above).<br />
<br />
To restart the program from the beginning:<br />
<pre>(gdb) run</pre><br />
and enter <tt>y</tt>.<br />
<br />
gdb should detect that the elf has changed when loading the new binary, so if the file name has not changed, one should just be able to rebuild (make from inside gdb if appropriate) and then call load and run.<br />
<br />
[[Category:Hardware]] [[Category:Software]] [[Category:Developer_Documentation]]</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=DevGuide/GDB_OpenOCD_Debug&diff=19741DevGuide/GDB OpenOCD Debug2015-04-14T10:29:59Z<p>NeoFromMatrix: </p>
<hr />
<div>== GDB ==<br />
<br />
Commands can often be issued without typing the entire command. Here are some commonly used commands; many of them can be invoked using only the first letter:<br />
(gdb) quit – exit the debugger<br />
(gdb) file – load an executable file<br />
(gdb) break line-number/function name -- Set a break-point on a line/at start of function<br />
(gdb) run <args> -- start running the program; if there are command-line arguments, put them after the run invocation<br />
(gdb) cont -- continue running, after a break<br />
(gdb) next -- Next program line (step over function calls)<br />
(gdb) step -- Step into function calls.<br />
(gdb) finish - Step out of the present function<br />
(gdb) print expression -- Show value of a variable or expression<br />
(gdb) list – List 10 lines of the program being debugged. The sixth line is the preset statement. Subsequent, consecutive entry of list will list the next 10 lines.<br />
(gdb) where – obtain a backtrace showing all function calls before the current statement<br />
(gdb) up – Move to the function that called the present function. Useful if your program crashes in a library function; use up to get to the last function call in your program<br />
(gdb) down – Reverses the action of up<br />
(gdb) delete – Removes breakpoint by number (see example following). If no number, all deleted.<br />
(gdb) kill – Terminates the program.<br />
<br />
== GDB - OpenOCD - Floss JTAG ==<br />
<br />
Connecting OpenOCD to a Floss JTAG (Lisa/L in this case) an GDB to OpenOCD.<br />
<br />
# Start openocd in a new shell since this process needs to remain running.<br />
#* STM targets<br />
#: To connect to the Lisa/L board run the command<br />
#:<pre>openocd -f interface/lisa-l.cfg -f board/lisa-l.cfg</pre><br />
#: To connect to the Lisa/M board via FLOSS-JTAG run the command:<br />
#:<pre>openocd -f interface/flossjtag.cfg -f board/lisa-l.cfg</pre><br />
#* NXP LPC targets<br />
#: To connect to the LPC based board via OLIMEX ARM-USB-OCD dongle run the command:<br />
#:<pre>openocd -f interface/olimex-arm-usb-ocd.cfg -f target/lpc2148.cfg</pre><br />
#: To connect to the LPC based board via OLIMEX ARM-USB-OCD-H dongle run the command:<br />
#:<pre>openocd -f interface/olimex-arm-usb-ocd-h.cfg -f target/lpc2148.cfg</pre><br />
<br />
# Compiler Debug Options<br />
#: On LPC target build your ap file with debug options. See https://github.com/elemhsb/paparazzi/blob/v4.0/conf/Makefile.lpc21 .<br />
<br />
# Start GDB with an argument of the elf file created and uploaded to the board.<br />
#: If you programmed with the ap target then the command would be along the lines of<br />
#:<pre>/opt/paparazzi/arm-multilib/bin/arm-none-eabi-gdb var/<airframe>/ap/ap.elf</pre><br />
#: Replace <airframe> with the name of the airframe that has been built.<br />
<br />
# Now connect GDB to the board <br />
#:<pre>target remote localhost:3333</pre><br />
# Now we need to set some break points in the code.<br />
#: In this example the ap target was part of the rotorcraft and main.c contains the main program. Open rotorcraft sw/airborne/firmwares/rotorcraft/main.c and find a line at which you'd like to set a break point.<br />
#: <pre>break main.c:113</pre><br />
# Stop the currently running code<br />
#: <pre>monitor reset halt</pre><br />
# Reset the code back to the start<br />
#: <pre>monitor reset init</pre><br />
# Now we can run the program which will stop at the break point we set.<br />
#:<pre>continue</pre><br />
<br />
== Black Magic Probe specific ==<br />
<br />
# Start GDB for arm<br />
#: Open GDB with the correct binary file<br />
#:<pre>/opt/paparazzi/arm-multilib/bin/arm-none-eabi-gdb ./var/AIRFRAME/ap/ap.elf</pre><br />
#: Set Black Magic Probe as Target over the serial link (see ls /dev/ttyACM*):<br />
#:<pre>target extended-remote /dev/ttyACM0</pre><br />
#: Probe via JTAG to get a list of devices:<br />
#:<pre>mon jtag_scan</pre><br />
#: (for [[Lisa/S]], use ''swdp_scan'' instead of ''jtag_scan'')<br />
#:<br />
#: Attach to a device:<br />
#:<pre>attach 1</pre><br />
# Happy Debugging!<br />
<br />
=== Useful GDB commands ===<br />
<br />
Also look at [DevGuide/GDB_OpenOCD_Debug#GDB] for general GDB commands<br />
<br />
To display some commands for BMP<br />
monitor help<br />
example output fot STM32F4<br />
<pre><br />
General commands:<br />
version -- Display firmware version info<br />
help -- Display help for monitor commands<br />
jtag_scan -- Scan JTAG chain for devices<br />
swdp_scan -- Scan SW-DP for devices<br />
targets -- Display list of available targets<br />
morse -- Display morse error message<br />
connect_srst -- Configure connect under SRST: (enable|disable)<br />
ARM Cortex-M specific commands:<br />
vector_catch -- Catch exception vectors<br />
STM32F4 specific commands:<br />
erase_mass -- Erase entire flash memory<br />
option -- Manipulate option bytes<br />
<br />
</pre><br />
<br />
* We probably want to ignore the interrupt calls for the moment so we can step through the code as it's being called. Note that we don't always want to do this. (STM32 command only)<br />
*:<pre>monitor cortex_m3 maskisr on</pre><br />
* A stack trace can be printed with the command<br />
*:<pre>bt</pre><br />
* show the variable of a variable<br />
*:<pre>print i2c1.status</pre><br />
* Show (eXamine) the value of the 9 bytes hardware register at address 0x40005800 and show them in hex format:<br />
*:<pre>x/9x 0x40005800</pre><br />
* In some cases you may not be able to access some memory areas in the mcu, in that case you should try:<br />
*:<pre>set mem inaccessible-by-default off</pre><br />
<br />
=== .gdbinit for BMP ===<br />
<br />
The standard commands like setting the ttyACM0 port, searching for targets and attaching one can be automated. Either with a ".gdbinit" file or if your work with Eclipse, there is a box at Debug configutations/Startup.<br />
<br />
One Example from [http://docs.armstrap.org/en/latest/getting-started-eclipse-development-tools.html| armstrap]<br />
<br />
<pre><br />
target extended-remote /dev/ttyACM0<br />
mon swdp_scan<br />
attach 1<br />
monitor vector_catch disable hard<br />
set mem inaccessible-by-default off<br />
set print pretty<br />
</pre><br />
<br />
=== Setting up .gdbinit for BMP and gdb-regview ===<br />
<br />
If you use gdb just with a BMP, you can set some initialization commands in ~/.gdbinit that will run when gdb is started, improving workflow.<br />
<br />
A very useful plug-in called gdb-regview [https://github.com/fnoble/gdb-regview (available on GitHub)] can really speedup debugging stm32 processors by providing a pretty-printed summary of register contents.<br />
<br />
A sample file for debugging Lisa/M 2.0 would be:<br />
<pre><br />
set target-async on<br />
set mem inaccessible-by-default off<br />
#for gdb-regview plugin<br />
source /path/to/gdb-regview/gdb-regview.py<br />
regview load /path/to/gdb-regview/defs/STM32F10X_CL.xml<br />
tar ext /dev/BMP_DEVICE<br />
mon version<br />
mon swdp_scan<br />
att 1<br />
</pre><br />
<br />
This should be saved in <tt>~/.gdbinit</tt>.<br />
<br />
Then, after one starts gdb as described above, you can view registers easily, for example:<br />
<pre>(gdb) regview show ADC_CR1</pre><br />
<br />
=== Load new binary from gdb with BMP ===<br />
<br />
It is also easy to rebuild and reload a program from inside gdb. Calling make from the gdb command line will call make in your current directory:<br />
<pre>(gdb) make</pre><br />
<br />
To load a new elf file into gdb after compiling elsewhere (only required when changing the name of the file):<br />
<pre>(gdb) file file_name.elf</pre><br />
<br />
To upload the binary as per the currently loaded elf:<br />
<pre>(gdb) load</pre><br />
This assumes you have attached to the target already (as per the .gdbinit example just above).<br />
<br />
To restart the program from the beginning:<br />
<pre>(gdb) run</pre><br />
and enter <tt>y</tt>.<br />
<br />
gdb should detect that the elf has changed when loading the new binary, so if the file name has not changed, one should just be able to rebuild (make from inside gdb if appropriate) and then call load and run.<br />
<br />
[[Category:Hardware]] [[Category:Software]] [[Category:Developer_Documentation]]</div>NeoFromMatrixhttp://wiki.paparazziuav.org/w/index.php?title=RT_Paparazzi&diff=19726RT Paparazzi2015-04-08T17:05:57Z<p>NeoFromMatrix: </p>
<hr />
<div>= Real Time (RT) Paparazzi =<br />
<br />
== Introduction ==<br />
<br />
the '''RT Paparazzi''' initiative is a step towards extended flexibility for the core autopilot. In a real time operating system (RTOS) [http://en.wikipedia.org/wiki/Real-time_operating_system] multiple threads are available, which are doing specific jobs e.g. a telemetry thread, a radio thread, a failsafe thread, at a defined rate. Unlike ''bare-metal'' application which uses interrupt driven timers for timing tasks, real time OS has a kernel which takes care of scheduling and running the threads. Having a kernel, it is possible to set priority of each thread, how much memory it takes etc.etc. which gives the developer more control over timing and resource managment.<br />
<br />
Besides kernel, a typical RTOS also has a harware abstraction layer (HAL) which stands between user application and actual hardware, so the core autopilot developer doesn't have to worry to much about writing drivers for the sensor to use.<br />
<br />
One of the strengths of Paparazzi is it's modularity - combining this with precise timing, scheduling and resource management a RTOS brings along, Paparazzi is now in a position to exceed even the leading commecial closed-source UAs autopilots.<br />
<br />
= Paparazzi with ChibiOS/RT =<br />
<br />
RT Paparazzi is based on ChibiOS/RT [http://chibios.org/dokuwiki/doku.php]. ChibiOS/RT supports basically all architectures that standard Paparazzi does (see [http://chibios.org/dokuwiki/doku.php?id=chibios:architectures]), which makes both systems compatible. Since RTOS makes handling multiple I/O easier, but comes with some extra overhead (context switching, kernel code), it gives most leverage to to STM32 F1xx and F4xx based autopilots ([[Apogee/v1.00]],[[Lisa/M_v20]], [[Lisa/S]], [[STM32F4_Discovery]], [[KroozSD]]...).<br />
<br />
The development of RT Paparazzi with ChibeOS was started by the AggieAir team [http://aggieair.usu.edu/] at Utah State University.<br />
<br />
== Getting the sourcecode ==<br />
<br />
Most recent code is available under ''rt_paparazzi'' branch from Paparazzi Git repo [https://github.com/paparazzi/paparazzi], however you can check these two repositories too ([https://github.com/podhrmic/ChibiOS-RT] and [https://github.com/podhrmic/paparazzi])<br />
<br />
<br />
== Debugging with an Eclipse IDE ==<br />
<br />
Having a good development and debugging environment is a must for developing RT embedded system. The steps of setting up Eclipse IDE are described here [http://chibios.org/dokuwiki/doku.php?id=chibios:guides:eclipse1] and here [http://chibios.org/dokuwiki/doku.php?id=chibios:guides:eclipse2].<br />
<br />
An alternative guide is for example here [http://embeddedprogrammer.blogspot.com/2012/09/stm32f4discovery-development-with-gcc.html]<br />
<br />
Another great tutorial for setting up Eclipse is done by [http://docs.armstrap.org/en/latest/getting-started-eclipse-development-tools.html| armstrap].<br/><br />
With blacmagic probe integration, without Eclipse Arm Plugin.<br />
<br />
Just a few notes to the process:<br />
* it is preferred to switch-off compiler optimization for debugging (use ''-O0'' in compiler settings in Makefile for given architecture)<br />
* install GCC Arm Embedded toolchain [https://launchpad.net/~terry.guo/+archive/gcc-arm-embedded] (recommended anyway for Paparazzi since v 5.0)<br />
* get Black Magic probe from Blacksphere [http://www.blacksphere.co.nz/main/blackmagic], it will make your life easier <br />
* in '''Creating a GDB Debug Configuration''' use the following commands for Black Magic Probe:<br />
target extended-remote /dev/ttyACM0<br />
monitor jtag_scan<br />
attach 1<br />
monitor vector_catch disable hard<br />
set mem inaccessible-by-default off<br />
monitor option erase<br />
set print pretty<br />
(for [[Lisa/M_v2.0#Lisa.2FLia_F4 | Lisa/Lia F4]] board use '' swdp_scan'' instead of ''jtag_scan'')<br />
* if you are using luftboot, don't forget to add image offset into the debug configuration:<br />
[[File:Rt_paparazzi_eclipse_setup_2.png]]<br />
* don't forget in "Eclipse->Window->Preferences->Run/Debug->Launching->Default Launchers->GDB Hardware Debugging" set preferred launcher to "Standard GDB" (otherwise the ChibiOS/RT plugin won't work, tested in Eclipse Kepler Service Release 1):<br />
[[File:Rt_paparazzi_eclipse_setup_1.png]]<br />
<br />
=== ChibiOS Eclipse plugin ===<br />
<br />
A nice and comprehensive guide about how to install ChibiOS plugins is [http://cxkg.net/chibios-board-generator/ here]. <br />
<br />
In case the page is not available, here is an older manual:<br />
* to use ChibiOS/RT debug module for Eclipse, download ChibiStudio (it is for Windows only) from SourceForge [http://sourceforge.net/projects/chibios/files/ChibiStudio/], extract it and from ''ChibiStudio/eclipse/plugins'' copy <br />
org.chibios.tools.eclipse.config_1.2.1.jar<br />
org.chibios.tools.eclipse.debug_1.0.8.jar<br />
to your ''eclipse/plugins'' directory. Restart Eclipse and in "Help->About Eclipe->Installation Details->Plugins" you should see both chibios plugins. Enable the plug-in while in the "Debug" view under: Window->Show View->Other...->ChibiOS/RT->ChibiOS/RT" (see [http://forum.chibios.org/phpbb/viewtopic.php?f=3&t=140] for details)<br />
<br />
=== ChibiOS Tutorials ===<br />
Related videos about setting up Eclipse with ChibiOS plugins (called together ChibiStudio) are available [https://www.youtube.com/playlist?list=PLpDawCIUjDFFXjRFUT9tFcUuuvNb6iT1A here]<br />
<br />
== Compiling Paparazzi code in Eclipse ==<br />
Typical process consists of compiling the autopilot code for given airframe in Paparazzi center, and then running the related debug configuration in Eclipse. The debugger will first recompile whole Paparazzi (e.g. running "make" in Paparazzi home directory), which is not really useful, but bearable.<br />
<br />
In case we want to work with a single aircraft and want Eclipse to also compile the autopilot code, we have to do the following:<br />
# Import paparazzi into eclipse as normal<br />
# in project->properties->c/c++->environment add three variables<br />
## Current_Airframe: set to the name of the airframe you want to build<br />
## PAPARAZZI_HOME: set to the root paparazzi directory<br />
## PAPARAZZI_SRC: set to the root paparazzi directory<br />
# in project->properties->c/c++<br />
## in ''Builder Settings'' Tab<br />
### Uncheck ''Use default build command''<br />
### in build command put: ''make -f Makefile.ac AIRCRAFT=${Current_Airframe}''<br />
## In Behavior Tab<br />
### set the Build field to: ap.compile<br />
### set the Clean field to:clean_ac<br />
<br />
That will compile ''Current_Aiframe'' with target ''ac''. Obviously, if you need a different target, for example ''test_telemetry'', you will have to change the last two steps to ''test_telemetry.compile'' and so on.<br />
<br />
= Paparazzi on Linux =<br />
<br />
Taking the ARDrone 2 base install is a good example how Paparazzi could be used to run the core Autopilot executable<br />
<br />
= RT Paparazzi at ENAC =<br />
<br />
There is an internal project at ENAC of a RT Paparazzi<br />
<br />
= RT Paparazzi on Nuttix =<br />
<br />
There are all reasons to assume the current Paparazzi code can run perfectly on Nuttix, only nobody so far bother to start this effort since the general consensus at the moment is that CHibeOS is a better choice for an RT operationg system</div>NeoFromMatrix