Giter Club home page Giter Club logo

certyflie's Introduction

Crazyflie 2.0 Firmware

This branch contains the source code for the full Ada + SPARK Crazyflie 2.0 firmware. If you want to use the SPARK + C version, switch to the crazyflie2 branch instead.

Folder description

./                       | Root, contains the .gpr project file
 + Ada_Drivers_Library   | As submodule
 + crazyflie_support     | Support library
 |  + src                | Supprt code
 |  + test               | Some test code
 + src                   | Application code

Git usage

This repository uses git submodules.

Clone with the --recursive flag to clone the submodules:

git clone --recursive https://github.com/AdaCore/Certyflie.git

To update, pull as normal, then update the submodules:

git pull
git submodule update --recursive

Requirements

The firmware is written in Ada 2012 and in SPARK 2014 and targets an STM32F4 chip, based on ARM. Therefore, a compiler for ARM (ELF) is needed: The "GNAT Community 2018" compiler for ARM (ELF) is one such compiler. A recent GNAT Pro compiler for that target will also suffice.

At this time, it's not possible to perform SPARK analysis (the 2016 version can't handle recent changes to Project files, and the 2017 version crashes).

Building the firmware

The firmware uses a Ravenscar-Full runtime that targets STM32F4 boards. This runtime is included in the "GNAT Community" for ARM (ELF) package and in the recent GNAT Pro packages for ARM.

To build the actual firmware, go on the project's root directory and type:

 gprbuild -P cf_ada_spark.gpr -p

Flashing the firmware

The firmware can be flashed using the STM32F4 DFU mode.

First, install the dfu-util on your matchine. On Ubuntu:

apt-get install dfu-util

Then,

  1. Plug the USB to micro-USB cable into your laptop
  2. Disconnect the battery from your Crazyflie 2.0
  3. Push in the power button on your Crazyflie 2.0. While continuing to hold in the power button (this is the tricky part), plug the micro-USB connector end of the cable into the Crazyflie.
  4. Continue holding the power button for about five seconds since you plugged the USB cable in). Watch the blue LED on the M2 arm until it displays a secondary (faster) blink rate (flashes about once a second). Then you can release the button.

With the STM32F4 in DFU mode, you should be able to find it with lsusb:

lsusb
...
Bus XXX Device XXX: ID 0483:df11 STMicroelectronics STM Device in DFU Mode

Create the BIN file from the ELF one with objcopy and then flash it using dfu-util:

arm-eabi-objcopy obj/cflie.elf -O binary obj/cflie.bin

sudo dfu-util -d 0483:df11 -a 0 -s 0x08000000 -D obj/cflie.bin

certyflie's People

Contributors

aholler avatar anthonyleonardogracio avatar ataffanel avatar danmark avatar dbrgn avatar evoggy avatar fabien-chouteau avatar jsgf avatar krasin avatar lambourg avatar omwdunkley avatar oxydation avatar pat-rogers avatar sascha274 avatar simonjwright avatar tobbeanton avatar victorlsogilis avatar

Watchers

 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.