VESC Boot Loader Installation Tutorial

This thread is simply a straight forward tutorial on how to install the boot loader onto a VESC. I’m using a Maytech VESC for this, but it should work for any VESC that does not have a boot loader installed. All sources and credits are at the end of this thread.

Step 1:

Purchase a ST-Link V2 Like THIS one. They only cost about $5. Your also going to want to buy a 6-pin JST-PH 2mm male header for connecting to the VESC like THIS one. You may also need some female to female jumper cables like THESE.

Step 2:

Once all the parts from step 1 have arrived connect the JST and ST-Link together like in the image below. Green JST wire to 3.3v, Orange to SWCLK, Yellow to GND, White to SWDIO, and Red to RST the black wire can just be trimmed off or left alone.

Step 3:

Now that you’ve connected the ST Link and JST plug it into your VESC port like in the pic below. Then plug the ST Link into a USB port in your computer running Windows. I used Windows 7 though it works with 8 and probably Win 10 as well. Also during this entire process of installing the boot loader the VESC does NOT need to be externally powered.

Step 4:

Next download the STM32 ST-LINK utility from HERE. After you download that run and install the .exe to install the drivers and ST Link Utility itself. Next open the ST-Link Utility, there should be a desktop icon, and click Target Connect. at this point a a large list of address should show up and that means you’ve connected properly.

Step 5:

Download the VESC bootloader from **THIS link. Unzip it and there should be a file inside called “BLDC_4_Bootloader” thats the file we need. Next go back to ST Link and click Open File from the top left button. Navigate to the BLDC_4_Bootloader.hex file and click open. Next click Program Verify, the button just below Target then click Start, this may take a few seconds or a few minutes so just give it some time. Once its done verifying you can close the ST Link Utility and you’ve successfully installed the boot loader! Now just unplug the ST Link power the VESC and upload your firmware as usual!

Thanks to the people on THIS thread as its how I figured out how to do this. Big thanks to Esk8 Support, or Jacob and his video HERE because this thread is pretty much just a transcription of that lol.

**Thanks @TarzanHBK for the link to the .hex file as I could not have found it otherwise!

24 Likes

Thanks for the write up. Will this boatloader work on FVT/@Torqueboards 12s car esc’s too?

@Mobutusan No, this is only for VESC.

3 Likes

Hi, thanks you for this JdogAwesome :blush: There are some posts like this aournd here, but nothing specialy dedicated to the FocBox Boot Loader. I just find this here :

http://esk8content.nyc3.digitaloceanspaces.com/uploads/db2454/optimized/3X/8/a/8a2ef07201f43a21888614f462db954da875dc62_1_375x500.JPG

So I can try on my fox with all your files safetly ?

Thanks a lot for your help :v:

Yeah @Riako the FOCBOX is based off of the VESC 4.12 hardware, that’s why it uses the same software so yeah using those pin headers should work fine.

1 Like

Perfect @JdogAwesome :wink: :+1: I asked because like I see a different wiring diagram propose for Fox in the other topic.

Now it wont pass the motor detection haha but I will end up getting there I hope. I just feel like I’m totaly new in all this stuff with fox with vesctool… :sweat_smile: I haven’t got any problem with ever when programming my vescs 4.xx with BLDCTool or VESC 6 with vescTool by the past. But here it looks like I got trouble with fox + vesc6 on same VESCTOOL … don’t really know.

Hey guys, https://m.popkey.co/2c28b1/mM7y5_f-thumbnail-100-0.jpg So I really need your help,… I got some issue using a same vesc tool with vesc 6 or Fox I guess (I have to try with vesc 4.10 but I’m affraid its the same). Here is the thing : All was all good using bldc tool with ack version 2.54 under bldc mode etc standard. Then I try with fox, same all good too. Now I need a lastest version of the official vesctool so I use one that I get with my V6, fw3.31 but there was any HW choice just the 60 once. 1st I try to force it by the custom files … but I think I crap asking a bootloader missing thing… I bootload it by stlink, so now got vesctool 0.87 > fw3.34 > and here, no choice at all ?.. ok … well its well connected, good version FW, HW and supported FW … Start the wizard and there motor detection failed itch time !! Haaaa, that never happen to me before !!! ever !

