1-wire interface for reprogramming/flashing BLHeli ESC's

jhitesma

Some guy in the desert
Mentor
I've mentioned this in a few of my build threads and a couple people have asked for more details. So I figured rather than bury it in one of my existing threads I should just go ahead and start a new one.

I've been experimenting with BLheli instead of Simonk for my ESC's since it supports regenerative braking (well, simonk does as well...but it's easier to setup on BL and seems more supported) and because I was curious what BL was like now that it supports atmel processors as well as silabs. I'm pretty impressed by it so far and one of the big things I like is the BLHeli Suite for programming/flashing. It supports tons of different interface options and makes it really easy to change settings on your ESC's.

You still have to do the initial flash the traditional way - either with a socket tool, or somehow attaching 6 wires from a usbasp ISP programmer to the 6 programming pads. But if you choose to use the blheli bootloader when you do that initial flash you get a lot of flexibility in how to flash and change settings afterwards. You can use a USB Linker like the afro tool, you can use an arduino as a linker, there's code that can be loaded into MW to let a MW board act as a linker (which is a very cool idea I'm shocked hasn't been used more) and you can use a 1-wire interface which is what I'm going to detail here today.

The 1-wire interface uses a standard "FTDI" serial to usb adapter. It just requires one resistor and one diode wired up - the BLheli suite comes with instructions on how to do this and I covered how I made mine in this post from my Twitchity quad.

The way this works is when the ESC first powers up it initially goes into a bootloader mode for a second or so which allows a programmer to attach to it. If no programmer attaches then the ESC continues booting as normal, but if a programmer attaches the ESC stays in bootloader mode and you can reflash it and modify it's settings through the 1-wire interface.


Here's my programmer setup. It's just an FTDI adapter with the 1-wire interface I made attached (see the link above for details on how I built it.) The interface is just a resistor and diode and the resistor is actually optional - but it allows for faster connection speeds having it so it's worth doing right.
10756830_10152381327536805_47244207_o.jpg

My interface terminates in female headers because on the Twitchity quad I built and first used this on I added 2 pins on each ESC for reflashing. Normally you'll have it the other way around with female connections on the ESC's and male on the programming interface...and such is the case on my Knuckle/Tau build I'm updating tonight. So I grabbed some spare wire and pins and wired up an adapter for my adapter. Due to the setup on my Tau I also added another adapter for my adapter for my adapter to convert it back to female for the ground connection. Yeah, it's ugly but it's not like anyone but me has to look at it :D The white wire is the ground and the one with the red heat shrink is the signal. These can just connect straight to the ESC if you're using normal ESC wiring...my wiring isn't quite "normal" :)
10578343_10152381328626805_1682569586_o.jpg

Here's the inside view of my setup. The orange wires are the ESC signal wires and I put them all on one header so I can connect/disconnect them all at once and not worry about which one goes where. The header has a small triangular mark indicating pin 1 so it's quick and easy to hook up correctly. Since I have all of these on one header connecting to ground for me is a bit trickier than if you're just using normal servo connectors. I figured the one four position connector is lighter than 4 - 3 position headers which are really only needed for 1 position each and I like the ease of one connection for all of my motors instead of 4 individual connections.
10585233_10152381317221805_1757828236_o.jpg

And here it is setup ready to flash! The signal wire from the 1-wire interface goes to the socket for the ESC I want to update or flash, and the ground I just connected to a convenient pin on my FC. Since I'm using a DiscoveryF4 developers board there are tons of ground pins to choose from, but just about any flight controller will have a number of ground pins you can use and most people will probably just use the normal servo connector from their ESC with signal/power/ground all right there.
10752344_10152381329576805_715064446_o.jpg

And that's it really! To change settings on my ESC's I just loosen 4 nuts to remove the top plate of my quad, pull off the motor connector and hook up to the socket for the ESC I want to work with. Since I was just making configuration changes today I used a normal flight pack to power things, but normally it would be best to power the ESC's off a current limited source like you do when flashing. Since my ESC power wires are soldered right to my power buss and I didn't feel like making up a pigtail to power my main connector from a better source I choose to just live dangerously and use my normal flight pack tonight.

Common mistakes (for me at least) when doing this are forgetting to select 1-wire as the interface in the BLheli suite since I sometimes use my usbasp for full ISP style flashing, and forgetting that the connection can only occur when the ESC is first powered up. So you have to first hit the "read ESC" button in BLheli suite BEFORE powering the ESC. The suite will sit there with a waiting prompt once you hit read and instruct you to power up the ESC. As soon as power hits that ESC the suite should connect and alert you if it was successful or unsuccessful. If it was successful then you can make your changes and hit write, or reflash. Boom, all done!

When you flash with blheli you can choose to have 1-wire on an alternative pin. If I was planning on messing with my ESC's a lot I'd have done that and run them to a separate header exposed on the outside of the quad. But I don't plan on changing these settings very often so I don't mind opening up the quad and disconnecting the motor wires. Still, it's nice that BL is so flexible since there are so many ways to do this!

I have a video uploading of me changing a setting on all four ESC's and giving a bit of a tour of the guts of this quad...but it's after 1AM, I have a strenuous hike up a mountain first thing in the morning, and there's still over 70 minutes to go on the upload. So I'll come back and add it later. It's set to publish as soon as it uploads so you can always just check my youtube channel if you don't want to wait for me to update this post :D

As always any questions fire away and I'll do my best to answer!
 

jhitesma

Some guy in the desert
Mentor
And here's the video of me changing the startup power on all four ESC's:


Sorry the video isn't better, mobius cameras aren't ideal for this kind of filming - makes it kind of hard to frame your shots :D
 

Twitchity

Senior Member
Great information, jhitesma. Thank you for going through the trouble to post this thread. I've been considering trying to flash the EMAX ESCs with BLHeli and mess around with some settings while I'm at it. I know you've looked at them before, and they had some weird form of BLHeli flashed to them. Are these able to be reflashed too?
 

jhitesma

Some guy in the desert
Mentor
The emax can be reflashed...but since their SiLabs chips it's considerably different than flashing avr based ESC's. I haven't done mine yet since I'm happy enough with their performance as is (especially for the price) and I don't have the SiLabs toolstick for flashing them. I think it can also be done with an arduino...but since I've had no luck getting an arduino setup to flash AVR's which I'm experienced with I haven't looked into flashing SiLabs chips with one just yet.

But, I do plan on getting a set of the emax ESC's for my twitchity quad in the next few weeks (I know I've been saying that for a month or two but now that AC season is over I'm pretty sure it's finally really going to happen :D....if FT hadn't released the mini's it would be happening this week but I had to pick up some 5g servos and more small batteries ;) ) and I hope to get one spare ESC so I'll have one to experiment with before trying to flash a full set. So I should know more about flashing SiLabs chips before the end of the year.

