Giter Club home page Giter Club logo

crazyflie-firmware's Introduction

Always keep this as the newest official version

https://github.com/bitcraze/crazyflie-firmware.git

Crazyflie 1.0/2.0 Firmware Build Status

This project contains the source code for the Crazyflie 1.0/2.0 firmware.

Dependencies

You'll need to use either the Crazyflie VM, the toolbelt or install some ARM toolchain.

Install a toolchain

OS X

brew tap PX4/homebrew-px4
brew install gcc-arm-none-eabi

Debian/Ubuntu

Tested on Ubuntu 14.04 64b and Ubuntu 16.04 64b:

For ubuntu 14.04 :

sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded

For ubuntu 16.04 :

sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa

After adding the corresponding repositories, execute the following commands

sudo apt-get update
sudo apt-get install libnewlib-arm-none-eabi

Arch Linux

sudo pacman -S community/arm-none-eabi-gcc community/arm-none-eabi-gdb community/arm-none-eabi-newlib

Windows

The GCC ARM Embedded toolchain for Windows is available at launchpad.net. Download the zip archive rather than the executable installer. There are a few different systems for running UNIX-style shells and build systems on Windows; the instructions below are for Cygwin.

Install Cygwin with setup-x86_64.exe. Use the standard C:\cygwin64 installation directory and install at least the make and git packages.

Download the latest gcc-arm-none-eabi-*-win32.zip archive from launchpad.net. Create the directory C:\cygwin64\opt\gcc-arm-none-eabi and extract the contents of the zip file to it.

Launch a Cygwin terminal and run the following to append to your ~/.bashrc file:

echo '[[ $PATH == */opt/gcc-arm-none-eabi/bin* ]] || export PATH=/opt/gcc-arm-none-eabi/bin:$PATH' >>~/.bashrc
source ~/.bashrc

Verify the toolchain installation with arm-none-eabi-gcc --version

Cloning

This repository uses git submodules. Clone with the --recursive flag

git clone --recursive https://github.com/bitcraze/crazyflie-firmware.git

If you already have cloned the repo, use

git submodule init
git submodule update

Compiling

Crazyflie 1.0

Build with:

make PLATFORM=CF1

or with the toolbelt

tb make PLATFORM=CF1

Crazyflie 2.0

This is the dafault build so just running "make" is enough or:

make PLATFORM=CF2

or with the toolbelt

tb make

config.mk

To create custom build options create a file called config.mk in the root folder (same as Makefile) and fill it with options. E.g.

PLATFORM=CF1
DEBUG=1
CLOAD=0

More information can be found on the Bitcraze wiki

Folder description:

./              | Root, contains the Makefile
 + init         | Contains the main.c
 + config       | Configuration files
 + drivers      | Hardware driver layer
 |  + src       | Drivers source code
 |  + interface | Drivers header files. Interface to the HAL layer
 + hal          | Hardware abstaction layer
 |  + src       | HAL source code
 |  + interface | HAL header files. Interface with the other parts of the program
 + modules      | Firmware operating code and headers
 |  + src       | Firmware tasks source code and main.c
 |  + interface | Operating headers. Configure the firmware environement
 + utils        | Utils code. Implement utility block like the console.
 |  + src       | Utils source code
 |  + interface | Utils header files. Interface with the other parts of the program
 + platform     | Platform specific files. Not really used yet
 + tools        | Misc. scripts for LD, OpenOCD, make, version control, ...
 |              | *** The two following folders contains the unmodified files ***
 + lib          | Libraries
 |  + FreeRTOS  | Source FreeRTOS folder. Cleaned up from the useless files
 |  + STM32...  | Library folders of the ST STM32 peripheral libs
 |  + CMSIS     | Core abstraction layer

Make targets:

all        : Shortcut for build
compile    : Compile cflie.hex. WARNING: Do NOT update version.c
build      : Update version.c and compile cflie.elf/hex
clean_o    : Clean only the Objects files, keep the executables (ie .elf, .hex)
clean      : Clean every compiled files
mrproper   : Clean every compiled files and the classical editors backup files

cload      : If the crazyflie-clients-python is placed on the same directory level and 
             the Crazyradio/Crazyradio PA is inserted it will try to flash the firmware 
             using the wireless bootloader.
flash      : Flash .elf using OpenOCD
halt       : Halt the target using OpenOCD
reset      : Reset the target using OpenOCD
openocd    : Launch OpenOCD

Unit testing

Running all unit tests

With the environment set up locally

    make unit

with the docker builder image and the toolbelt

    tb make unit

Running one unit test

When working with one specific file it is often convinient to run only one unit test

   make unit FILES=test/utils/src/TestNum.c

or with the toolbelt

   tb make unit FILES=test/utils/src/TestNum.c

Running unit tests with specific build settings

Defines are managed by make and are passed on to the unit test code. Use the normal ways of configuring make when running tests. For instance to run test for Crazyflie 1

  make unit PLATFORM=CF1

Dependencies

Frameworks for unit testing and mocking are pulled in as git submodules.

The testing framework uses ruby and rake to generate and run code.

To minimize the need for installations and configuration, use the docker builder image (bitcraze/builder) that contains all tools needed. All scripts in the tools/build directory are intended to be run in the image. The toolbelt makes it easy to run the tool scripts.

crazyflie-firmware's People

Contributors

aholler avatar aswild avatar ataffanel avatar carlin-psvl avatar cbiffle avatar danmark avatar dbrgn avatar erwincoumans avatar estromb avatar evoggy avatar fredg02 avatar fredgrat avatar jpreiss avatar jsgf avatar khant14 avatar krasin avatar krichardsson avatar lgenzelis avatar lkumar93 avatar mgreiff avatar mikehamer avatar ograff avatar omwdunkley avatar oxydation avatar sascha274 avatar stephanbro avatar theseankelly avatar tobbeanton avatar tomfelker avatar whoenig avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.