How to flash the KK 2.0 flying board using an Arduino 54

I struggled many hours to figure out how to flash the KK 2.0 flying board using an Arduino Uno.

I finally figured it out and thought I’d share with all of you. I assume you know how to upload sketches to your Arduino. Thanks to FakuFaku for the final helping hand :)

Prerequisites

  • Installed Arduino IDE 1.0.3 or greater
  • Installed avrdude for Windows, version 5.11svn worked great. If you don’t know how this works, just download the KK 2.0 windows flashing tool from (http://lazyzero.de/en/modellbau/kkmulticopterflashtool) and the avrdude.exe will be in lib/avrdude/windows/avrdude.exe. The GUI is supposed to work, but just running simple commands from the command line (see below, will work most of the time).
  • Downloaded the Firmware for flashing the KK 2.0. You may download some using the tool or you may find them on HobbyKing for instance.

Materials List

  • KK 2.0 flying board (HobbyKing) – ~22 €
  • Arduino Uno R3 (Sparkfun) – ~22 €
  • 10 uF Electrolytic Capacitor (Tayda) – ~ 0.01 €
  • Some F/F and M/F jumper cables (Sparkfun)
  • External Power supply for the KK (eg. a 800 mAh LiPo (HobbyKing)) – ~ 4€

Setup

These instructions are both valid for the Arduino Uno R3 and the Arduino Mega 2560.

First you will simply connect your Arduino to your PC using USB and through the Arduino IDE, in File->Examples->ArduinoISP you will upload that sketch to your Arduino.

This step will make the Arduino a programmer.

Wire up the Arduino and the KK 2.0 board according to the following pin layout

ISP 6 way pinout

On the KK 2.0 board, the Vcc (aKa Pin 2) is on the bottom left corner, eg as far away from the LCD as possible. From there, you may wire up the other connectors.

KK2 ISP Pinout

Pinout for AVR programmer on KK2 board – Taken from addcopter.com

MISO goes to MISO, MOSI goes to MOSI etc…

Arduino Uno R3 Pins

  • Arduino Pin 10 – SS / Reset
  • Arduino Pin 11 – MOSI
  • Arduino Pin 12 – MISO
  • Arduino Pin 13 – SCK

Arduino Mega 2560 Pins

  • Arduino Pin 50 – MISO
  • Arduino Pin 51 – MOSI
  • Arduino Pin 52 – SCK
  • Arduino Pin 53 – SS / Reset

Note: Do NOT connect Vcc from the Arduino to the KK 2.0. That will not work.

Make sure of the following points:

  1. Connect one of the ESCs to the KK board as we will use this to power the board externally.
  2. Connect the ground from the ESC pin row to the same ground as the Arduino and the GND from the ISP on the KK
  3. Make sure to put a 10 uF electrolytic capacitor between the SS / Reset pin and the GND. Refer to the schematic picture for more details. Basically, the long pin of the capacitor goes near the SS part and the small leg goes to the GND.IMG_1554
  4. Next you want to make sure that your Arduino is powered through the USB or an external barrel jack
  5. Connect the KK 2.0 to an external battery, for instance the 800 mAh to fly the quad. The flashing will NOT work if you fail to power it seperately.

Flashing

Now that everything is powered and connected, you can try running the following command from the command line to see if it works:

Arduino Uno R3

D:\kkflashtool\lib\avrdude\windows>avrdude -P COM4 -p m324pa -c arduino -b 19200

Arduino Mega 2560

D:\kkflashtool\lib\avrdude\windows>avrdude -P COM4 -p m324pa -c avrisp -b 19200

Replace COM4 with the port on which your Arduino is connected to.

For the Arduino Uno R3, the output should be as follows:

avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e9511
avrdude: safemode: Fuses OK
avrdude done.  Thank you.

The Arduino Mega will be similar.

If you get an everything OK, then we are ready to flash.

Execute the following commands.

Arduino Uno R3

D:\kkflashtool\lib\avrdude\windows>avrdude.exe -P COM4 -b 19200 -c arduino -p m324pa -v -e -U flash:w:kk2.hex:i

Arduino Mega 2560

D:\kkflashtool\lib\avrdude\windows>avrdude.exe -P COM4 -b 19200 -c avrisp -p m324pa -v -e -U flash:w:kk2.hex:i
  • Replace COM4 with the port on which your Arduino is connected to.
  • Replace the kk2.hex part with the full path to your firmware file.

For the Arduino Uno R3, the output should be as follows:

...
Reading | ################################################## | 100% 24.92s

avrdude.exe: verifying ...
avrdude.exe: 32112 bytes of flash verified

avrdude.exe: safemode: lfuse reads as D7
avrdude.exe: safemode: hfuse reads as D1
avrdude.exe: safemode: efuse reads as FC
avrdude.exe: safemode: Fuses OK

avrdude.exe done.  Thank you.

The Arduino Mega will be similar.

Please note that the screen will become white during and after flashing. This is normal behaviour.

Disconnect everything and you should have a KK 2.0 with a brand new 1.5 FW on it.

Happy Flight.

Here is a bonus video of flying the new KK 2.0 with FW 1.5.

Edit: Changed Pin layout according to Chris’s comments. Thanks.

Share in top social networks!

54 thoughts on “How to flash the KK 2.0 flying board using an Arduino

  1. Reply Chris Feb 16,2013 11:51

    First of all, thanks for the guide!
    Second, I think you’ve got MISO and MOSI pins the wrong way. I think it should be like this, based on the ArduinoISP sketch code and 324pa’s datasheet:

    Arduino Pin 11 – MOSI
    Arduino Pin 12 – MISO

    Anyway, my problem is that I cannot get it to work. I get

    avrdude: Device signature = 0x1e9406
    avrdude: Expected signature for ATmega324PA is 1E 95 11
    Double check chip, or use -F to override this check.

    no matter what I do…
    Looks like avrdude picks up the arduino’s AVR instead of the KK2′s… Any ideas??

    Disabling auto reset on my Diecimila results in “avrdude: stk500_recv(): programmer is not responding”.

    Thanks

  2. Reply Chris Feb 16,2013 12:48

    Got it to work somehow…

    So, I started all over, disabled auto-reset on the board and ran the following:
    # avrdude -P /dev/ttyUSB0 -b 19200 -c avrisp -p m324pa -v
    it went fine.
    Then I tried:
    # avrdude -P /dev/ttyUSB0 -b 19200 -c avrisp -p m324pa -v -e -U flash:w:/tmp/5/OpenAero2_B4_1.hex:i

    I was getting “stk500_recv(): programmer is not responding” all the time, but one time it managed to succeed!

    That took a while :)

    Anyway, the MOSI/MISO connections are the way I wrote them :)

    • Reply admin Feb 21,2013 17:32

      Dear Chris,

      Sorry for the late reply.

      Did you provide sufficient external power to the Arduino and your board? 5V from the USB might not be enough! I would recommend hooking up the Arduino to something stronger like a 12V power wall plug.

      It is true that some of the boards are special because of their auto-reset that happens when you don’t want.

      Did you try the command with arduino instead of avrisp at all?

      If you would provide some details on how you disables the auto.reset and maybe retry with a stronger battery source, I would gladly amend the guide and include your findings!

  3. Reply Kiwi May 2,2013 22:55

    I managed to do this update with an Arduino Nano. First I had some problems with avrdude/kkmulticopterflashtool trying to flash to the arduino instead of the KK2.0 board and displaying an error for the boards signature “Expected signature for ATmega324PA”. Fixed this by adding a capacitor of 22uF between arduinos RST and GND-pins. This disables the auto-reset of the arduino and it wont automaticly be receptable to flashing.
    The other problem I got was “stk500_recv(): programmer is not responding”. Solved it by changing baudrate to 19200 (it was higher as default in KKflashTool).

    • Reply admin May 18,2013 14:19

      Hi Kiwi,

      Thank you for the helpful comments.

      I could update the guide using your feedback. Was there anything else special going on?

      Best,

  4. Reply Don M Jun 29,2013 02:46

    Worked like a charm! Got the latest 1.6 on my KK2. Thanks a bunch!

    • Reply admin Jul 17,2013 15:48

      Thank you for your feedback. We don’t bring many tutorials, but we do try to bring quality :)

  5. Reply fhayashi Jul 18,2013 00:49

    I struggled with the instructions for a bit, checked out some other websites.

    Then I discovered my omission that is probably so obvious that it wasn’t clear to the author of the instructions to mention.

    You have to load the avrisp sketch onto the Arduino you are using – it’s in the examples section of the arduino sample sketches.

    Once I figured this out, everything worked perfectly.

  6. Reply Philip Jul 26,2013 23:50

    Thanks for the instructions! :) Can I use your method to flash an esc with simonK firmware, too? Can i just replace the hex file and thats it?

    • Reply admin Aug 16,2013 14:23

      In principle it should work, how I do not use simonK FW so I could not tell you.

      Were you not able to find any instructions for the simonK firmware? Also, this tutorial is really tailored for the install of the KK boards, not for ESCs.

  7. Reply Karel Aug 12,2013 09:07

    Very nice guide, i used an Arduino uno r3 for this. Hooked up a 220uf cap on the arduino between reset and ground, worked like a charm!

    Thanks a bunch for this guide!

  8. Reply Karel Aug 13,2013 06:55

    Awesome guide! Had to hook up a 220uf cap on the arduino between reset and ground.
    Thanks!

  9. Reply Jonas Aug 15,2013 16:09

    Hi there,
    i tried to flash my KK 2.0 with a Arduino (no R3). I have to change the command into “avrdude.exe -P COM4 -c arduino -p m328p -v -e -U flash:w:kk2.hex:i” (w/o the -b 19200 and the -p 324pa has to changed to 328p in my case).
    So – my problem is that the flash procedure takes about 5 seconds, there is no flashing of the KK display at all but the rx/tx leds on the arduino are flashing while the procedure…

    Can you please help me?

    • Reply admin Aug 16,2013 14:22

      Hi Jonas,

      What is the outcome of the procedure? Nothing changed?

      Why do you have to change the command? It seems that the baud rate (eg the -b 19200 is really important).
      Also another person above suggested adding a 220uF Capacitor between reset and GND on the Arduino.

      Can you try that?

  10. Reply Jonas Aug 19,2013 13:31

    Hi,
    this is my outcome:
    ————————————————-
    C:\kkflashtool\lib\avrdude\windows>avrdude -P COM4 -c arduino -p m328p -v -e -U
    flash:w:kk2.hex:i

    avrdude: Version 5.11svn, compiled on Jan 18 2012 at 22:40:34
    Copyright (c) 2000-2005 Brian Dean
    Copyright (c) 2007-2009 Joerg Wunsch

    System wide configuration file is “C:\kkflashtool\lib\avrdude\windows\a
    vrdude.conf”

    Using Port : COM4
    Using Programmer : arduino
    AVR Part : ATmega328P
    Chip Erase delay : 9000 us
    PAGEL : PD7
    BS2 : PC2
    RESET disposition : dedicated
    RETRY pulse : SCK
    serial program mode : yes
    parallel program mode : yes
    Timeout : 200
    StabDelay : 100
    CmdexeDelay : 25
    SyncLoops : 32
    ByteDelay : 0
    PollIndex : 3
    PollValue : 0×53
    Memory Detail :

    Block Poll Page
    Polled
    Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW Max
    W ReadBack
    ———– —- —– —– —- —— —— —- —— —– —
    – ———
    eeprom 65 20 4 0 no 1024 4 0 3600 36
    00 0xff 0xff
    flash 65 6 128 0 yes 32768 128 256 4500 45
    00 0xff 0xff
    lfuse 0 0 0 0 no 1 0 0 4500 45
    00 0×00 0×00
    hfuse 0 0 0 0 no 1 0 0 4500 45
    00 0×00 0×00
    efuse 0 0 0 0 no 1 0 0 4500 45
    00 0×00 0×00
    lock 0 0 0 0 no 1 0 0 4500 45
    00 0×00 0×00
    calibration 0 0 0 0 no 1 0 0 0
    0 0×00 0×00
    signature 0 0 0 0 no 3 0 0 0
    0 0×00 0×00

    Programmer Type : Arduino
    Description : Arduino
    Hardware Version: 3
    Firmware Version: 4.4
    Vtarget : 0.3 V
    Varef : 0.3 V
    Oscillator : 28.800 kHz
    SCK period : 3.3 us

    avrdude: AVR device initialized and ready to accept instructions

    Reading | ################################################## | 100% 0.00s

    avrdude: Device signature = 0x1e950f
    avrdude: safemode: lfuse reads as 0
    avrdude: safemode: hfuse reads as 0
    avrdude: safemode: efuse reads as 0
    avrdude: erasing chip
    avrdude: reading input file “kk2.hex”
    avrdude: writing flash (32172 bytes):

    Writing | ################################################## | 100% 5.31s

    avrdude: 32172 bytes of flash written
    avrdude: verifying flash memory against kk2.hex:
    avrdude: load data flash data from input file kk2.hex:
    avrdude: input file kk2.hex contains 32172 bytes
    avrdude: reading on-chip flash data:

    Reading | ################################################## | 100% 4.49s

    avrdude: verifying …
    avrdude: 32172 bytes of flash verified

    avrdude: safemode: lfuse reads as 0
    avrdude: safemode: hfuse reads as 0
    avrdude: safemode: efuse reads as 0
    avrdude: safemode: Fuses OK

    avrdude done. Thank you.
    ————————————————-

    The transfer of the data takes only 5 sec…in another tutorial it took about 31s to write into the KK board.

    I have to change the command by delete the -b 19200 because otherwise i’ll get an “avrdude: stk500_recv(): programmer is not responding” error.

    The capacitor is installed between RST and GND.

    Thanks for your help :-)

  11. Reply Jonas Aug 21,2013 10:50

    Hi there,

    i found the error. I used a 10 µF capacitor like in your tutorial and not a 22 µF like Kiwi and Karel used. The 22 µF solved the problem – it worked like a charm!

    Thanks a lot!

  12. Reply Mehmet Sep 7,2013 16:46

    Where should i connect VCC?

    I’m getting this error;

    sudo avrdude -P /dev/ttyACM0 -p m324pa -c arduino -b 19200

    avrdude: stk500_getparm(): (a) protocol error, expect=0×14, resp=0×14

    avrdude: stk500_getparm(): (a) protocol error, expect=0×14, resp=0×01
    avrdude: stk500_initialize(): (a) protocol error, expect=0×14, resp=0×10
    avrdude: initialization failed, rc=-1
    Double check connections and try again, or use -F to override
    this check.

    avrdude: stk500_disable(): unknown response=0×12

    avrdude done. Thank you.

    • Reply admin Sep 12,2013 18:55

      Hi Mehmet,

      You need to power the Vcc seperately. You cannot use the power from the Arduino as it does not provide enough current.

      Does this help?

  13. Reply John-Paul Sep 20,2013 18:10

    First, wanted to thank-you for these instructions. They worked great for getting me from 1.2 to 1.6, using two 10uF in parallel.

    I then sadly broke the LCD on my board. I have been trying without success to load the NoLCD firmware, though re-reading your instructions today, I realize I failed to properly locate pin 1 on the board when re-attaching the wires. Fingers crossed everything works tonight.

    Second though, why shouldn’t you power the board through Vcc? The NoLCD instructions say not to use a separate battery for the KK2, but how can I power it otherwise? At one point I tried a 12V / 5A wall jack, though I now realize I was putting the 5V into reset, not Vcc.

    • Reply John-Paul Sep 20,2013 18:14

      Oh, I also wanted to mention to everyone to REMOVE YOUR PROPS! Originally I wasn’t planning to when trying to reflash my board, but I am glad I did as my motors started spinning on their own. I would have easily slashed open my arms along with possibly my neck or a major artery.

    • Reply admin Oct 11,2013 14:51

      Hi John-Paul,

      If you power the board through the Vcc you might end up in a voltage drop that will not be enough to properly flash the KK.
      For me anyhow, when I flashed, nothing would happen until I applied an external power source.

      Of course, the GND should be the same, not that you have different reference points for your voltage.

      Other than that, I would say, whatever works for you.

  14. Reply alszik Oct 16,2013 16:47

    Hi,

    Thanks for this great tutorial! Based on this I’ve successfully flashed my KK2.0 board from 1.2 to 1.6++ using a Seeeduino (this is an arduino clone, with a “disable auto reset” switch, so the 10 uf cap was not needed) :)

    One other thing that I found useful is to connect some LEDs to your programmer:

    “You might also want to connect three LED’s (with resistors) on the following pins:
    9: Heartbeat – shows the programmer is running
    8: Error – Lights up if something goes wrong (use red if that makes sense)
    7: Programming – In communication with the slave”

  15. Reply Robert F Dec 10,2013 13:58

    hi;

    Is this possible on a Mac ?

  16. Reply Mario Dec 31,2013 21:51

    hi, very nice tutorial i just want to ask you if i can use my arduino uno to flash kk board V3.0 http://www.hobbyking.com/hobbyking/store/__21977__hobbyking_multi_rotor_control_board_v3_0_atmega328_pa_.html

    and thanx

  17. Reply AV80R Feb 7,2014 22:54

    Thank you very much.
    I have been battling trying to use a friend’s AVR JTAGICE mkII to program my kk2.0 but to no avail.
    This however, worked brilliantly and the instructions are clear and simple to follow.
    I recommend including an image such as this one: http://static.rcgroups.net/forums/attachments/1/2/6/2/6/3/a5320939-112-KK2%20ISP%20Pinout.jpg?d=1353605435 just to clarify the pinout layout on the ISP although it is very clear already.
    The size of the capacitor is also not too important, I used a 100uf cap. and it all went seamlessly.

    Yet again my arduino is one of my favorite tools.
    - AV80R

    • Reply admin Feb 9,2014 16:44

      Hey AV80R,

      Thanks for the suggestion. I updated the post using your link.
      Now it should be even more clear!

  18. Reply Ben Apr 6,2014 09:26

    HI There, trying my best but getting this error:

    avrdude.exe: stk500v2_ReceiveMessage(): timeout
    avrdude.exe: stk500v2_getsync(): timeout communicating with programmer

    Any Ideas guys?? Thanks !

    • Reply Trefex Apr 6,2014 10:06

      Can you a bit more specific? What have you tried? How does your wiring look like? Which Arduino are you using?

  19. Reply Ben Apr 7,2014 00:52

    Using Freetronics Eleven Uno compatible.
    All the wiring is as described in your examples, however i have seen other examples without the capacitor. The only capasitor i could find was a 1000uf 16v. Does the voltage matter? I guess i should say that i smoked this kk2.1 board. I repaired the burnt circuit lines and hope to reflash on the off chance that the FW got scrambled when i wired it up cross polarity. I am in Australia, and they do not have the kk2.1.5 in stock here yet and can not give me an eta. I only just finished building this tricopter, got it flying well and then accidently wired it us cros plarity.

    This is what i get:
    Flash the firmware from repository.
    Flashing firmware from file.: C:\Documents and Settings\User\Desktop\tmp\KK1_9_MPU6050.hex

    C:\Documents and Settings\User\Desktop\lib\avrdude\windows\avrdude.exe -C C:\Documents and Settings\User\Desktop\lib\avrdude\windows\avrdude.conf -p m644p -P COM8 -c arduinousblinker -b 18000 -e -U flash:w:C:\Documents and Settings\User\Desktop\tmp\KK1_9_MPU6050.hex:i
    avrdude.exe: stk500v2_ReceiveMessage(): timeout
    avrdude.exe: stk500v2_ReceiveMessage(): timeout
    avrdude.exe: stk500v2_ReceiveMessage(): timeout
    avrdude.exe: stk500v2_ReceiveMessage(): timeout
    avrdude.exe: stk500v2_ReceiveMessage(): timeout
    avrdude.exe: stk500v2_ReceiveMessage(): timeout
    avrdude.exe: stk500v2_getsync(): timeout communicating with programmer

    I would look as puchasing a multiwii or other board but the thought of having to set it up with out the use of the LCD is daunting. I am not realy good at all the wiring and FW updates.

    May just have to wait for the KK2.1.5 to come to Aus.

    Thanks heaps for this thread.
    Blessings!

    • Reply Trefex Apr 7,2014 12:15

      Hey,

      Can you try removing the -b 18000 from the command?

      Also, why are you using arduinousblinker and not arduino ?

      Also, can you try avrisp instead of arduinousblinker?

      Cheers,

  20. Reply Ben Apr 12,2014 13:35

    Hi again,

    I have rewired it all and tried again and this is what i got.
    By the way, i am on Mac and also using the KKflash tool. I have no idea about how to use the command prompt.

    This is what I now get:

    Flash the firmware from repository.
    Flashing firmware from file.: /Users/benjamintownson/Library/Preferences/kkMulticopterFlashTool/KK1_9_MPU6050.hex

    /Applications/kkMulticopter Flash Tool.app/Contents/Resources/Java/lib/avrdude/mac/avrdude -C /Applications/kkMulticopter Flash Tool.app/Contents/Resources/Java/lib/avrdude/mac/avrdude.conf -p m644p -P /dev/cu.usbmodemfa131 -c avrisp -e -U flash:w:/Users/benjamintownson/Library/Preferences/kkMulticopterFlashTool/KK1_9_MPU6050.hex:i

    avrdude: AVR device initialized and ready to accept instructions

    Reading | ################################################## | 100% 0.01s

    avrdude: Device signature = 0×000000
    avrdude: Yikes! Invalid device signature.
    Double check connections and try again, or use -F to override
    this check.

    avrdude done. Thank you.

    Error during writing flash.

    I am sure that the connections are correct.
    Any ideas?

    Thanks again.

    • Reply Trefex Apr 12,2014 14:23

      Hi,

      What happens when you just do

      avrdude -P /dev/cu.usbmodemfa131 -p m644p -c stk500v1 -b 19200

      or

      avrdude -P /dev/cu.usbmodemfa131 -p m644p -c stk500v1

      or

      avrdude -P /dev/cu.usbmodemfa131 -p m644p -c avrispmkII

      or

      avrdude -P /dev/cu.usbmodemfa131 -p m644p -c avrisp2

      or

      avrdude -P /dev/cu.usbmodemfa131 -p m644p -c arduino

  21. Reply Ben Apr 13,2014 05:28

    I do not know how to enter those commands, as I do not know how to use the command prompt. The only thing i can do is to enter the fields on the KKflash tool application and then run the program.
    I have been copying the text above form the window at the bottom of the kk flash tool application.

    Just tried to copy and paste your comands into terminal and then hit enter but i just got:

    “-bash: avrdude: command not found”

    Sorry, i wish i knew how to use the command prompt. (terminal”

    • Reply Trefex Apr 13,2014 10:07

      Right,

      Sorry didn’t see that comment.

      If you have MacOS X, you can find the “terminal” application at /Applications/Utilities.

      All commands I posted would then start with /Applications/kkMulticopter Flash Tool.app/Contents/Resources/Java/lib/avrdude/mac/avrdude instead of simply avrdude as you need to tell your Mac where is it that avrdude can be found.

  22. Reply Ben Apr 13,2014 12:05

    Ok. I will give it a go soon.

    Thanks heaps.

    Ben

  23. Reply Ben Apr 13,2014 14:30

    Hi Trefex,

    I did my best to get the command prompt to work but to no avail. This is what I got:

    avrdude: can’t open config file “/usr/local/etc/avrdude.conf”: No such file or directory
    avrdude: error reading system wide configuration file “/usr/local/etc/avrdude.conf”

    Using the KKflashtool this I think is the closest I have come so far, but I think it reflects the fact that I smoked this KK board and it is dead, and trying to flash it will not revive it.

    This is what I got:

    Flash the firmware from repository.
    Flashing firmware from file.: /Users/benjamintownson/Library/Preferences/kkMulticopterFlashTool/KK1_9_MPU6050.hex

    /Applications/kkMulticopterFlashTool.app/Contents/Resources/Java/lib/avrdude/mac/avrdude -C /Applications/kkMulticopterFlashTool.app/Contents/Resources/Java/lib/avrdude/mac/avrdude.conf -p m644p -P /dev/cu.usbmodemfa131 -c arduino -e -U flash:w:/Users/benjamintownson/Library/Preferences/kkMulticopterFlashTool/KK1_9_MPU6050.hex:i

    avrdude: AVR device initialized and ready to accept instructions

    Reading | ################################################## | 100% 0.00s

    avrdude: Device signature = 0x1e950f
    avrdude: Expected signature for ATmega644P is 1E 96 0A
    Double check chip, or use -F to override this check.

    avrdude done. Thank you.

    Error during writing flash.

    I think I will just have to get another one from HK. Just noticed that they are now in stock in the international warehouse.
    Feel bad that I am taking up so much of your time to fix my mess-up.

    Have been looking at the multiwii boards but they look even more complicated to set-up than the KK2.

    Thanks again.
    Ben

    • Reply Trefex Apr 13,2014 14:43

      You getting close though.

      1. Instead of choosing m644p try using m328p.

      2. And for the error you got before, you can do

      cp /Applications/kkMulticopterFlashTool.app/Contents/Resources/Java/lib/avrdude/mac/avrdude.conf /usr/local/etc/avrdude.conf

      then it should work what i typed before.

  24. Reply Ben Apr 14,2014 16:45

    OK!!

    Well, I got the first part working, this is what I used:

    Desktop\lib\avrdude\windows\avrdude -P COM8 -p m328p -c arduino

    The output on comand prompt was exactly as on the example above – YAY!!

    (By the way I decided the command prompt on the Mac did not make sense to me so decided to go back to the old desktop.)

    SO I tried to flash the board with:

    Desktop\lib\avrdude\windows\avrdude.exe -P COM8 -b 19200 -c arduino -p m328p -v -e -U flash:w: C:\Documents and Settings\User\Desktop\KK2V1_1V9S3

    And it did just as on the example but then it said:

    yikes, invalid decice signature 0×000000

    I dont get it?? So Close!!

    • Reply Trefex Apr 14,2014 18:17

      Great we have progress!

      Try this. I think you are missing the hex name with the extension in the snippet you provided? Eg C:\Documents and Settings\User\Desktop\KK2V1_1V9S3 is a folder right, and inside you have the .hex file? You should change that in the line below.

      Desktop\lib\avrdude\windows\avrdude -P COM8 -c arduino -p m328p -v -e -U flash:w:”C:\Documents and Settings\User\Desktop\KK2V1_1V9S3″:i

  25. Reply Ben Apr 17,2014 02:32

    Hello again,

    After much trying, I am still having trouble with this second stage. I noticed that the baurd rate was missing from the last example you asked me to try and it worked, however the baurd rate is on the most recent flash command being -b 19200. Does this matter???

    Any how, this is what is happening of late:
    Tried to flash with the command below:
    Desktop\lib\avrdude\windows\avrdude.exe –P COM8 –b 19200 -p m328p -c arduino -v -e -U flash:w:Desktop\174523227X318849X56\KK1_6_MPU6050\KK1_6_MPU6050.hex:i

    This is what I got:

    C:\Documents and Settings\User>Desktop\lib\avrdude\windows\avrdude.exe -P COM8 -
    b 19200 -p m328p -c arduino -v -e -U flash:w:Desktop\174523227X318849X56\KK1_6_M
    PU6050\KK1_6_MPU6050.hex:i

    avrdude.exe: Version 5.11svn, compiled on Jan 18 2012 at 22:40:34
    Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
    Copyright (c) 2007-2009 Joerg Wunsch

    System wide configuration file is “C:\Documents and Settings\User\D
    esktop\lib\avrdude\windows\avrdude.conf”

    Using Port : /dev/parport0
    Using Programmer : arduino
    avrdude.exe: ser_open(): can’t open device “/dev/parport0″: The system cannot fi
    nd the path specified.

    There is something wrong with the port. What do you think?
    Thanks again!

    • Reply Trefex Apr 17,2014 11:21

      Hi,

      Baud rate is not so important, so you can safely remove it.

      When you unplug and replug your Arduino, it can be that the COM port changes. You have to make sure that indeed the Arduino is available on COM8.

      Edit: On second thought, why does avrdude think you are using a port on /dev/something? Are you using a VM in MacOS?
      Can you check in avrdude.conf if something is weird there with relation to the port being used?

      Best,

  26. Reply Ben Apr 17,2014 12:17

    Hello Again,
    Just changed some wiring and ran this command:

    C:\Documents and Settings\User>Desktop\lib\avrdude\windows\avrdude.exe -P COM8 -
    b 19200 -c arduino -p m328p -v -e -U flash:w: C:\Documents and Settings\User\Des
    ktop\174523227X318849X56\KK1_6_MPU6050\KK1_6_MPU6050.hex:i

    This is what I got now!

    Programmer Type : Arduino
    Description : Arduino
    Hardware Version: 2
    Firmware Version: 1.18
    Topcard : Unknown
    Vtarget : 0.0 V
    Varef : 0.0 V
    Oscillator : Off
    SCK period : 0.1 us

    avrdude.exe: AVR device initialized and ready to accept instructions

    Reading | ################################################## | 100% 0.03s

    avrdude.exe: Device signature = 0×000000
    avrdude.exe: Yikes! Invalid device signature.
    Double check connections and try again, or use -F to override
    this check.

    avrdude.exe done. Thank you.

    I Will check the connections and try again!

  27. Reply Ben Apr 17,2014 13:21

    Tried using the ESC to power the vcc, and then to power the ESC pin outs, no luck as yet, also changed the cap for a 22uf, still no joy on this KK2.1!

    Still get the same problem:
    avrdude.exe: AVR device initialized and ready to accept instructions

    Reading | ################################################## | 100% 0.03s

    avrdude.exe: Device signature = 0×000000
    avrdude.exe: Yikes! Invalid device signature.
    Double check connections and try again, or use -F to override
    this check.

    avrdude.exe done. Thank you.

    Any thoughts?

    • Reply Trefex Apr 17,2014 13:33

      Hey,

      I’m not sure what you’re changing between each time you post here :) The last time we got the correct signature of the device and the only thing that was wrong was probably the baud rate. There should be no re-wiring and all that necessary if you followed instructions. Are you still using same Freeduino ? Everything else the same? What happens when you remove the baud rate always?

  28. Reply Ben Apr 19,2014 11:17

    All is working past the test stage but with the flash this is now the latest result:

    Programmer Type : Arduino
    Description : Arduino
    Hardware Version: 3
    Firmware Version: 4.4
    Vtarget : 0.3 V
    Varef : 0.3 V
    Oscillator : 28.800 kHz
    SCK period : 3.3 us

    avrdude.exe: AVR device initialized and ready to accept instructions

    Reading | ################################################## | 100% 0.02s

    avrdude.exe: Device signature = 0x1e950f
    avrdude.exe: safemode: lfuse reads as 0
    avrdude.exe: safemode: hfuse reads as 0
    avrdude.exe: safemode: efuse reads as 0
    avrdude.exe: erasing chip
    avrdude.exe: reading input file “C:\KK2V1_1V10S1\KK1_10_MPU6050.hex”
    avrdude.exe: ERROR: address 0×8010 out of range at line 2050 of C:\KK2V1_1V10S1\
    KK1_10_MPU6050.hex
    avrdude.exe: read from file ‘C:\KK2V1_1V10S1\KK1_10_MPU6050.hex’ failed

    avrdude.exe: safemode: lfuse reads as 0
    avrdude.exe: safemode: hfuse reads as 0
    avrdude.exe: safemode: efuse reads as 0
    avrdude.exe: safemode: Fuses OK

    avrdude.exe done. Thank you.

    I have downloaded a different version of the firmware to try to fix this problem but still get the same error.

    Thanks again, hope there is something to go on here.
    Ben

  29. Reply Ben Apr 19,2014 11:18

    BTW, I removed the baud rate from the command.

    Ben

  30. Reply Ben Apr 21,2014 12:08

    All good, I will be ordering a new one this week. Thanks for teaching me heaps about using command prompt. Happy flying. And thanks again for all your time. Ben

Leave a Reply