Skip to content

Commit

Permalink
(bitcraze#578) added flashing info to build docs
Browse files Browse the repository at this point in the history
  • Loading branch information
knmcguire committed Mar 23, 2021
1 parent c94ce25 commit c813359
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 51 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The 2017.06 release was the last release with Crazyflie 1.0 support. If you want
to play with the Crazyflie 1.0 and modify the code, please clone this repo and
branch off from the 2017.06 tag.

## Building and Flashing instructions
## Building and Flashing
See the [building and flashing instructions](docs/building-and-flashing/build.md) in the github docs folder.


Expand Down
1 change: 0 additions & 1 deletion docs/_data/menu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
- title: Building and Flashing
subs:
- {page_id: build}
- {page_id: flashing}
- title: Userguides
subs:
- {page_id: deck}
Expand Down
47 changes: 47 additions & 0 deletions docs/building-and-flashing/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,53 @@ reset : Reset the target using OpenOCD
openocd : Launch OpenOCD
```

# Flashing
Writing a new binary to the Crazyflie is called flashing (writing it to the flash memory). This page describes how to flash from the command line and there are a few different ways to do it.

## Using Crazyradio

The most common way to flash is probably to use the Crazyradio.

### Prerequisites
* A Crazyradio with drivers installed
* [crazyflie-clients-python](https://github.com/bitcraze/crazyflie-clients-python) placed on the same directory level in the file tree
* The firmware has been built
* The current working directory is the root of the frazyflie-firmware project

### Manually entering bootloader mode

* Turn the Crazyflie off
* Start the Crazyflie in bootloader mode by pressing the power button for 3 seconds. Both the blue LEDs will blink.
* In your terminal, run `make cload`

It will try to find a Crazyflie in bootloader mode and flash the binary to it.

Warning: if multiple Crazyflies within range are in bootloader mode the result is unpredictable. This method is not suitable in classroom situation where it is likely that several students are flashing at the same time. Also remember that the Crazyradio PA often reaches into the next room.

### Automatically enter bootloader mode

* Add the address of the crazyflie to the [`config.mk`](/docs/building-and-flashing/configure_build.md) file, for instance `CLOAD_CMDS = -w radio://0/80/2M`
* Make sure the Crazyflie is on
* In your terminal, run `make cload`

It will connect to the Crazyflie with the specified address, put it in bootloader mode and flash the binary. This method is suitable for classroom situations.

Note: this method does not work if the Crazyflie does not start, for instance if the current flashed binary is corrupt. You will have to fall back to manually entering bootloader mode.

## Using a debug adapter

You need:

* An ST Link V2 Debugger
* open ocd installed ([installation intructions](/docs/development/openocd_gdb_debugging.md))
* The firmware has been built
* The current working directory is the root of the frazyflie-firmware project

In your terminal, run

`make flash`


# Unit testing

## Running all unit tests
Expand Down
49 changes: 0 additions & 49 deletions docs/building-and-flashing/flashing.md

This file was deleted.

0 comments on commit c813359

Please sign in to comment.