The controller is not flashing!

I use Odrive v3.5-48V.
I compile into firmware in Visual Studio Code successfully!
When you press -> Tasks -> Run Task -> flash

Executing task in folder Firmware: make flash <

openocd -f interface/stlink-v2.cfg -f target/stm32f4x.cfg -c init
-c ‘reset halt’
-c ‘flash write_image erase build/ODriveFirmware.elf’
-c ‘reset run’
-c exit
Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read
Info : auto-selecting first available session transport “hla_swd”. To override use 'transport select '.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 2000 kHz
adapter_nsrst_delay: 100
none separate
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : clock speed 1800 kHz
Error: open failed
in procedure ‘init’
in procedure ‘ocd_bouncer’

Makefile:17: recipe for target ‘flash’ failed
make: *** [flash] Error 1
The terminal process command ‘/bin/bash -c ‘make flash’’ failed to launch (exit code: 2)

If use DFU

sudo dfu-util -a 0 -s 0x08000000 -D build/ODriveFirmware.bin
[sudo] password for innopolis:
dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to

dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
Opening DFU capable USB device…
ID 0483:df11
Run-time device DFU version 011a
Claiming USB DFU Interface…
Setting Alternate Setting #0
Determining device status: state = dfuERROR, status = 10
dfuERROR, clearing status
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 2048
DfuSe interface name: "Internal Flash "
Downloading to address = 0x08000000, size = 161444
Download [=========================] 100% 161444 bytes
Download done.
File downloaded successfully

  1. Find a Linux machine with internet

  2. Install dfu-util:
    sudo apt install dfu-util

  3. Install arm-none-eabi for converting .elf to .bin:
    sudo apt install binutils-arm-none-eabi

  4. Download firmware file (.elf):

  5. Convert .elf to .bin:
    arm-none-eabi-objcopy -O binary input.elf output.bin

  6. Flash using dfu:
    sudo dfu-util -a 0 -s 0x08000000 -D output.bin

(You can use dfu-util -h to see dfu-util’s help document for more advance setting)

by CY^2

1 Like