Flash ESC SimonK Firmware Using Arduino Without USBasp adapter

I will show you how to flash the ESC with SimonK Firmware with the Arduino, even when you don’t have a USBasp programmer adapter. So what is Firmware Flashing? Firmware is the program and settings on your electronic device. By flashing the firmware, the program and settings get overwritten by new firmware. SimonK is a famous ESC firmware, that is specially designed for multicopter application. It is developed to improve the performance of electronic speed controllers. I found it gives you these benefits and features:

  • Faster processing and response time
  • Higher resolution (smooth change of speed)
  • ICP-based pulse time recording (on supported hardware) for zero throttle jitter
  • Accepts any PWM update rate (minimum ~5 microseconds PWM low time)
  • Optimized interrupt code (very low minimum PWM and reduced full throttle bump)
  • Smooth starting in most cases

However, despite all the goodies, firmware flashing involves risk of damaging ESC permanently, therefore do it at your own risk.

ESC-flash-firmware-pins

In this tutorial i will show you how to flash Hobbyking F-30A ESCs using KK flash tool. The process is same for F-20A ESCs as well. There are some software and hardware configurations you need know before flashing your ESCs. This page intends to cover as much necessary hardware, software and the flashing process as possible. Leave me an message if you have any questions.

For more detail about the SimonK firmware, you can visit Simon’s Github page. Here, we give a big thank you to the people who developed and made available this firmware.

Software Requirement

Same flashing tool I used when flashing the KK2.0 flight controller board, there doesn’t seem to be many options when it comes to using the Arduino as programmer.

To verify which firmware hex file you need, look it up on this table. Make sure you click on the picture as well.

Hardware Requirement

There are many people using USBasp adapter, and some sort of cable to press on the pad when flashing. It looks easy, but it didn’t work for me.

HK-esc-Flashing-Tool

Simple-esc-flashing-adapter

Maybe I was doing it wrong, anyway I decided to just solder the cables on the flashing pins on the ESC. It took longer, but it worked.

  • Arduino Uno or Mega
  • Thin Wires and male/female Jumper cables
  • solder Iron (if you don’t want to solder, follow other people’s methods of making a “press-on” adapter)

This is how I connected everything.

flash esc arduino

Steps

  1. download the flashing tool and upzip it under D Drive in a folder called “flash”  (use C drive if you don’t have D drive)
  2. download the firmware and unzip it under D drive in a folder called “ESC” (use C drive if you don’t have D drive)
  3. In the Arduino IDE, load “ArduinoISP” in the Examples to the Arduino Mega/Uno.
  4. Connect everything following this pins
    // pin name:    not-mega:         mega(1280 and 2560)
    // slave reset: 10:               53 
    // MOSI:        11:               51 
    // MISO:        12:               50 
    // SCK:         13:               52
    // 5V:          5V:               5V
    // GND:         GND:              GND
  5. Open command line in Windows, copy and paste this command
    For Arduino Uno

    D:flashlibavrdudewindowsavrdude.exe -P COM1 -b 19200 -c arduino -p m8  -v -e -U flash:w:"D:ESCbs_nfet.hex":i

    For Arduino Mega

    D:flashlibavrdudewindowsavrdude.exe -P COM1 -b 19200 -c avrisp -p m8 -v -e -U flash:w:"D:ESCbs_nfet.hex":i

    Don’t forget to replace com port to your own one.

  6. And after 20 to 40 seconds you should see “avrdude.exe done.  Thank you.” And that’s it!
    simonK-firmware-esc-flash-command-line-window-output

    The Exact output is:

    C:UsersOscar>D:flashlibavrdudewindowsavrdude.exe -P COM12 -b 19200 -c avr
    isp -p m8 -v -e -U flash:w:"D:ESCbs_nfet.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 "D:flashlibavrdudewindowsavr
    dude.conf"
    
                 Using Port                    : COM12
                 Using Programmer              : avrisp
                 Overriding Baud Rate          : 19200
                 AVR Part                      : ATmega8
                 Chip Erase delay              : 10000 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                     : 0x53
                 Memory Detail                 :
    
                                          Block Poll               Page
              Polled
                   Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW
     MaxW   ReadBack
                   ----------- ---- ----- ----- ---- ------ ------ ---- ------ -----
     ----- ---------
                   eeprom         4    20   128    0 no        512    4      0  9000
      9000 0xff 0xff
                   flash         33    10    64    0 yes      8192   64    128  4500
      4500 0xff 0x00
                   lfuse          0     0     0    0 no          1    0      0  2000
      2000 0x00 0x00
                   hfuse          0     0     0    0 no          1    0      0  2000
      2000 0x00 0x00
                   lock           0     0     0    0 no          1    0      0  2000
      2000 0x00 0x00
                   calibration    0     0     0    0 no          4    0      0     0
         0 0x00 0x00
                   signature      0     0     0    0 no          3    0      0     0
         0 0x00 0x00
    
                 Programmer Type : STK500
                 Description     : Atmel AVR ISP
                 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.08s
    
    avrdude.exe: Device signature = 0x1e9307
    avrdude.exe: safemode: lfuse reads as 2E
    avrdude.exe: safemode: hfuse reads as C9
    avrdude.exe: erasing chip
    avrdude.exe: reading input file "D:ESCbs_nfet.hex"
    avrdude.exe: writing flash (8192 bytes):
    
    Writing | ################################################## | 100% 5.70s
    
    avrdude.exe: 8192 bytes of flash written
    avrdude.exe: verifying flash memory against D:ESCbs_nfet.hex:
    avrdude.exe: load data flash data from input file D:ESCbs_nfet.hex:
    avrdude.exe: input file D:ESCbs_nfet.hex contains 8192 bytes
    avrdude.exe: reading on-chip flash data:
    
    Reading | ################################################## | 100% 4.00s
    
    avrdude.exe: verifying ...
    avrdude.exe: 8192 bytes of flash verified
    
    avrdude.exe: safemode: lfuse reads as 2E
    avrdude.exe: safemode: hfuse reads as C9
    avrdude.exe: safemode: Fuses OK
    
    avrdude.exe done.  Thank you.
    
    C:UsersOscar>
  7. I recommend test your ESC right after the firmware flashing.

