GithubHelp home page GithubHelp logo

zaza89 / crazyflie2-nrf-firmware Goto Github PK

View Code? Open in Web Editor NEW

This project forked from braddrew0/crazyflie2-nrf-firmware

0.0 1.0 0.0 338 KB

Crazyflie 2.0 nRF51 firmware

C++ 0.50% C 97.82% Makefile 0.66% Assembly 0.99% Ruby 0.03%

crazyflie2-nrf-firmware's Introduction

Crazyflie 2.0 NRF51 firmware

Source code of the firmware running in the Crazyflie 2.0 nRF51822. This microcontroller have a couple of roles:

  • Power management (ON/OFF logic and battery handling)
  • Radio communication
    • Enhanced Shockburst compatible with Crazyradio (PA)
    • Bluetooth low energy using the Nordic Semiconductor S110 stack
  • One-wire memory access

Compiling with bluetooth support currently requires the nRF51_SDK and S110 packages. These can be downloaded from the Nordic semiconductor website. See s110/readme and nrf51_sdk/readme for exact version.

License

Most of the code is licensed under LGPL-3.0.

Some files under src/ble/ are modified from Nordic semiconductor examples.

Downloading the nrf51_sdk and nordic S110 softdevice require to aquire one of the Nordic Semiconductor development kit. Discussion is in progress with Nordic to solve this situation.

Compiling

To compile arm-none-eabi- tools from https://launchpad.net/gcc-arm-embedded should be in the path.

Compilation options can be saved in config.mk. Main targets:

make                 # Make with BLE support
make BLE=0           # Make without BLE support
make BLE=0 S110=0    # Make without BLE and without Softdevice in flash (see bellow)

make flash           # Flash firmware with jtag
make factory_reset   # Erase device and flash softdevice, bootloaders, and firmware

Architecture

When running without softdevice (S110=0) the firmware is loaded at the beginning of the flash and is running alone in the CPU.

When running with Softdevive (S110=1) independent of if BLE is activated or not, the flash is filled as follow:

+--------------+ 256k
|     MBS      |    Write protected
+--------------+ 252k
|  Bootloader  |
+--------------+ 232k
|              |
|              |
|              |
|              |
|              |
|  Firmware    |
+--------------+ 88K
|              |
|              |
|              |
|              |
|              |
|              |
|  Softdevice  |
+--------------+ 4K
|     MBR      |    Write protected
+--------------+ 0
  • MBR Softdevice Master Boot Record.
  • SoftDevice S110 Bluetooth stack
  • Firmware This firmware
  • Bootloader Bluetooth/Shockburst bootloader
  • MBS Master Boot Switch

Boot sequence:

 MBR ----> MBS ----> Bootloader ----> Firmware

The MBR is part of the Softdevice. It boots the CPU and jump to MBS. The MBR contains methods to start the Softdevice and can flash softdevice and bootloader.

The MBS handles the ON/OFF button and comunicate the duration of the press to the bootloader so that the bootloader knows what to boot. The reason for the MBS is to allow updating the bootloader over the air while still having a write-protected piece of software that can start the STM32 in USB DFU mode for recovery (the STM32 has access to the NRF51 SWD programming port). The boot switch is as follow:

Press time Blue LED state Program booted
Short Still Firmware
Long (>3s) Slow blink Bootloader
Very long (>5s) Fast blink Stays in MBS and power STM32 in USB DFU mode

The bootloader, if selected, starts the STM32 in bootloader mode and initialize both BLE and Shockburst (ESB) radio. It can flash everything but MBR and MBS. It also acts as a bridge to the STM32 bootloader.

If not selected, the bootloader jumps to the firmware.

crazyflie2-nrf-firmware's People

Contributors

ataffanel avatar tobbeanton avatar whoenig 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.