I try immediatly with an other fox of a single cruiser, all good, no pb I could reprogram it all.

What is the thing with this other fox ? I try to increse D abit 0.01 by 0.01 but arrived to 0.07 and no result (I dont know much about that … how high I could go, the help say to not go to high.) cause my motor make an unreal noize at the end :hushed: never see/hear that before !! Totaly freaky … I try a new motor sensored lower kv … same

Here are some screenshot :

Config : (APS HEV 6374 170kv - old setup, but same issu) and 6374 130kv sensored (vesc 4.10 - old setup), then Fox (cause BlackFriday…) Lipo graphene 12s 8Ah ADC control …

Thanks to all of you for any help guys :blush: I may miss some info, don’t hesitate please …

Reflash the original 2.XX firmware (using STLink), then open vesc tool and and install the bootloader when it asks and then upgrade without the custom files option.

1 Like

thanks for your help Jamy ! So I re-reflash again, cause I already just made with the last files from benjamin. It upgrade the fox to 3.34. And don’t ask anymore about bootloard or other message for newer version etc. it’s already working. But now with this one I don’t pass the motor detection … who is working before. And I also try with an other fox and it work fine. So like you say, how to reflash to the original fw2.18 from enertion/focbox ? I can dl the .hex file for this ?

Hey @Jamy, where can i get the original Firmware?

I have the 4.8 FW on my focbox now and flashing the 4 from the tutorial didnt work out.

Thanks!

Install vesc_default.bin @driver

1 Like

Thanks alot @Jamy :grin: I will try it tomorrow!

hi, there , can i recovery a bricked vesc with this method because i have flash wrong hardware firmware on my 4.10 vesc

anyone has link for HW60?

Ok i Have fixed the 2 Escapes by clearing the chip using the St Link tools… then loading generic bootloader and then using Vesc Tool to upload their bootloader and their firmware then able to go across platform to Ackmaniac and back to Vesc which before I was not. My issues was that the Escape had 3.38 version on and it would not upload new firmware… Once I used St-Link utility it would upload latest firmware but I couldn’t update firmware using Vesc Tool nor Ackmaniac Esc Tool… only through ST-Link which was later fixed by clearing the data on the chip using the ST-LINK… use at your own discretion

1 Like

some of the files I compiled into folder

https://drive.google.com/drive/folders/1Yc7IKCECU4cz1LAiPgP-TPwnNLJXqwRI?fbclid=IwAR1shmuhBdCf6WmePWYsjzLJU4Po7ozFLCN3q2AZQq8LM-kmWzDq9_jjl28

1 Like

If your VESC based ESC has no boot loader installed, you don’t need a ST-Link to ad the bootloader. There is a bootloader tab in VESC-Tool (under firmware). Simply upload the missing bootloader via USB. A ST-Link is only needed when things got messed up.

2 Likes

The link provided for the BLDC_4_Bootloader.hex file was not working and it took me a bit to find one that worked. I found the hex file on this website you can visit the website to get the zip or I will link it here. I used the file “BLDC_4_BL_AND_MAIN_MERGED.hex” and it work on my vesc 4.12.

4 Likes

Thanks @Matt_54 I would update the link in the original post, but it’s been to long so I can’t change it anymore.

Guys, need help here. I tried this and ended up frying 2 stm32s. I am using an stlink V2 programmer from ebay. I connected as shown, 3.3, CLK, DIO, RST, GND, and all worked fine. The programmer connected to the stm32, and I could see all the memory allocations. So far so good.

After a few seconds, the connection was terminated. So i reconnected, and thats when I saw it…the magic smoke, it escaped the stm32. I have heard that connecting the 3.3V could be problematic for VESC6 but I have a 4.12 so it should be fine?

Im really lost at what could be wrong here. Why would the programmer connect then disconnect. Sounds like a short circuit, but I checked all my connections and they look fine (no bridges).

Any leads? (pun intended).