KK2.1 Flight Controller Firmware Update Tutorial

by Jul 24, 2014Black Tie Aerial

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:

  1. 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).
  2. 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 AmazoneBay, or SparkFun.

USBasp Programmer

USBasp Programmer

10-pin to 6-pin AVR programming cable

10-pin to 6-pin AVR programming cable

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:

  1. Go to http://lazyzero.de/en/modellbau/kkmulticopterflashtool.
  2. Scroll down to the download section.
  3. 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:

  1. Head over to http://www.fischl.de/usbasp/ and scroll down to the “Drivers” section.
  2. Download the .zip file containing the latest USBasp driver.
  3. Go to wherever you just downloaded the .zip file and extract it.
  4. 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]

USBasp programmer plugged into KK2.1

Plug the 6-pin side of the USBasp programmer cable into the KK2.1.

[/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:

  1. 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.
  2. In the Device Manager, you should see section called “Other Devices” and if you expand this section, you should find an entry called “USBasp.”
  3. 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…”
  4. From the dialog box that appears, choose “Browse my computer for driver software.”
  5. On the next screen, click the “Browser…” button.
  6. Locate the USBasp driver folder we downloaded in the previous step, select it, and click “Ok”
  7. 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.

  1. In the “programmer” field, choose “USBasp”
  2. In the “port” field, choose “usb
  3. In the “controller” field choose “HobbyKing 22.1 and KK2.1.”
  4. 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]

KKmulticopter flashtool settings

Set up the KKMulticopter Flashtool as shown here

[/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]

KKmulticopter flashtool go button location

The “Go” button in the KKmulticopter flash tool can be a bit difficult to find.

[/full_width]

Congratulations, you have successfully updated your KK2.1 firmware.

Share This