Possible Errors when Flashing SimonK Firmware on ESC

Do not respond when writing or reading (nothing happens it just stops!)

It could be possible that your connection has broken during the writing or reading process, check your wire connection and restart again.

exe: stk500_recv(): programmer is not responding

Same as above.

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

Very likely to be the connection. Double check your wire connection, make sure there is no short circuit and cables are connected properly.

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

If you get this, it means you are using the wrong processor chip in your command. For Arduino Mega, the board parameter should be m8, Arduino Uno should be m324pa.

Conclusion

That’s it! Once you setup everything, it’s only a 2 mins job between each ESC.

14 thoughts on “Flash ESC SimonK Firmware Using Arduino Without USBasp adapter

  1. kobi

    it’s posibale to use pro mini not nano?
    i order nano alredy but it’s on the way from china and i have here the pro mini + ftdi…

    Reply
    1. Oscar Post author

      because you are not using Arduino Uno like I did in the tutorial. For other Arduino which you can’t remove the MCU, you need to first turn it into a FTDI programmer first.

      Reply
      1. Jan

        Nano or Uno should work fine and the same as long as you are using it as an ArduinoISP. I’ve been using Arduino Nano as my ISP as it is more compact.

  2. Flyer

    Here is a way to make your own GO-ON-TOP Atmega flashing tool and flash ESC with arduino:
    youtube.com/watch?v=DEicl-2aFts

    Reply
  3. Marco

    Hi Oscar,

    The 2 codes that can be used in the Windows command line, can one of them also be used with an Arduino Nano?

    Thanks for this toturial!

    Greets, Marco

    Reply
      1. Marco

        Thanks!

        I adapted the cod a bit: D:flashlibavrdudewindowsavrdude.exe -P COM3 -b 19200 -c arduino -p m328 -v -e -U flash:w:”D:ESCbs_nfet.hex”:i

        After trying a few times I still got this error: “avrdude: stk500_getsync(): not in sync: resp=0x15”
        This error (using an Nano V3) is that the board has an built in ‘auto-reset’ that stops the writing.
        Problem info: playground.arduino.cc/Code/MegaISP
        Solution info: playground.arduino.cc/Main/DisablingAutoResetOnSerialConnection

        I don`t have any good resistors right now but I will try to get one as soon as possible.

        Greets,

        Marco

Leave a Reply

Your email address will not be published. Required fields are marked *

Are you Robot? *

I don't look at blog comments very often (maybe once or twice a week), so if you have any questions related to multirotor please post it on this forum IntoFPV.com... You're likely to get a response from me faster on there.