KK2.1 Flight Controller Firmware Update Tutorial
Introduction
When you place an order for a KK2.1 flight control board somebody goes into a HobbyKing warehouse somewhere, finds a KK2.1 on a shelf, puts it in a box, and sends it to you. The problem is, like most electronic devices, the software installed on the KK2.1 evolves over time – bugs get fixed, features get added, algorithms get optimized, ect. – and depending on how long the particular KK2.1 board you get has been sitting in the warehouse, its software is probably out of date.
By upgrading the software (called firmware) on your KK2.1 board, you can improve the performance of your multirotor, as updated firmware has more advanced control code. For example, the auto-leveling algorithms on the newest KK2.1 firmware are far superior to the ones that come with firmware version 1.5, which is the firmware installed on most KK2.1 boards when you order them. So by updating the firmware, your multirotor will fly much better in auto-level mode for example. So, let’s get to the firmware update setup.
Determining your Current Firmware Version
As mentioned above, the firmware installed on your KK2.1 board when it arrives in the mail may or may not be out of date. This is especially true if you purchase your KK2.1 secondhand on eBay or somewhere; the previous owner might have already updated the firmware. Fortunately, discovering what firmware version is installed on your KK2.1 is really easy. When you first apply power to your KK2.1 board, either with a battery or with a USBasp programmer (more on that in a second) a screen will flash across the screen that displays the current hardware and firmware versions. You might have to unplug and replug your KK2.1 a few times to read the firmware version as it only displays on the screen for part of a second, but you are going to look at the second line in the splash screen, which says “FW: ###”. That number is the firmware version currently running on your KK2.1.
Hardware Needed
You will only need two pieces of hardware to update the firmware on your KK2.1 board:
- A USBasp programmer: a USB in-circuit programmer for Atmel AVR controllers, of which the KK2.1 flight control board is one (the popular Arduino microcontroller is another).
- A 10-pin to 6-pin AVR programming cable: this cable is an adapter that goes between the 10-pin interface on the USBasp programmer and the 6-pin interface on the KK2.1 board.
You can order both of these parts in a single package from HobbyKing, although there are many other places you can buy them, including Amazon, eBay, or SparkFun.
Software Needed
On the software side, we are very fortunate to have fabulous and generous programmers in the multirotor community who donate their time an energy to create easy-to-use software tools for updating the KK2.1 firmware. The software I like best was created by “Kapteinkuk” and “Lazyzero.” The “KKmulticoper Flashtool” they created provides a graphical interface for updating the firmware on the KK2.1 board, along with a host of other boards. To download the software:
- Go to http://lazyzero.de/en/modellbau/kkmulticopterflashtool.
- Scroll down to the download section.
- Download the “Latest stable software versions” for your OS.
Now, if you are on Mac OS X, you are ready to start updating your firmware, just skip to the next step.
If you are on Windows (like me), you will also need to download the driver software for the USBasp programmer:
- Head over to http://www.fischl.de/usbasp/ and scroll down to the “Drivers” section.
- Download the .zip file containing the latest USBasp driver.
- Go to wherever you just downloaded the .zip file and extract it.
- Remember the location of this file because we will use it at the beginning of the next step. See you there.
Updating the KK2.1 Firmware
With all of the background information and gathering of materials/software out of the way, let’s get started with the actual firmware updating process.
Plug in your KK2.1
We will start by plugging the KK2.1 board into our computer via the USBasp programmer.
First, plug the 10-pin end of the programming cable into the USBasp programmer board. Second, plug the USB end of the USBasp programmer into an available USB port on your computer.
Now, the third and last step is to plug the 6-pin side of the ASP programming cable into the KK2.1 board. However, the direction of the cable does matter. Fortunately, it is easy to figure out if you have the cable the wrong way, and if you accidentally do plug in the cable the wrong direction, don’t worry, no harm will befall your KK2.1 board. So, when you plug the 6-pin side of the ASP programming cable into the KK2.1 board, you should see the KK2.1’s screen light up and display the “SAFE” screen. If your KK2.1 does not light up, you have the cable on backwards, so just turn it 180o and everything will be fine.
[full_width]
[/full_width]
For Windows users, there is one last thing to do. When you plug in your KK2.1, you will probably notice a message appear on your computer informing you that Windows is attempting to install the driver for your new device. Despite its best efforts, Windows will fail at this task and we will have to give it some help by locating the USBasp driver we downloaded in the previous step:
- Go to your start menu and type “device manager.” Then open the Device Manager, which should be the first item in the list of programs.
- In the Device Manager, you should see section called “Other Devices” and if you expand this section, you should find an entry called “USBasp.”
- The little yellow exclamation mark means something has gone wrong, namely the driver failed to load, so right-click on the USBasp entry and from the menu, choose “Update driver software…”
- From the dialog box that appears, choose “Browse my computer for driver software.”
- On the next screen, click the “Browser…” button.
- Locate the USBasp driver folder we downloaded in the previous step, select it, and click “Ok”
- Finally, click next, and Windows will install the USBasp driver software and now we are ready to move on.
Doing the Firmware Update
At long last it is finally time to do the actual firmware updating. So start by running the KKmulticopter Flashtool we downloaded in the previous step (it usually takes ten seconds or so to start). There are a total of five fields in the KKmulticopter Flashtool software we will need to set for the firmware update to work.
- In the “programmer” field, choose “USBasp”
- In the “port” field, choose “usb“
- In the “controller” field choose “HobbyKing 22.1 and KK2.1.”
- In the “Flashing firmware” box, under the “Repository” tab, choose “KK2.1” from the first dropdown menu. Just a bit of explanation here: there are two ways to update the firmware on your KK2.1, you can either choose a firmware file from your computer, or you can let the software retrieve the best firmware from the repository managed by Lazyzero. This second option is much easier. At the time of this writing, the best firmware available is the “KK2.1 V1.9S1 by Steveis” but when you update your firmware an even better version may be available.
[full_width]
[/full_width]
Finally, with all the fields set, click the green button on the right side of the Flashing firmware area. The firmware update process can take 20 to 30 seconds or so but eventually you should see a message in the KKmulticopter flashtool indicating that the firmware flashing process was successful.
[full_width]
[/full_width]
Congratulations, you have successfully updated your KK2.1 firmware.
Thanks for this clear description. Very helpful.
Do you have to unplug all the input and output cables on the board before you flash new firmware?
Hi Robby, thanks very much for your question. Technically, you shouldn’t have to disconnect your inputs/outputs before flashing new firmware. Of course, make sure you do disconnect the battery or you could cause damage to your computer. I would recommend disconnecting the inputs/outputs anyway though. It is a bit inconvenient, but it will make absolutely certain your computer, and all of your other electronic devices, are safe.
Hi Scott,
I stumble across your excellent and very detailed and clear write-up instructions for flashing the firmware for KK boards.
There are many videos but not many clear write-up on the internet.
Excellent job. Thank you for your great effort.
Regards,
Leo
Thanks for this information. I’m curious if you know another source for the two devices needed to re-flash the board? Hobby King, in it’s infinite capacity to hav it their way’ does not stock the things. I just received one without the expected cables and after 2 days I received a reply stating they no longer stocked the cables.
Hi Bill F, thanks for your question. You are right, HobbyKing can be a little less than reliable, especially when it comes to their inventory. Luckily, you can get the KK flashing tool from a bunch of different vendors. All you need is a general purpose AVR programmer with a six-pin connector cable. You can find them on many sites including Amazon, eBay, or even SparkFun.