The big issue with SiLabs based ESC's is that they don't have enough memory for a full bootloader so the simple 1-wire interface and USB linker interfaces won't work with them even if you reflash them. So even once flashed it's a bit more complex to set them up for reflashing and changing settings. There are some tricks that can be done and it looks like there's even a way to modify all four in parallel due to how the SiLabs interface works...but since I haven't tried it yet I can't say for sure. I do have a full set of those ESC's on hand but since they're working just fine for me I'm not in any big hurry to go experimenting with them quite yet ;) But sooner or later my natural instincts will get the best of me and I'll start experimenting. Just not until I either get a spare set of ESC's to play with or until I'm done with the GPS experiments and am ready to start a new round of experiments with the emax.

Today would have been great for flying but unfortunately I ran out of time :( The hike this morning took longer than expected and the friend who went with me lost his father this week so I had to spend some time with him afterwards to let him talk some stuff out. By the time I got home there just wasn't enough time left to load things up and make it to the flying field before dark.
 

Mochaboy

Junior Member
The emax can be reflashed...but since their SiLabs chips it's considerably different than flashing avr based ESC's. I haven't done mine yet since I'm happy enough with their performance as is (especially for the price) and I don't have the SiLabs toolstick for flashing them. I think it can also be done with an arduino...but since I've had no luck getting an arduino setup to flash AVR's which I'm experienced with I haven't looked into flashing SiLabs chips with one just yet.

But, I do plan on getting a set of the emax ESC's for my twitchity quad in the next few weeks (I know I've been saying that for a month or two but now that AC season is over I'm pretty sure it's finally really going to happen :D....if FT hadn't released the mini's it would be happening this week but I had to pick up some 5g servos and more small batteries ;) ) and I hope to get one spare ESC so I'll have one to experiment with before trying to flash a full set. So I should know more about flashing SiLabs chips before the end of the year.

