VESC - Installing a bootloader

@elkick now I’m wondering if I made a mistake when I took this photo, I believe that error message shot above came after trying to run this command:

mkdir BLDC cd BLDC git clone bldc-bootloader cd bldc-bootloader make upload

There are some reports here, specifically this one, that make me wonder whether I have a hardware defect that is preventing the bootloader from being loaded, which might explain why it wasn’t successful at the factory that @onloop used:

“I’ve tried it with and without the USB cable connected. I suspect the “unable to connect” indicates a hardware error, presumably in my soldering, unless anyone has other ideas.”

This error message is the same if the bootloader is not present or not correctly installed. You might just go through the bootloader part again to check. If that works, the FW part will work as well.

1 Like

Thanks @elkick I’ll try again tonight. Will report back!

@chaka very good point! I had the same thought as I placed it there but was too focused on the install! I’ll try power cycling the programmer tonight if I don’t get a successful install. Does it look like I specified the HW version correctly in conf_general.h ?

And please take some screenshots if there are errors in the bootloader part, we might be able to find the root cause. Also, between bootloader upload and FW upload the STlink needs to be pulled off and inserted again as Chaka mentioned.

@elkick Ah! I did not do that! I didn’t power cycle the programmer between steps. Thanks!

Looks like you are connected incorrectly. I don’t have time to go over your photos very closely right now but I’ll take another look these evening when I take a break.

@treenutter Ahh well it will just take second. you deffinitly have the pin order wrong. We will keep your wire order on the VESC and just switch the connectors on you programmer.

Move the black wire to VDD, move the red wire to CLK, move the orange wie to GND, the yellow wire to SWD, the mustard green wire to RST and the green is most likely DATA.

I hope this works for you.

1 Like

Thanks @chaka ; I’m also wondering a bit about the integrity of the connections I’ve made using the jumper cables with the tips lopped off… although that usually works.

Those connections should be fine if you can feel some resistance when plugging them in.

Did you get a chance to run the programmer again with the connectors moved?

@chaka I did and it worked! Boot loader and updated firmware installed! I’ll post pics and a summary tomorrow. Thanks so much for taking a close look at my programmer! I tested FOC in my living room tonight. It’s so good!

@treenutter I would really appreciate a brief recap and maybe a schematic. Thanks to @Jack I’ll be building a couple VESC’s myself soon and uploading the bootloader will be part of the process.

@trbt555 you just need to prepare de proper hardware and follow vedder’s steps

You can get the discovery board, include it in your digikey or mouser BOM

The connection to the vesc are straight

Jst ph 6 pin mate

@trbt555 I think that @Blasto is right; it’s all pretty straightforward unless you have a weird STLINK like I did that has an unusual naming convention for the pins… then you need an expert like @chaka to save the day and translate the pin titles for you! Thanks again @chaka and @elkick!

Here are some pics of the successful process, starting with the connection from the STLINK to the VESC (this time using a pad to reduce the risk of shorts):

Run all of vender’s command lines and you’ll get these two screens when you finally upload the firmware and the bootloader.

Firmware Success!:

Bootloader Success!:

Here’s the VESC with it’s LEDs blinking during\after the programming:

And finally, screens from the Linux version of BLDC Tool:

FTW, the FOC config screen!

A quick review of FOC: Holy crap I love it! I could only test it in the living room, but it is dead silent and starts without any stutter using an unsensored motor! It’s a vast improvement over the previous motor control process, at least at slow speeds and startup. Configuration of it was easier than I thought it would be… I just clicked the buttons, let the motor do it’s thing, and then applied the settings to save them. I can’t wait to get it out on the road!

The discovery board was too expensive for me! This ST-Link V2 works perfectly.

HOLY CRAP !!! All this VESC installation is freaking me out !!,… . special wire connecting , …downloading,… programming !

I have nt recieved it yet,…but i suck with computers and im wondering if i will ever get that VESC to work ???

haha this is all “extra” stuff; I wouldn’t worry about any of it.

All you need is the BLDC tool: it can be on mac or windows, and is just an application used to set up the VESC. Plug a USB cable into your VESC, open the application, and you are halfway there!

If you want to check out more info, I suggest the VESC faq section. It may seem daunting at first, but realize that if you just want to set up your VESC and then leave it alone, only a couple threads will even be helpful- a lot of them are for more complicated things that you won’t need to worry about.

Trust me: I held out on the VESC for so long because I thought it was too complicated… once I finally bought one, it took me less than an hour to download the application, set up the VESC, and get my board up and running.

When in doubt, just ask!

1 Like

@Randyc1 pls note that this thread was written about a problem that very few people have. Any VESC you buy now will have a bootloader installed already and you don’t need to do anything described here.


Allright Guys , …thanks for reassuring me !

I’ve had a problem just getting my bldc tool to read my firmware on windows, having Linux or Ubuntu installed tomorrow when I get free time. Haven’t really seen my issues, blue light when plugged in then three red lights flash only once on power up then goes to green light and my bldc tool never picks up firmware

Okay, because I bought an alien VESC without releasing that is has no bootloader, so I need to install it. Warning! I’m a bit of a newb but I think I understand, can I use this St-Link V2? And so I would connect them in this order right?

And then I should download st-link utility from here, then I need to get the bootloader Hex file from here. Could someone please tell me if I have all the necessary things?