Fix building guide (rebase because weird things happened
|
@ -1,6 +1,6 @@
|
|||
# Building in Eclipse
|
||||
|
||||
How to build, test & debug Cleanflight in Eclipse on Linux, Windows & MacOS.
|
||||
How to build, test & debug Betaflight in Eclipse on Linux, Windows & MacOS.
|
||||
|
||||
## Checklist
|
||||
|
||||
|
@ -17,7 +17,7 @@ Use this checklist to make sure you didn't miss a step. Versions mandated below
|
|||
- [ ] Optionally [Download and Install](https://github.com/gnuarmeclipse/qemu/releases) the latest GNU ARM Eclipse QEMU [read more](#install-qemu)
|
||||
- [ ] Add a new update site to Eclipse named "GNU ARM Eclipse Plugins" with the URL "http://gnuarmeclipse.sourceforge.net/updates" and install all the features offered
|
||||
- [ ] Configure [the recommended workspace settings](http://gnuarmeclipse.github.io/eclipse/workspace/preferences/)
|
||||
- [ ] Checkout the cleanflight source code [read more](#checkout-cleanflight)
|
||||
- [ ] Checkout the betaflight source code [read more](#checkout-betaflight)
|
||||
- [ ] *Windows platform only:* Add the msys or cygwin bin directory to the project path
|
||||
- [ ] Build the code by going to *Project menu -> Build All* [read more](#build)
|
||||
- [ ] Run the tests by creating and running a make target named "test"
|
||||
|
@ -47,85 +47,85 @@ Retain the default installation directories so that the GNU ARM Plugins can loca
|
|||
|
||||
### Install OpenOCD
|
||||
|
||||
You should install OpenOCD If you will be debugging on real hardware, such as the STM32F3DISCOVERY dev board. It is not required to simply build Cleanflight or run the tests.
|
||||
You should install OpenOCD If you will be debugging on real hardware, such as the STM32F3DISCOVERY dev board. It is not required to simply build Betaflight or run the tests.
|
||||
|
||||
### Install QEMU
|
||||
|
||||
No tests currently run on the QEMU emulator therefore this install is entirely optional. It is useful to test your installation, since you can compile and run a blinky demo.
|
||||
|
||||
### Checkout Cleanflight
|
||||
### Checkout Betaflight
|
||||
|
||||
If you'll be submitting changes to cleanflight, [fork the repository](https://help.github.com/articles/fork-a-repo/) on GitHub and checkout your copy.
|
||||
If you'll be submitting changes to betaflight, [fork the repository](https://help.github.com/articles/fork-a-repo/) on GitHub and checkout your copy.
|
||||
|
||||
In Eclipse go to *File -> Import* choose *Git -> Projects from Git*
|
||||
|
||||

|
||||

|
||||
|
||||
Choose *Clone URI*
|
||||
|
||||

|
||||

|
||||
|
||||
Enter the URI https://github.com/cleanflight/cleanflight or if you've forked the repo, enter your URI instead. With a fork, you will need to specify your authentication details
|
||||
Enter the URI https://github.com/betaflight/betaflight or if you've forked the repo, enter your URI instead. With a fork, you will need to specify your authentication details
|
||||
|
||||

|
||||

|
||||
|
||||
On the branch selection dialog, de-select all branches and select only *master*
|
||||
|
||||

|
||||

|
||||
|
||||
Select the default destination directory
|
||||
|
||||

|
||||

|
||||
|
||||
When the download completes, choose *Use the New Project wizard* and click Finish
|
||||
|
||||

|
||||

|
||||
|
||||
Choose *C/C++ -> Makefile Project with Existing Code*
|
||||
|
||||

|
||||

|
||||
|
||||
Enter cleanflight as the project name and browse to your home directory -> git -> cleanflight for the existing code location. Ensure the C (cleanflight) and C++ (tests) languages are checked. Choose the Cross ARM GCC toolchain for the Indexer Settings. Click finish.
|
||||
Enter betaflight as the project name and browse to your home directory -> git -> betaflight for the existing code location. Ensure the C (betaflight) and C++ (tests) languages are checked. Choose the Cross ARM GCC toolchain for the Indexer Settings. Click finish.
|
||||
|
||||

|
||||

|
||||
|
||||
Set your build and debug targets by going to project properties -> C/C++ Build and choose the Behaviour tab. Replace "all" in the build box with "TARGET=xxx DEBUG=GDB" where xxx is your platform such as NAZE
|
||||
|
||||

|
||||

|
||||
|
||||
On Windows only, add msys or cygwin bin directory to the project's path by right clicking the project and choosing properties
|
||||
|
||||

|
||||

|
||||
|
||||
Edit the path variable in *C/C++ Build -> Environment*
|
||||
|
||||

|
||||

|
||||
|
||||
Append the full path to the relevant bin dir
|
||||
|
||||

|
||||

|
||||
|
||||
### Build
|
||||
|
||||
Choose project -> build all
|
||||
|
||||

|
||||

|
||||
|
||||
### Configure Debugging
|
||||
|
||||
Choose debug -> debug configurations
|
||||
|
||||

|
||||

|
||||
|
||||
Create a new OpenOCD configuration for the obj\main\cleanflight_XXX.elf application (this file is generated by the build step above)
|
||||
Create a new OpenOCD configuration for the obj\main\betaflight_XXX.elf application (this file is generated by the build step above)
|
||||
|
||||

|
||||

|
||||
|
||||
Add the appropriate openocd board configuration parameter for your dev platform
|
||||
|
||||

|
||||

|
||||
|
||||
Add the target to your debug menu favourites
|
||||
|
||||

|
||||

|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Building in Fedora
|
||||
|
||||
Assuming you already have wget and git available, you should be able to build Cleanflight on a fresh install of Fedora with the following commands (tested on F18, F20 and Ubuntu 14.04):
|
||||
Assuming you already have wget and git available, you should be able to build Betaflight on a fresh install of Fedora with the following commands (tested on F18, F20 and Ubuntu 14.04):
|
||||
|
||||
```
|
||||
wget http://distribute.atmel.no/tools/opensource/Atmel-ARM-GNU-Toolchain/4.8.4/arm-gnu-toolchain-4.8.4.371-linux.any.x86_64.tar.gz
|
||||
|
@ -8,9 +8,9 @@ wget http://distribute.atmel.no/tools/opensource/Atmel-ARM-GNU-Toolchain/4.8.4/a
|
|||
tar xf arm-gnu-toolchain-4.8.4.371-linux.any.x86_64.tar.gz
|
||||
export PATH=$PATH:$PWD/arm-none-eabi/bin
|
||||
|
||||
git clone https://github.com/cleanflight/cleanflight.git
|
||||
cd cleanflight
|
||||
git clone https://github.com/betaflight/betaflight.git
|
||||
cd betaflight
|
||||
TARGET=NAZE make
|
||||
```
|
||||
|
||||
This will create cleanflight_NAZE.hex in the obj folder.
|
||||
This will create betaflight_NAZE.hex in the obj folder.
|
||||
|
|
|
@ -4,7 +4,7 @@ Building in Mac OS X can be accomplished in just a few steps:
|
|||
|
||||
* Install general development tools (clang, make, git)
|
||||
* Install ARM GCC 4.9 series compiler
|
||||
* Checkout Cleanflight sourcecode through git
|
||||
* Checkout Betaflight sourcecode through git
|
||||
* Build the code
|
||||
|
||||
## Install general development tools (clang, make, git)
|
||||
|
@ -37,7 +37,7 @@ installation, open up XCode and enter its preferences menu. Go to the "downloads
|
|||
|
||||
## Install ARM GCC 4.9 series compiler
|
||||
|
||||
Cleanflight is built using the 4.9 series GCC compiler provided by the [GNU Tools for ARM Embedded Processors project][].
|
||||
Betaflight is built using the 4.9 series GCC compiler provided by the [GNU Tools for ARM Embedded Processors project][].
|
||||
|
||||
Hit the "all downloads" link on the right side of the GNU Tools for ARM page to view [the older releases][]. Grab the
|
||||
Mac installation tarball for the latest version in the 4.9 series (e.g. 4.9-2015q2). Move it somewhere useful
|
||||
|
@ -73,29 +73,29 @@ If `arm-none-eabi-gcc` couldn't be found, go back and check that you entered the
|
|||
[GNU Tools for ARM Embedded Processors project]: https://launchpad.net/gcc-arm-embedded
|
||||
[the older releases]: https://launchpad.net/gcc-arm-embedded/+download
|
||||
|
||||
## Checkout CleanFlight sourcecode through git
|
||||
## Checkout Betaflight sourcecode through git
|
||||
|
||||
Enter your development directory and clone the [Cleanflight repository][] using the "HTTPS clone URL" which is shown on
|
||||
the right side of the Cleanflight GitHub page, like so:
|
||||
Enter your development directory and clone the [Betaflight repository][] using the "HTTPS clone URL" which is shown on
|
||||
the right side of the Betaflight GitHub page, like so:
|
||||
|
||||
```
|
||||
git clone https://github.com/cleanflight/cleanflight.git
|
||||
git clone https://github.com/betaflight/betaflight.git
|
||||
```
|
||||
|
||||
This will download the entire Cleanflight repository for you into a new folder called "cleanflight".
|
||||
This will download the entire betaflight repository for you into a new folder called "betaflight".
|
||||
|
||||
[CleanFlight repository]: https://github.com/cleanflight/cleanflight
|
||||
[Betaflight repository]: https://github.com/betaflight/betaflight
|
||||
|
||||
## Build the code
|
||||
|
||||
Enter the cleanflight directory and run `make TARGET=NAZE` to build firmware for the Naze32. When the build completes,
|
||||
the .hex firmware should be available as `obj/cleanflight_NAZE.hex` for you to flash using the Cleanflight
|
||||
Enter the betaflight directory and run `make TARGET=NAZE` to build firmware for the Naze32. When the build completes,
|
||||
the .hex firmware should be available as `obj/betaflight_NAZE.hex` for you to flash using the Betaflight
|
||||
Configurator.
|
||||
|
||||
## Updating to the latest source
|
||||
|
||||
If you want to erase your local changes and update to the latest version of the Cleanflight source, enter your
|
||||
cleanflight directory and run these commands to first erase your local changes, fetch and merge the latest
|
||||
If you want to erase your local changes and update to the latest version of the Betaflight source, enter your
|
||||
betaflight directory and run these commands to first erase your local changes, fetch and merge the latest
|
||||
changes from the repository, then rebuild the firmware:
|
||||
|
||||
```
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Building in Ubuntu
|
||||
|
||||
Building for Ubuntu platform is remarkably easy. The only trick to understand is that the Ubuntu toolchain,
|
||||
which they are downstreaming from Debian, is not compatible with Cleanflight. We suggest that you take an
|
||||
which they are downstreaming from Debian, is not compatible with Betaflight. We suggest that you take an
|
||||
alternative PPA from Terry Guo, found here:
|
||||
https://launchpad.net/~terry.guo/+archive/ubuntu/gcc-arm-embedded
|
||||
|
||||
|
@ -44,23 +44,23 @@ sudo apt-get install gcc-arm-none-eabi=4.9.3.2014q4-0precise12
|
|||
After the ARM toolchain from Terry is installed, you should be able to build from source.
|
||||
```bash
|
||||
cd src
|
||||
git clone git@github.com:cleanflight/cleanflight.git
|
||||
cd cleanflight
|
||||
git clone git@github.com:betaflight/betaflight.git
|
||||
cd betaflight
|
||||
make TARGET=NAZE
|
||||
```
|
||||
|
||||
You'll see a set of files being compiled, and finally linked, yielding both an ELF and then a HEX:
|
||||
```
|
||||
...
|
||||
arm-none-eabi-size ./obj/main/cleanflight_NAZE.elf
|
||||
arm-none-eabi-size ./obj/main/betaflight_NAZE.elf
|
||||
text data bss dec hex filename
|
||||
97164 320 11080 108564 1a814 ./obj/main/cleanflight_NAZE.elf
|
||||
arm-none-eabi-objcopy -O ihex --set-start 0x8000000 obj/main/cleanflight_NAZE.elf obj/cleanflight_NAZE.hex
|
||||
$ ls -la obj/cleanflight_NAZE.hex
|
||||
-rw-rw-r-- 1 pim pim 274258 Jan 12 21:45 obj/cleanflight_NAZE.hex
|
||||
97164 320 11080 108564 1a814 ./obj/main/betaflight_NAZE.elf
|
||||
arm-none-eabi-objcopy -O ihex --set-start 0x8000000 obj/main/betaflight_NAZE.elf obj/betaflight_NAZE.hex
|
||||
$ ls -la obj/betaflight_NAZE.hex
|
||||
-rw-rw-r-- 1 pim pim 274258 Jan 12 21:45 obj/betaflight_NAZE.hex
|
||||
```
|
||||
|
||||
You can use the Cleanflight-Configurator to flash the `obj/cleanflight_NAZE.hex` file.
|
||||
You can use the Betaflight-Configurator to flash the `obj/betaflight_NAZE.hex` file.
|
||||
|
||||
## Bricked/Bad build?
|
||||
|
||||
|
@ -78,10 +78,10 @@ Make sure to remove `obj/` and `make clean`, before building again.
|
|||
|
||||
## Updating and rebuilding
|
||||
|
||||
Navigate to the local cleanflight repository and use the following steps to pull the latest changes and rebuild your version of cleanflight:
|
||||
Navigate to the local betaflight repository and use the following steps to pull the latest changes and rebuild your version of betaflight:
|
||||
|
||||
```bash
|
||||
cd src/cleanflight
|
||||
cd src/betaflight
|
||||
git reset --hard
|
||||
git pull
|
||||
make clean TARGET=NAZE
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
A new feature in Windows 10 allows any developer to quickly and easily run an entire linux subsystem in windows and access it via a bash terminal. This gives developers full use of the entire linux OS and all of the great existing linux tools and programs. When Bash for Windows is up and running it feels like you sshed into a full linux box, except the linux distro is actually running alongside windows locally.
|
||||
|
||||
If you use Bash on Windows you can easily build cleanflight exactly as you would for Ubuntu. (the linux distro running on Windows is Ubuntu Trusty)
|
||||
If you use Bash on Windows you can easily build betaflight exactly as you would for Ubuntu. (the linux distro running on Windows is Ubuntu Trusty)
|
||||
|
||||
Setup for Bash on Windows is very easy and takes less than 5 minutes. [For instructions follow the official guide here.](https://msdn.microsoft.com/commandline/wsl/install_guide)
|
||||
|
||||
|
@ -61,24 +61,24 @@ add the "bin" subdirectory to the PATH Windows environment variable: ```%PATH%;C
|
|||
|
||||

|
||||
|
||||
## Checkout and compile Cleanflight
|
||||
## Checkout and compile Betaflight
|
||||
|
||||
Head over to the Cleanflight Github page and grab the URL of the GIT Repository: "https://github.com/cleanflight/cleanflight.git"
|
||||
Head over to the Betaflight Github page and grab the URL of the GIT Repository: "https://github.com/betaflight/betaflight.git"
|
||||
|
||||
Open the Cygwin-Terminal, navigate to your development folder and use the git commandline to checkout the repository:
|
||||
|
||||
```bash
|
||||
cd /cygdrive/c/dev
|
||||
git clone https://github.com/cleanflight/cleanflight.git
|
||||
git clone https://github.com/betaflight/betaflight.git
|
||||
```
|
||||

|
||||
|
||||

|
||||
|
||||
To compile your Cleanflight binaries, enter the cleanflight directory and build the project using the make command. You can append TARGET=[HARDWARE] if you want to build anything other than the default NAZE target:
|
||||
To compile your Betaflight binaries, enter the Betaflight directory and build the project using the make command. You can append TARGET=[HARDWARE] if you want to build anything other than the default NAZE target:
|
||||
|
||||
```bash
|
||||
cd cleanflight
|
||||
cd betaflight
|
||||
make TARGET=NAZE
|
||||
```
|
||||
|
||||
|
@ -88,20 +88,20 @@ within few moments you should have your binary ready:
|
|||
|
||||
```bash
|
||||
(...)
|
||||
arm-none-eabi-size ./obj/main/cleanflight_NAZE.elf
|
||||
arm-none-eabi-size ./obj/main/betaflight_NAZE.elf
|
||||
text data bss dec hex filename
|
||||
95388 308 10980 106676 1a0b4 ./obj/main/cleanflight_NAZE.elf
|
||||
arm-none-eabi-objcopy -O ihex --set-start 0x8000000 obj/main/cleanflight_NAZE.elf obj/cleanflight_NAZE.hex
|
||||
95388 308 10980 106676 1a0b4 ./obj/main/betaflight_NAZE.elf
|
||||
arm-none-eabi-objcopy -O ihex --set-start 0x8000000 obj/main/betaflight_NAZE.elf obj/betaflight_NAZE.hex
|
||||
```
|
||||
|
||||
You can use the Cleanflight-Configurator to flash the ```obj/cleanflight_NAZE.hex``` file.
|
||||
You can use the Betaflight-Configurator to flash the ```obj/betaflight_NAZE.hex``` file.
|
||||
|
||||
## Updating and rebuilding
|
||||
|
||||
Navigate to the local cleanflight repository and use the following steps to pull the latest changes and rebuild your version of cleanflight:
|
||||
Navigate to the local betaflight repository and use the following steps to pull the latest changes and rebuild your version of betaflight:
|
||||
|
||||
```bash
|
||||
cd /cygdrive/c/dev/cleanflight
|
||||
cd /cygdrive/c/dev/betaflight
|
||||
git reset --hard
|
||||
git pull
|
||||
make clean TARGET=NAZE -j16 -l
|
||||
|
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 80 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |