How to Programm/flash a new born VESC 4.12 with st link V2?(Widows 10)

Hello,

I’ve brought back to life a vesc that had a bad MCU with it and replaced it using a hot air and soldering iron.

Now I’d like to get it to operation after verifing the st link V2 can read the data in there.

I’d like to ask what are the steps for making it work and where can you get the hex files for flashing the firmware onto it along with how it should be done using windows 10 and the st link programmer.

Thanks.

I could only find some info about it in the VESC web page but it’s just for using ubuntu and the Windows page in unavailable.

Also another question,

Does the Bootloader and firmware have to go in two steps or there is an ability to upload them in a single file?

Well it has a firmware updater there but sins it’s a blank chip I need to flash it with SWD(ST link) and I don’t think it supports it.

3 Likes

yep, the above link, use st utility. I flashed a firmware included in bldc tool, then fired up vesc tool to update to latest.

1 Like

Yeah but when connecting a usb to the VESC(and powering in on with the battery) the computer doesn’t recognize it and the ST link with the SWD does read the chip.

I’m pretty sure your not suppose the have the power on or connected over USB wile flashing

But then the PC software would say it is not connected and not recognized.

Double check your connections and redo the steps. I recently did the on windows 10 as well and it worked perfectly

USB connection is fine and I tried it with other vescs.

are you sure this: http://vedder.se/forums/download/file.php?id=6&sid=a6b085428455d0f9a617d880da259517

is the only file I have to flash with the utility tool to get the device to life?

I’m not sire but after reading your topic again it seems that you will need more than a boot loader, and that is above my pay grade and left to someone with more in depth knowledge of VESC’s, like @JohnnyMeduse

Yeah I also think I just need the actual hex firmware file to upload it with the ST link somehow.

no usb needed the stlink powers it, bootloader did nothing for me, i just wrote the entire firmware to it. Its done the same way. Get the firmware from

C:\Program Files (x86)\BLDC Tool\Drivers\firmwares\hw_410_411_412

Obviously install bldc tool. This is the way i did it last week when my mcu corrupted and usb stopped working.

1 Connect st link to the vesc. 2 Upload the bootloader hex file. 3 Unplug uart and plug in the USB. 4 Start up the vesc tool and upload firmware.

That’s how I did it. It should work fine.

Done that and it kinda work the BLDC tool detect the device and firmware but now when I try to drive a motor with it after configuring it the middle red led flashes at 600ms approx intervals.

after doing the same steps on my other VESC it is able to drive a motor properly(using 6S battery for tests)

Any idea why it does that?

The problem is that the bool loader doesn’t contain the code to enable the MCU USB peripheral to allow the BLDC tool software to detect it.

OK Now when I try to upload the latest firmware with the latest BLDC tool version it sort of lets me do that but ends up not actually working after rebooting no matter how many times I try also tried updating the bootloader but with no luck.

OK after diagnosing it with the terminal here are the logs:

Any ideas?

The following faults were registered since start:

Fault : FAULT_CODE_DRV Current : 0.6 Current filtered : 0.7 Voltage : 23.57 Duty : 0.009 RPM : 0.7 Tacho : 6 Cycles running : 0 TIM duty : 38 TIM val samp : 1050 TIM current samp : 3150 TIM top : 4200 Comm step : 6 Temperature : -10.36

Fault : FAULT_CODE_DRV Current : 0.6 Current filtered : 0.6 Voltage : 23.57 Duty : 0.007 RPM : 0.7 Tacho : 6 Cycles running : 0 TIM duty : 29 TIM val samp : 1050 TIM current samp : 3150 TIM top : 4200 Comm step : 6 Temperature : -10.33

Fault : FAULT_CODE_DRV Current : -8.6 Current filtered : -8.4 Voltage : 23.57 Duty : 0.450 RPM : 0.7 Tacho : 6 Cycles running : 0 TIM duty : 1889 TIM val samp : 1050 TIM current samp : 3150 TIM top : 4200 Comm step : 6 Temperature : -12.49

Fault : FAULT_CODE_DRV Current : -6.9 Current filtered : -6.6 Voltage : 23.57 Duty : 0.357 RPM : 0.7 Tacho : 6 Cycles running : 0 TIM duty : 1500 TIM val samp : 1050 TIM current samp : 3150 TIM top : 4200 Comm step : 6 Temperature : -12.46