The big issue with SiLabs based ESC's is that they don't have enough memory for a full bootloader so the simple 1-wire interface and USB linker interfaces won't work with them even if you reflash them. So even once flashed it's a bit more complex to set them up for reflashing and changing settings. There are some tricks that can be done and it looks like there's even a way to modify all four in parallel due to how the SiLabs interface works...but since I haven't tried it yet I can't say for sure. I do have a full set of those ESC's on hand but since they're working just fine for me I'm not in any big hurry to go experimenting with them quite yet ;) But sooner or later my natural instincts will get the best of me and I'll start experimenting. Just not until I either get a spare set of ESC's to play with or until I'm done with the GPS experiments and am ready to start a new round of experiments with the emax.

Today would have been great for flying but unfortunately I ran out of time :( The hike this morning took longer than expected and the friend who went with me lost his father this week so I had to spend some time with him afterwards to let him talk some stuff out. By the time I got home there just wasn't enough time left to load things up and make it to the flying field before dark.

Just registered to say thanks for putting this write up together.

Just to add to the discussion, I'm running emax12amp blhelis escs on my quad minis and other 300 or under class multis. I did in fact reflash them with rev12.2 XP-12A (from the ESC selection box) and the combination of this firmware on this hardware has made a considerable difference in the performance of my rigs.

Anyway, I added permanent headers to the boards using 3 wire pigtails I cut down to size.
SAM_9625.JPG

Note the 4 pads - and 3 connections - these all conform to the blheli serial pinout.

On your UNO, connect up the GND (BLACK), D12 (WHITE), and D11(RED)...In this photo D12 is green because I didn't have a white wire.

SAM_9627.JPG

In the BLHeli Suite - make sure Silabs Serial Interface is checked.

Flash your UNO with either of the LCD UNO hex's available and that will set up your UNO as an ISP.

At that point - it's business as usual. When you connect to the ESC the very first time, it will say that it's not recognized and would you like to flash the chip with a new firmware. That's the part where you select XP-12A v12.2. I don't know if 13.2 works, and v12.2 is known to work so I stuck with that. The lowest Emax setting otherwise is a 20amp version so waiting to see if they come out with a firmware update for it.

The reason I soldered in the headers is because I do all my wiring to size and typically one of the early steps is to confirm motor direction. By soldering in the programming headers. I can solder the wires in however I want, then simply go and reverse the motor direction at a later time. It's also handy to set the calibration end points to match my transmitter end points without having to go through all that calibration nonsense.

FYI - one more note about the UNO - you get two programmer firmware/hex options, one that is Multi and one that is PNB. The multi hex is is if you're flashing all 4 escs at the same time. I opted to go for the one at at time hex.
 

silverthunder

Junior Member
This hopefully saved my new build...

after hours of research regarding ESC and AfroNaze Rev6 with EMAX Nano 12A OneShot125 and no working/calibrating ESC, I finally found some hints. Newest BLHeli 14.405Beta and using my Adurnio (3 Cables) finally worked. there was no BLHeli on the ESC's so no bootloader and one-wire connection didn't work....

Now, I'm back in the game :D

Thx!
G.
Stefan
Just registered to say thanks for putting this write up together.

Just to add to the discussion, I'm running emax12amp blhelis escs on my quad minis and other 300 or under class multis. I did in fact reflash them with rev12.2 XP-12A (from the ESC selection box) and the combination of this firmware on this hardware has made a considerable difference in the performance of my rigs.

Anyway, I added permanent headers to the boards using 3 wire pigtails I cut down to size.
View attachment 46661

Note the 4 pads - and 3 connections - these all conform to the blheli serial pinout.

On your UNO, connect up the GND (BLACK), D12 (WHITE), and D11(RED)...In this photo D12 is green because I didn't have a white wire.

View attachment 46662

In the BLHeli Suite - make sure Silabs Serial Interface is checked.

Flash your UNO with either of the LCD UNO hex's available and that will set up your UNO as an ISP.

At that point - it's business as usual. When you connect to the ESC the very first time, it will say that it's not recognized and would you like to flash the chip with a new firmware. That's the part where you select XP-12A v12.2. I don't know if 13.2 works, and v12.2 is known to work so I stuck with that. The lowest Emax setting otherwise is a 20amp version so waiting to see if they come out with a firmware update for it.

The reason I soldered in the headers is because I do all my wiring to size and typically one of the early steps is to confirm motor direction. By soldering in the programming headers. I can solder the wires in however I want, then simply go and reverse the motor direction at a later time. It's also handy to set the calibration end points to match my transmitter end points without having to go through all that calibration nonsense.

FYI - one more note about the UNO - you get two programmer firmware/hex options, one that is Multi and one that is PNB. The multi hex is is if you're flashing all 4 escs at the same time. I opted to go for the one at at time hex.
 

jhitesma

Some guy in the desert
Mentor
Photos of my build are in the thread linked in the first post: http://forum.flitetest.com/showthre...ard-test-build&p=129338&viewfull=1#post129338

The schematic I followed is included with blhelisuite in one of the PDF's that ships with it. The PDF is named "How to Build a BLHeli bootloader interface with USB-UART board" and is in the Manuals folder.

I actually just used this adapter again a week or two ago updating some old 20a blue series ESC's on my first quad ;)
 

JonnoSA

New member
BlHeli_S Features in BlHeliSuite

Hi, I have purchased some BlHeli_S ESCs and I am trying to invert the INPUT POLARITY, wich was previously an option back in the original BlHeli firmware. With the new BlHeli_S firmware, this feature seems to have disappeared. Where can I find it (if it is in fact there)? Otherwise, PLEASE can the developers put it in the BlHeli_S version of BlHeliSuite?

Thanks so much,

Jonno
 

PsyBorg

Wake up! Time to fly!
Thanks for the info. I will use this to redo my ESC's on my Vesa this spring when I get that back in the air.. I read thru the thread but did not however come across where you gave the resistor value nor the direction you biased the diode although I have a good idea but for those not versed in electronics it may help.
 

jhitesma

Some guy in the desert
Mentor
Thanks for the info. I will use this to redo my ESC's on my Vesa this spring when I get that back in the air.. I read thru the thread but did not however come across where you gave the resistor value nor the direction you biased the diode although I have a good idea but for those not versed in electronics it may help.

Hey PsyBorg - somehow I missed your post on this back in December...but someone just sent me a PM asking about this flashing setup so I stumbled across it....better late than never I hope.

The actual build was in this thread: http://forum.flitetest.com/showthre...ard-test-build&p=129338&viewfull=1#post129338

The details are in the BLheli docs - I forget exactly which file but one of them includes a schematic for this setup. The resistor is just a 1k based on what I see in the photos and the diode direction can be seen there as well. (I forget which diode it is but I'm pretty sure it's just a common small signal diode, I don't remember it being a zener or anything...but it was 3 years ago when I made it.) You can probably even trace the wires out in that thread...I still refer back to those photos when I dig it out to use and can't remember which way it hooks to the FTDI adapter. And I still use it from time to time as well. Very handy little setup I've gotten tons of use out of!
 

PsyBorg

Wake up! Time to fly!
I gave up on all that FTDI stuff hehe. When I swapped over to the 30 amp esc's on my final build I left em all stock and everything is happy. I recently went back and put the original 6 inch props on it and did a re-tune now that I have half a clue and as I put it in the rework thread I call it mt "Melted butter" quad. all the big boys have their 5 inch rippers and now going back to six inches with lower kv and bigger props so I try to keep up with the cool kids best I can.

Thank you though for coming back after seeing that post and reviving this thread as I am sure someone some where is struggling just as I was.
 

JimCR120

Got Lobstah?
Site Moderator
Though I normally use Safari as a web browser on my Mac, it is my understanding that I need to run Chrome to operate CleanFlight and BetaFlight. Both of these can be downloaded into Chrome as well as BLHeliSuite which I have successfully used.

I dunno what PC guys have to do, usually a butt ton of drivers or something.
 

jhitesma

Some guy in the desert
Mentor
blhelisuite is a standalone windows application.

blheliconfigurator is a chrome app.

The two are VERY different.

blhelisuite is made by the team that makes blheli. It can handle a BUNCH of different connection methods. blheliconfigurator is much simpler and easier to use - but isn't nearly as powerful and only works with subset of the connection methods blhelisuite supports.
 

JimCR120

Got Lobstah?
Site Moderator
Thank you for the correction. I had no idea. Ruth be told, I'm probably still mostly clueless.:confused:
 

bd4rc

New member
Thanks for this! I was able to get this working using an inexpensive adapter from amazon "FLASH HOBBY BL32 USB Linker Brushless ESC Open Source Speed Control Programming". Also I think the best place to download BLHeliSuite is from github: https://github.com/4712/BLHeliSuite/releases . Unfortunately this is Windows only; BLHeliSuite32 is cross platform but does not support BLHeli-S.

  1. Unplug battery from ESC, we need to start with it unpowered.
  2. Plug in BL32 USB adapter. Go to device manger (Windows key, start typing device manager to search and should come up) and make sure under "Ports (COMM & LPT)" there is "USB-SERIAL CH340 (COM4)". Note the comm number, may be different from 4. On windows 11 I did not need to download a driver.
  3. Connect signal and ground pins of BLHeli-S esc you want to configure into the S and GND pins of the BL32 adapter. DO NOT PLUG IN POWER. It might be safe but I did not test it and did not want to risk frying the BL32. I used two Dupont Jumper wires for this, you could also build a 3-wire servo connector with power cable missing for this purpose. (See attached picture).
  4. At the bottom of the BLHeliSuite window where it says "Port:", Choose comm port from step (1), then click "Read Setup" from line above. A window will pop up saying to power the ESC.
  5. Start BLHeliSuite, got to "Select ATMEL / SILABS Interface" menu option, and choose "C SILABS BLHeli Bootloader (USB/Com)"
  6. Now plug a battery in to the ESC to power it. During bootup BLHeli-S looks for a signal to enter setup mode, which it will receive because of the previous steps.
  7. Now you can make changes and "Write Setup". Simply unplug battery and signal/ground wires when done. Make sure to test changes without prop before flying!
It's worth noting that the other way to do this is via Flight Controller (FC) passthrough. All the modern configurators, most notably the web based https://esc-configurator.com/, use this and do not support 1-wire. Unfortunately you need to have a flight controller handy to do this, which is an annoying barrier.

I plan on using this to get reverse thrust on airplane without a separate receiver channel and ESC with a second PWM plug, will report back.
 

Attachments

  • blheli-s-serial-1wire.jpg
    blheli-s-serial-1wire.jpg
    4 MB · Views: 0