Tips for the VESC FW update and SWD program mode

From Spintend service and support
Revision as of 11:05, 17 February 2022 by John (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

In VESC, the FW(firmware) usually referred is APP FW, the FW of bootloader is not much discussed.

APP FW is do the main job of loading the new FW, not its bootloader. APP FW loads bootloader, APP FW buffers the new APP FW, the bootloader is only do a copy job.

FW is usually in binary format with '.bin' file name extension, in this article we call it bin file.

Why my FW still keeps old version after update?

This often happens when the bootloader is lost or not installed.

Settlement: In the VESC tool PC edition, go to

Bootloader update.png


Choose the bootloader file suit for you ESC.

Click update

FW download button.jpg


Then go to firmware page to try to update firmware again.

Update firmware page.jpg


Why my VESC bricked?

Click update firmware to the ESC in VESC tool and watching the progress bar to finish, is just first step, it is just saves the new FW in to its buffer zone, the ESC will then starts to erase old FW, copies new one from buffer to the FW zone.

If this copy process been ceased or interrupted, the FW zone will be incomplete or corrupted. And in VESC, it is FW to undertakes initialization and load FW task, not the bootloader, so FW corrupt will cause ESC 'bricked'.

That's why the VESC tool promotes ‘wait at least 10 seconds for finish the update’ message after update FW in to ESC.

When bricked, we need to re-program ESC through MCU's SWD interface. SWD is mean for Serial Wire Debug

SWD mode for Ubox dual

We have a blog here: https://spintend.com/blogs/news/6-steps-to-flash-bricked-vesc-without-programmer-in-easy-way

SWD mode for Ubox single 75V

The SWD pads of ubox single 75V.jpg

Limited by its size, Ubox single 75V does not place the SWD port on the case.

When bricked, may be you have a Ubox dual in hand to rescue him.

Ubox single and Ubox dual SWD pins
Ubox single 75V Ubox dual
3V3 VCC
SWC SWDCLK
GND GND
SWD SWDIO
NRST NRST

Ubox single doesn't have a socket, so we need to solder SWD, GND, SWC, 3V3 with a cable, connect cable to another Ubox or a third party VESC, then try VESC tool's SWD programmer.

Why not to connect NRST?

Usually, the NRST is no use, because VESC have no pin for controlling NRST, and SWD port can works without external reset pin.

But in some time, SWD can not reset chip with SWDIO and SWDCLK only, in this time, we can try to reset chip manually, by short this NRST pin to ground then release it during we do SWD connect in VESC tool, try this several times, maybe miracle will happen.

Keep a stable connection during SWD programming, otherwise the VESC may 'bricked'.

What's special in merged bin file?

In SWD mode, either by ST-LINK or J-link or VESC TOOL, we have often seen that they are using the 'merged' bin file, we are also provided this merged bin file. The merged file is merged the APP and the bootloader , is a one time solution.

What if I just SWD-ed the APP only bin file into the VESC?

It still can working, but cannot update to another firmware by VESC tool update mode, because it is loss the bootloader. Please refer chapter 1 of this article: Why my FW still keeps old version after update?

See also

Main Page