Fetching contributors…
Cannot retrieve contributors at this time
97 lines (71 sloc) 2.78 KB

Building and Flashing the firmware

These documents are designed to help developers get up and running with developing new features and understanding the internals of the firmware. Development is currently supported only on Ubuntu Linux 16.04.

Building firmware from source

To build the firmware, you will need the latest version of the ARM embedded toolchain.

sudo apt install -y lib32ncurses5
tar -xvf gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2
sudo mv gcc-arm-none-eabi-5_4-2016q3 /opt/.
echo "export PATH=\$PATH:/opt/gcc-arm-none-eabi-5_4-2016q3/bin" >> ~/.bashrc
rm -rf gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2

Then, simply clone the repository, pull down the submodules, and build:

git clone
cd firmware
git submodule update --init --recursive

Flashing newly built firmware (F4)

Configure your machine to recognize the flight controller

Be sure your user is in the dialout and plugdev group so you have access to the serial ports

sudo usermod -a -G plugdev <username>
sudo usermod -a -G dialout <username>

Disable the modem-manager (sometimes linux thinks the device is a modem)

sudo systemctl stop ModemManager.service
  • Add the custom udev rule so linux handles the flight controller properly (copy the following as /etc/udev/rules.d/45-stm32dfu.rules)
# DFU (Internal bootloader for STM32 MCUs)
SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0664", GROUP="plugdev"

Installing DFU-Util

Install the dfu-util utility

sudo apt install dfu-util

!!! tip dfu-util auto-detects F4-based boards. Try dfu-util -ls to make sure your board is in bootloader mode

Then put the board in bootloader mode (short the boot pins while cycling power) and type make BOARD=REVO flash

Flashing newly built firmware (F1)

Install the stm32flash utility

git clone git:// stm32flash-code
cd stm32flash-code
sudo make install
cd ..
rm -rf stm32flash-code

Then put the board in bootloader mode (short the boot pins while cycling power) and type make BOARD=NAZE flash

Building and running unit tests

Contributions will need to pass our continuous integration unit tests before merging. To test your contributions against these tests, you'll first need to install Eigen and gtest

sudo apt install libgtest-dev libeigen3-dev cmake
cd /usr/src/gtest
sudo cmake CMakeLists.txt
sudo make
sudo cp *.a /usr/lib

Then you'll need to build and run the tests themselves

cd <firmware_directory>/test
mkdir build
cd build
cmake ..