BLHeli on Hobbyking 40A ESC 4A UBEC 9261000003

The recent release 11.2 of BLHeli supports some popular Atmel based ESCs.


This article is a review of HK_UBEC_40A_MULTI_REV11_2 on that ESC (…arehouse_.html) at 4S with a Hobbyking 4822-690Kv 22 pole motor and 1045 SF propeller.  This ESC was chosen as it is an inexpensive ESC that rates well in features (fast N FETs, support for bootloader and fully damped mode) in BLHelis documented compatibility list.ESC02Above is a view of the component side of the ESC (though it is a double PCB assembly and parts are located in the middle and on the other side.


The drive system was bench tested using both a hand operated servo tester and an automated test using Arduino RC servo ramp generator.

Screenshot - 09_04_2014 , 11_14_18

Above is a capture of part of the automated test using Elogger.

Response was a little slower on very fast throttle changes compared to the current release of SimonK, but seemed comparable on the scenarios shown above. The currents were similar, but BLHeli tended to be a little noisier current at times.

The bench test was satisfactory, and in time BLHeli for Atmel may be tested on a quad. (I already use BLHeli for Silabs quite successfully on one quad).

It appears that BLHeli does not use the watchdog timer, apart from turning it off at the start of the code, there is no further reference in comments. It is a sign of supreme confidence in the code that the watchdog timer is not used!

Bootloaders, tools and things

In trying to install and test this release, I firstly used the hex files that are in the BLHeli repo. They do not include a boot loader.

The first installation was to load them using avrdude and an ISP adapter. It happens that in reusing a batch file for the process, that I set the fuses and locks the same as I would with SimonK with bootloader, including that I write protected the bootloader.

It turned out that in a perhaps misguided approach to protecting the open nature of BLHeli, the author had inserted code that caused it to do nothing (to spin actually) if any lock bits had been cleared… and so it didn’t work. I wasted a lot of time in compatibility checking, comparing .inc files, testing between SimonK and BLHeli before asking on a forum to find of this incompatibility.

There is very good reason to write protect a boot loader, it is widely done for reliability to prevent accidental overwriting, and may be done as part of a IP protection scheme. I have always write protected the bootloader used by SimonK for reliability, particularly to prevent regression to a defective bootloader while testing various code releases.

Screenshot - 09_04_2014 , 18_13_18

The separate package BLHeliSuite is a tool for writing the chip memories and customising parameters stored in EEPROM. The concept of putting custom parameters in EEPROM separate from the executable is a good one. BLHeliSuite also includes the AVRootloader bootloader.

Since my initial test was before finding BLHeliSuite, I tried installing BLHeli without boot loader and under SimonK bootloader… all to no avail because of the previously mentioned trap on bootloader lock bits.

I have been able to install the hex file I built bypassing the lock test so it will run on the chip with locked bootloader, and I loaded that flash and associated EEPROM files using avrdude over the USBLinker with SimonK bootloader.

I later installed a patched exe for BLHeliSuite, and was able to connect to the ESC as a STK500v2 using USBLinker, and read, edit and save the EEPROM data. On closing and reopening, I can read the changed EEPROM, the changes were persistent… all good.

Installing the flash image with BLHeliSuite has not been further tested as it will install the hex file that is incompatible with a locked bootloader. I did try to select my custom hex file from BLHeliSuite, but it just seemed to ignore the file. There is another scheme documented in the file …BLHeli_HexFiles\Avr\Readme.txt.


At this point in time:

  • BLHeli v11.2 doesn’t work with a locked bootloader;
  • a patched BLHeli v11.2 for MULTI bypassing the lock test worked well in a bench test;
  • I have been able to install BLHeli flash image using avrdude and USBLinker ( stk500v2) and SimonK bootloader;
  • the BLHeli repo does not contain the code for the AVRootloader bootloader, or the means of building the modules as distributed in BLHeliSuite for ‘turnkey’ users;
  • I have been able to use BLHeliSuite to tweak the EEPROM parameters using USBLinker ( stk500v2) and SimonK bootloader;
  • the preferred bootloader uses a different programming tool;

Further test will await availability of BLHeli and BLHeliSuite which allow a locked bootloader (should they do that). At that time, I will also test installing SimonK flash under the AVRootloader.

I understand the issues are:
– the preferred boot loader is smaller in size, and may be necessary for some configurations;
– the preferred bootloader needs another programmer (though can work with a range of programmer implementations);
– the production code is currently incompatible with locking the bootloader.

More at BLHeli on Hobbyking 40A ESC 4A UBEC 9261000003 – #2.