7/08/12 11:41 PM DIY! > ! SimonK ESC firmware flashing HK Blue Series 20A and HK F20A For those seriously into quads you would have heard of SimonK and his firmware for Atmega based ESCs. I am going to focus on flashing a HK Blue Series 20A ESC. These are popular so if you cannot get hold of one the Mystery Blue 20A is pretty much the same unit. Another very good ESC for flashing is the HobbyKing F-20A. You have to build your own flashing adapter, but once you have that they are much easier.
7/08/12 11:41 PM 2 servo extension leads. Step 1: Install your USBasp drivers. No drivers are needed for Linux or OSX. Windows get your drivers from here you have to manually install the drivers. Josh on Flite Test shows how to install the drivers on Windows 7, and also how to use KKMultiTool on a HK controller board. Worth a look. Step 2: Programmer to ESC connections. The HK USBasp programmer. has nice labels with handy points for testing with your multimeter.
7/08/12 11:41 PM Just a small strip of the covering cut off at the corner of the pcb near the red motor wire. With a sharp hobby knife make a small incision first and then lift from underneath to cut it. This way you wont cut any tracks. I made this for the F20-A with headers that were cut out of an old circuit board. The pins were bent inwards to fit and then ground flat with the face of a Dremel cutter. I simply hold it in place while programming.
7/08/12 11:41 PM I made it into a permanent fixture on my programmer by attaching it to the seldom used 10pin header. The solid cores of stripped network wires are pushed in and held with hot glue. That is the F20-A setup ready. Back to the blue series: Prepare our leads. I used the female ends of two servo extension wires. You will have to cut off the outer plastic. I find it easier to slide the pins out before I solder them on. http://www.rchacker.
7/08/12 11:41 PM Next you will need four very small and relatively long screws. Most people should have a few dead servos lying about. These were from my Esky Belt heli. What are looking for is a pointed and threaded end. If they are not pointed it will just make it a bit more difficult but not impossible. http://www.rchacker.
7/08/12 11:41 PM Here I have my favorite pointy tool which is a stainless steel dental tool. Any sharp pin held with pliers will do the same job. Obviously we want the hole right over the pad. Next get some solder on your screws, you do not want the screws getting too hot while they are stuck in the heat shrink. http://www.rchacker.
/08/12 11:41 PM With a small screwdriver or even you fingers and a small amount of pressure twist the screw into the hole until it bites. These three you can offset the holes a little to avoid shorts. http://www.rchacker.
7/08/12 11:41 PM Apologies for the dirty nails. These two are tricky because the heat shrink is much closer to the board, lifting it with a screwdriver helps. Once they are all in, we can solder our wires on then match them up with the right connections on the programmer. This diagram should help. Part way there... http://www.rchacker.
7/08/12 11:41 PM Double check all your connections with a multimeter and that each screw is touching its pad and not other screws Put it aside for now we now have to sort the software out. Step 3: Flashing. Two options here KKMultiTool or the good old command line. Flashing with KKMultiTool. Go to the kkMultiTool website and download the latest stable version. Unzip it open the folder and double click on kkMultiCopterFlashTool.cmd http://www.rchacker.
7/08/12 11:41 PM You may not see the .cmd extension. http://www.rchacker.
7/08/12 11:41 PM Baud rate to 9600! You need to change the controller to atmega 8-based brushless ESC (8kB flash) And select BS N-FET for the firmware. WARNING this next step will completely erase the HK firmware if you have a programming card it will no longer work and you cannot go back. Plug in your programmer, check the connections to the pads and click on the green running man everything should happen. If you see AVRDude successful you are done. Configuring, compiling and flashing from the source.
7/08/12 11:41 PM First you are going to need an AVR assembly compiler. This will take the .asm and .inc files and make them into a .hex file. ie turn assembly code into machine code. Simon uses avra on linux. Avra is open source and they say is almost 100% compatible with avrasm2 (Atmels compiler). Gurus can go ahead and compile avra from source (it might already be on your linux box). I am going to use avrasm2 which is a little easier to install.
7/08/12 11:41 PM .gitignore is used by github where the code is stored. Makefile is a script that compiles all the binaries at once. We are only interested in one type of ESC at a time so I am not going to cover it here. README.md read it! Its got lots of information and instructions on calibrating your ESC once flashed. The inc files are for each of the different types of ESCs. We will be using bs_nfet.inc tgy.asm. This is the main source file and here we will make some changes.
7/08/12 11:41 PM Scroll down to the list of include files. I have pretty colors because I am using xcode. Since we are not using the makefile we need to comment out everything but the include file we need. Comments in assembler are any line starting with a semicolon. http://www.rchacker.
7/08/12 11:41 PM Done. Scroll down a little to see the compile time options that we may be interested in. Nothing complicated 1 is enabled and 0 is disabled. For a multicopter setup the only one you might be interested in is MOTOR_REVERSE, and only then if you have hardwired your ESC. Save your changes. Lets compile it. Copy avrasm2.exe, avrdude.exe and avrdude.conf into the same folder with the source files. http://www.rchacker.
7/08/12 11:41 PM On the command line type: avrasm2 -fI tgy.asm Done, you should now have tgy.hex in the same folder. Now connect up your programmer to your ESC and computer. The programmer supplies power to the ESC during programming so there is no need to provide power or have it plugged into a reciever. WARNING this next step will completely erase the HK firmware if you have a programming card it will no longer work and you cannot go back. avrdude -c usbasp -p m8 -U flash:w:tgy.