Created
May 9, 2016 21:05
-
-
Save tejo/247b6e9a7081af5fe59ecb79cf02950e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
set -o pipefail | |
dfu-util --alt 0 -s 0x08000000:force:unprotect -D "$1" | |
sleep 5 | |
dfu-util -R -a 0 -D "$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Flashing the KISS FC from command line (Mac and Linux)
Note before start:
Prerequisites Mac
You'll need to install the brew (http://brew.sh/) package manager for OS X, go to the site and install it (https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Installation.md#installation)
After you completed the installation be sure the brew installation is working typing:
$ brew
in the terminal (note: the $ is not intended to be copied)
you should see something like:
Now you need to intall the dfu-util (http://dfu-util.sourceforge.net/) program we wiil use for flash the FC. Install it by typing:
$ brew install dfu-util
after that verify the correct installation typing:
$ dfu-util
you should see something like:
Prerequisites Linux
in linux you can install the dfu-util (http://dfu-util.sourceforge.net/) with your disto package manager, in ubuntu you can do it with:
$ sudo apt-get install dfu-util
after that verify the correct installation typing:
$ dfu-util
you should see something like:
Flashing
Now that you have dfu-util installed you can flash the FC. Download the FW extract it and go in the extracted directory.
If you type:
$ pwd
in the terminal you will see the directory where you are, mine for example is:
/Users/teo/
if we have downloaded and extracted the firmware in the Download directory, we can go there typing:
$ cd Downloads/
(you don't need to typing the complete word, type the initial letters and simply hit tab, the terminal will try to autocomplete it)
and we can verify the content of the directory typing:
$ ls
and you should see the list of the files, mine is:
KISSFC_v1.011_HWv1.02.dfu KISSFC_v1.02_RC16.dfu KISSFC_v1.02_RC25.dfu KISSFC_v1.02_beta74_HWv1.02.dfu
now you can grab a simple script that execs the dfu-command for you by doing:
$ curl -o flash.sh https://gist.githubusercontent.com/tejo/247b6e9a7081af5fe59ecb79cf02950e/raw/639c10266fbf29995a4929865f356a0109d93598/flash.sh
make it executable with
$ chmod +x flash.sh
Now if you flash for example the previously downloaded rc16 you can connect the FC (with soldered boot pins or pressing the boot switch) and then type:
$ ./flash.sh KISSFC_v1.02_RC16.dfu
if you see some text and progress bar flashing on the terminal you are done. Now you can un-solder the boot pins (or release the boot switch) and reboot the FC with the new firmware.
With linux you may have to prepend the flash.sh command with sudo and type your password, like:
$ sudo ./flash.sh KISSFC_v1.02_RC16.dfu
General troubleshooting
Your FC must been recognize by your system by the GUI. If you cannot connect your FC with the fiss GUI, this guide is unlikely will work for you.
Must issue with command line are related to file path and name cases. Make sure you are in the right directory with pwd and ls, and avoid to type the file names by your own, use the tab key to autocomplete them.
If you are curious about the script you can take a look at it here:
https://gist.github.com/tejo/247b6e9a7081af5fe59ecb79cf02950e