This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
projects:crazyflie:devenv:index [2012-09-17 22:22] arnaud [Compiling the copter code] |
projects:crazyflie:devenv:index [2013-07-03 23:27] surrender Added USE_ESKYLINK variable description and example |
||
---|---|---|---|
Line 3: | Line 3: | ||
===== Software Tools ===== | ===== Software Tools ===== | ||
==== Software used ==== | ==== Software used ==== | ||
- | The following software | + | The following software |
- | * [[http://www.mentor.com/embedded-software/ | + | * [[https://launchpad.net/gcc-arm-embedded/+download| |
- | * [[http://http:// | + | GNU Tools for ARM Embedded Processors]] |
+ | * [[http:// | ||
These are available for both Windows and Linux. | These are available for both Windows and Linux. | ||
Line 26: | Line 27: | ||
< | < | ||
SUBSYSTEM==" | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
</ | </ | ||
+ | ==== Setup on Ubuntu 13.04 ==== | ||
+ | Most of the software that you will need is now available from the repositories so just run the following command to install it: | ||
+ | < | ||
+ | sudo apt-get -y install mercurial python2.7 python-usb python-pygame python-qt4 qt4-designer openocd build-essential | ||
+ | </ | ||
+ | Run the following to download, unpack and copy the ARM Embedded toolchain: | ||
+ | < | ||
+ | wget https:// | ||
+ | tar xjf gcc-arm-none-eabi-4_7-2013q1-20130313-linux.tar.bz2 | ||
+ | mkdir ~/bin | ||
+ | mv gcc-arm-none-eabi-4_7-2013q1 ~/ | ||
+ | </ | ||
- | ==== Setup on Ubuntu 10.04 LTS / 11.10 ==== | + | And then also add the binaries to your path: |
+ | In order for the build system to find the toolchain when building the firmware it has to be added to the path: | ||
+ | < | ||
+ | echo -e " | ||
+ | source ~/.bashrc | ||
+ | </ | ||
==== Setup on Windows ==== | ==== Setup on Windows ==== | ||
+ | TBD | ||
===== Compiling the copter code ===== | ===== Compiling the copter code ===== | ||
The Crazyflie project is based on a Makefile. A couple of target are useful: | The Crazyflie project is based on a Makefile. A couple of target are useful: | ||
<code bash> | <code bash> | ||
- | crazyflie$ make # Make copter firmware | + | crazyflie-fimrware$ make # Make copter firmware |
- | crazyflie$ make V=1 # Make copter firmware and shows the full compilation commands | + | crazyflie-fimrware$ make V=1 # Make copter firmware and shows the full compilation commands |
- | crazyflie$ make CLOAD=1 # make copter firmware to be used with the bootloader | + | crazyflie-fimrware$ make CLOAD=1 # Make copter firmware to be used with the bootloader |
- | crazyflie$ make cload # Flash the firmware using the radio bootloader | + | crazyflie-fimrware$ |
- | crazyflie$ make flash # Flash firmware using openOCD and the jtagKey | + | crazyflie-fimrware$ make cload # Flash the firmware using the radio bootloader |
- | crazyflie$ make reset # Reset the copter using openOCD | + | crazyflie-fimrware$ make flash # Flash firmware using openOCD and the jtagKey |
- | crazyflie$ make openocd # Launch openOCD and connect it to the copter (can then be used via the telnet interface and/or GDB) | + | crazyflie-fimrware$ make reset # Reset the copter using openOCD |
+ | crazyflie-fimrware$ make openocd # Launch openOCD and connect it to the copter (can then be used via the telnet interface and/or GDB) | ||
</ | </ | ||
A couple of variables can be set on the command line or shell environment to configure the build process: | A couple of variables can be set on the command line or shell environment to configure the build process: | ||
^ Variable ^ Default value ^ Usage ^ | ^ Variable ^ Default value ^ Usage ^ | ||
- | | CLOAD | | + | | CLOAD | |
- | | DEBUG | | + | | DEBUG | |
| CROSS_COMPILE | | | CROSS_COMPILE | | ||
| OPENOCD_INTERFACE | | | OPENOCD_INTERFACE | | ||
| V | 0 | Verbose mode. If V=1 the compilers command lines will be displayed. If V=0 only the tool type and target file are displayed. | | | V | 0 | Verbose mode. If V=1 the compilers command lines will be displayed. If V=0 only the tool type and target file are displayed. | | ||
| PYTHON2 | python | | PYTHON2 | python | ||
+ | | USE_ESKYLINK| | ||
- | It is possible to create a file // | + | It is possible to create a file // |
The openOCD targets do not make the copter code, hence the compilation must be called first with '' | The openOCD targets do not make the copter code, hence the compilation must be called first with '' | ||
Line 67: | Line 89: | ||
The copter can be loaded with a radio bootloader contained in the crazyloader folder. The dev environment is very similar to the copter one: | The copter can be loaded with a radio bootloader contained in the crazyloader folder. The dev environment is very similar to the copter one: | ||
<code bash> | <code bash> | ||
- | crazyloader$ make # Make the bootoader | + | crazyflie-bootloader$ make # Make the bootoader |
- | crazyloader$ make flash # Flash the bootloader with openOCD | + | crazyflie-bootloader$ make flash # Flash the bootloader with openOCD |
</ | </ |