User Tools

Site Tools


projects:crazyflie:devenv:index

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
projects:crazyflie:devenv:index [2012-03-11 11:32]
arnaud [Compiling the copter code]
projects:crazyflie:devenv:index [2021-06-24 16:47]
kimberly
Line 1: Line 1:
 +<WRAP center round important 60%>
 +This page has deprecated and will be archived. Please go to [[https://www.bitcraze.io/]].
 +</WRAP>
 ====== Development environment ====== ====== Development environment ======
  
 ===== Software Tools ===== ===== Software Tools =====
 ==== Software used ==== ==== Software used ====
-The following software is in the Crazyflie development environment toolchain: +The following software are used by the Crazyflie development environment toolchain: 
-  * [[http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/|Sourcery CodeBench (formally known as Sourcery G++) Lite]] +  * [[https://launchpad.net/gcc-arm-embedded/+download| 
-  * [[http://http://openocd.sourceforge.net/|openOCD]]+GNU Tools for ARM Embedded Processors]] 
 +  * [[http://openocd.sourceforge.net/|openOCD]]
 These are available for both Windows and Linux. These are available for both Windows and Linux.
  
 ==== Setup on Fedora 16 ==== ==== Setup on Fedora 16 ====
 === Installing === === Installing ===
- 
-=== Fix permissions === 
 In order to fix the permissions so it's possible to use the JTAG and USB Radio without being root do the following steps. In order to fix the permissions so it's possible to use the JTAG and USB Radio without being root do the following steps.
 <code> <code>
Line 25: Line 27:
 </code> </code>
  
-Create a file named /etc/rules.d/99-crazyradio.rules and add the following:+Create a file named /etc/udev/rules.d/99-crazyradio.rules and add the following:
 <code> <code>
 SUBSYSTEM=="usb", ATTRS{idVendor}=="1915", ATTRS{idProduct}=="7777", MODE="0664", GROUP="plugdev" SUBSYSTEM=="usb", ATTRS{idVendor}=="1915", ATTRS{idProduct}=="7777", MODE="0664", GROUP="plugdev"
 +SUBSYSTEM=="usb", ATTRS{idVendor}=="1915", ATTRS{idProduct}=="0101", MODE="0664", GROUP="plugdev"
 +</code>
 +
 +==== 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:
 +<code>
 +sudo apt-get -y install mercurial python2.7 python-usb python-pygame python-qt4 qt4-designer openocd build-essential
 +</code>
 +
 +Run the following to download, unpack and copy the ARM Embedded toolchain:
 +<code>
 +wget https://launchpad.net/gcc-arm-embedded/4.7/4.7-2013-q1-update/+download/gcc-arm-none-eabi-4_7-2013q1-20130313-linux.tar.bz2
 +tar xjf gcc-arm-none-eabi-4_7-2013q1-20130313-linux.tar.bz2
 +mkdir ~/bin
 +mv gcc-arm-none-eabi-4_7-2013q1 ~/bin/gcc-arm-none-eabi
 +</code>
 +
 +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:
 +<code>
 +echo -e "\nPATH=\$PATH:$HOME/bin/gcc-arm-none-eabi/bin" >> ~/.bashrc
 +source ~/.bashrc
 </code> </code>
  
 ==== Setup on Windows ==== ==== Setup on Windows ====
 +
 +TBD
 +
 +==== Setup on Mac OS X ====
 +
 +Development environment setup is relatively easy on Mac OS X.
 +
 +[[http://crazyflie.ecsiii.com/archives/14-Compiling-Crazyflie-Firmware-on-Mac-OS-X.html | Please see this blog posting for an overview]].
  
 ===== Compiling the copter code ===== ===== Compiling the copter code =====
Line 36: Line 68:
 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 flash   # Flash firmware using openOCD and the jtagKey +crazyflie-fimrware$ make clean && make USE_ESKYLINK=1 CLOAD=1 all # Make copter firmware to be used with the bootloader, CF controlled with eSky ET6i transmitter 
-crazyflie$ make reset   # Reset the copter using openOCD +crazyflie-fimrware$ make cload   # Flash the firmware using the radio bootloader 
-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 flash   # Flash firmware using openOCD and the jtagKey 
 +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)
 </code> </code>
  
 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 |             | If at 1 the firmware is liked to be used with the bootloader.            | +|  CLOAD |             | If at 1 the firmware is liked to be used with the bootloader.            | 
-|  DEBUG |             | If at 1 the firmware will be build without optimization and with debug symbol (the firmware is ~70K in debug mode and ~40K optimized). |+|  DEBUG |             | If at 1 the firmware will be build without optimization and with debug symbol (the firmware is ~70K in debug mode and ~40K optimized). |
 |  CROSS_COMPILE |   arm-none-eabi-   | Prefix of the cross compilation toolchain to use. Any bare arm GCC should do. The default value is good for the CodeSourcery toolchain. | |  CROSS_COMPILE |   arm-none-eabi-   | Prefix of the cross compilation toolchain to use. Any bare arm GCC should do. The default value is good for the CodeSourcery toolchain. |
 |  OPENOCD_INTERFACE |   interface/jtagkey.cfg   | JTAG interface configuration file to use with openOCD. Default is for the Amontec JtagKEY. | |  OPENOCD_INTERFACE |   interface/jtagkey.cfg   | JTAG interface configuration file to use with openOCD. Default is for the Amontec JtagKEY. |
 |  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  | Name of the Python 2.7 interpreter |
 +|  USE_ESKYLINK|  0  | If at 1 the firmware is compiled to use with the eSky ET6i transmitter. |
 +
 +It is possible to create a file //config.mk// to set these variables in a more permanent manner, this file is imported at the beginning of Makefile.
  
-It must be noted that the openOCD targets do not make the copter code, hence the compilation must be called first with ''make'' and then ''make flash'' can be called.+The openOCD targets do not make the copter code, hence the compilation must be called first with ''make'' and then ''make flash'' can be called.
  
 It is possible to flash with openOCD/jtag a bootloader version of the copter as long as the bootloader is present at the beginning of the flash. However this could interfere with GDB. It is possible to flash with openOCD/jtag a bootloader version of the copter as long as the bootloader is present at the beginning of the flash. However this could interfere with GDB.
Line 61: Line 99:
 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
 </code> </code>
projects/crazyflie/devenv/index.txt · Last modified: 2021-06-24 16:47 by kimberly