Method 1: SWD debugger
Requires STLink or compatible JTAG/SWD probe. Needed for first-time flashing and recovering a bricked device.
Method 2: VESC Tool USB
Upload a
.bin file through the VESC Tool application. No extra hardware required once a bootloader is present.Method 1: SWD debugger
This method uses OpenOCD and a SWD/JTAG probe (such as an STLink v2) to write firmware directly to the device.1
Flash the bootloader
Before flashing application firmware for the first time, you must flash the bootloader. Clone and build the bldc-bootloader project and follow its instructions.
2
Build your target firmware
Build the firmware for your board:
3
Flash the firmware
Use the This invokes OpenOCD to write the compiled
_flash make target for your board. For the VESC 100/250:.elf to the device over SWD.On Linux, you can use the STLink v2 programmer without root access by installing the udev rules. See Prerequisites for the commands.
Method 2: VESC Tool USB upload
This method uploads a compiled.bin file through the VESC Tool application over USB. A working bootloader must already be present on the device.
1
Build the firmware
Build the The output file is located at
.bin file for your board:build/100_250/100_250.bin.2
Connect to the VESC in VESC Tool
Open VESC Tool and connect to your VESC over USB.
3
Navigate to the Firmware tab
Select the Firmware tab from the left side menu.
4
Select your firmware file
Click the Custom file tab, then click the folder icon to browse for and select your
.bin file (e.g. build/100_250/100_250.bin).5
Start the upload
Press the upload firmware button (downward arrow) in the bottom right to begin the upload.It is normal for VESC Tool to show a disconnect during the upload process.
6
Wait for completion
Wait for the loading bar to complete, then wait an additional 10 seconds before disconnecting anything.
7
Reconnect
The VESC will disconnect itself once the new firmware is running. You can then reconnect in VESC Tool.
If your VESC is bricked
A bricked VESC cannot accept USB firmware uploads because the bootloader is no longer functional. To recover:- Use a SWD debugger (Method 1 above) to re-flash valid firmware directly.
- You must flash the bootloader first, then the application firmware.
A SWD debugger is the only way to recover a bricked VESC. Keep one available if you are frequently updating firmware.