Fault : FAULT_CODE_DRV Current : -9.8 Current filtered : -9.9 Voltage : 23.59 Duty : 0.440 RPM : 0.7 Tacho : 6 Cycles running : 0 TIM duty : 1848 TIM val samp : 1050 TIM current samp : 3150 TIM top : 4200 Comm step : 6 Temperature : -12.46

Fault : FAULT_CODE_DRV Current : 0.6 Current filtered : 0.5 Voltage : 23.57 Duty : 0.007 RPM : 0.7 Tacho : 6 Cycles running : 0 TIM duty : 31 TIM val samp : 1050 TIM current samp : 3150 TIM top : 4200 Comm step : 6 Temperature : -11.71

Fault : FAULT_CODE_DRV Current : -13.5 Current filtered : -13.3 Voltage : 23.57 Duty : 0.662 RPM : 0.7 Tacho : 6 Cycles running : 0 TIM duty : 2781 TIM val samp : 1050 TIM current samp : 3150 TIM top : 4200 Comm step : 6 Temperature : -11.78

Fault : FAULT_CODE_DRV Current : -11.8 Current filtered : -11.8 Voltage : 23.57 Duty : 0.674 RPM : 0.6 Tacho : 6 Cycles running : 0 TIM duty : 2830 TIM val samp : 1050 TIM current samp : 3150 TIM top : 4200 Comm step : 6 Temperature : -11.85

Fault : FAULT_CODE_DRV Current : -13.9 Current filtered : -13.8 Voltage : 23.60 Duty : 0.734 RPM : 0.6 Tacho : 6 Cycles running : 0 TIM duty : 3082 TIM val samp : 1050 TIM current samp : 3150 TIM top : 4200 Comm step : 6 Temperature : -11.47

Fault : FAULT_CODE_DRV Current : -13.1 Current filtered : -12.8 Voltage : 23.57 Duty : 0.715 RPM : 0.5 Tacho : 6 Cycles running : 0 TIM duty : 3002 TIM val samp : 1050 TIM current samp : 3150 TIM top : 4200 Comm step : 6 Temperature : -9.16

Fault : FAULT_CODE_DRV Current : -13.8 Current filtered : -13.9 Voltage : 23.59 Duty : 0.744 RPM : 0.4 Tacho : 6 Cycles running : 0 TIM duty : 3125 TIM val samp : 1050 TIM current samp : 3150 TIM top : 4200 Comm step : 6 Temperature : -12.17

Fault : FAULT_CODE_DRV Current : -10.2 Current filtered : -10.0 Voltage : 23.57 Duty : 0.606 RPM : 0.4 Tacho : 6 Cycles running : 0 TIM duty : 2546 TIM val samp : 1050 TIM current samp : 3150 TIM top : 4200 Comm step : 6 Temperature : -12.21

Fault : FAULT_CODE_DRV Current : 1.7 Current filtered : 1.7 Voltage : 23.57 Duty : 0.011 RPM : 0.4 Tacho : 6 Cycles running : 0 TIM duty : 46 TIM val samp : 1050 TIM current samp : 3150 TIM top : 4200 Comm step : 6 Temperature : -12.28

Fault : FAULT_CODE_DRV Current : -14.6 Current filtered : -14.3 Voltage : 23.56 Duty : 0.925 RPM : 0.4 Tacho : 6 Cycles running : 0 TIM duty : 3883 TIM val samp : 1050 TIM current samp : 3150 TIM top : 4200 Comm step : 6 Temperature : -11.85

Fault : FAULT_CODE_DRV Current : -1.6 Current filtered : -1.7 Voltage : 23.56 Duty : 0.650 RPM : 0.3 Tacho : 6 Cycles running : 0 TIM duty : 2730 TIM val samp : 1050 TIM current samp : 3150 TIM top : 4200 Comm step : 6 Temperature : -11.33

Fault : FAULT_CODE_DRV Current : -15.4 Current filtered : -15.2 Voltage : 23.56 Duty : 0.950 RPM : 0.2 Tacho : 6 Cycles running : 0 TIM duty : 3990 TIM val samp : 1050 TIM current samp : 3150 TIM top : 4200 Comm step : 6 Temperature : -11.33

What version of bldc tool are you using? Try using the vesc tool with ackmaniac’s firmware.

Don’t know how to tell but I’ve tried both versions the old one and the newest 0.91 one but here are the logs does that DRV data makes any sens?