Fail to flash Odrive

Hi,

I’ve just received an Odrive board and I’m eager to try it out. I supplied 48V to the board, connected the board to my PC through a USB cable, ran the odrivetool but it seems to me that Windows cannot detect the board. The board I’m using is v3.5.

I tried googling for solution, until I came across this post:
https://discourse.odriverobotics.com/t/odrive-3-5-not-recognized-by-windows/785/7

I followed what the guy from the post did, and all was fine until I faced an error that he never faced before. While trying to flash the firmware to the board, the odrivetool gave an exception during the flashing process:

(C:\ProgramData\Anaconda3) C:\Users>odrivetool dfu C:\Users\dsyiauw\Downloads\OD
riveFirmware_v3.5-48V.hex
ODrive control utility v0.4.1
Waiting for ODrive...
  DFU mode is not supported on board version 3.4 or earlier.
  This is because entering DFU mode on such a device would
  break the brake resistor FETs under some circumstances.
Warning: DFU mode is not supported on ODrives earlier than v3.5 unless you perfo
rm a hardware mod.
Do you still want to continue? [y/N] y
Found ODrive 365733593037 ([unknown version]) with firmware [unknown version] in
 DFU mode

You are about to flash firmware [unknown version] which is the same version as t
he firmware on the device ([unknown version]).
Do you want to flash this firmware anyway? [y/N] y
The configuration cannot be backed up because the device is already in DFU mode.
 The configuration may be lost after updating. Do you want to continue anyway? [
Y/n] y
Erasing... done
Flashing... (sector 0/6)
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
C:\ProgramData\Anaconda3\Scripts\odrivetool in <module>()
    140         print_version()
    141         import odrive.dfu
--> 142         odrive.dfu.launch_dfu(args, logger, app_shutdown_token)
    143
    144     elif args.command == 'liveplotter':

c:\programdata\anaconda3\lib\site-packages\odrive\dfu.py in launch_dfu(args, log
ger, cancellation_token)
    448     firmware = FirmwareFromFile(args.file) if args.file else None
    449
--> 450     update_device(device, firmware, logger, cancellation_token)
    451
    452

c:\programdata\anaconda3\lib\site-packages\odrive\dfu.py in update_device(device
, firmware, logger, cancellation_token)
    379         for i, (sector, data) in enumerate(touched_sectors):
    380             print("Flashing... (sector {}/{})  \r".format(i, len(touched
_sectors)), end='', flush=True)
--> 381             dfudev.write_sector(sector, data)
    382         print('Flashing... done            \r', end='', flush=True)
    383     finally:

c:\programdata\anaconda3\lib\site-packages\odrive\dfuse\DfuDevice.py in write_se
ctor(self, sector, data)
    185             status = self.wait_while_state(DfuState.DFU_DOWNLOAD_BUSY)
    186             if status[1] != DfuState.DFU_DOWNLOAD_IDLE:
--> 187                 raise RuntimeError("An error occured. Device Status: {!r
}".format(status))
    188
    189     def read_sector(self, sector):

RuntimeError: An error occured. Device Status: (0, 2, 0, 0)

Can anyone please advise on what I can do to flash the firmware successfully?

Yes multiple people have also had the same issue as you, the RuntimeError: An error occured. Device Status: (0, 2, 0, 0). It is logged by a comment further down in the github issue relating to the post you also reference:

So basically there are to observed failures of DFU, the “laingid” failure, and the “(0, 2, 0, 0)”… I will try to tackle both of these.

Meanwhile if you like I can send you an ST-Link (free of charge) and you can use that to flash your board (this method has never not-worked for anyone).

Hi there,

Thanks for the reply, and sorry for the late update. I’ve successfully flashed my board, the trick was to wire 3.3V to the MDU VCC pin on the ST-Link V2 programmer.

We found a different tool that can flash the ODrive in DFU mode. It’s not as sleek and automated as the dfu command in odrivetool, but hopefully it can help if you are getting errors.

Instructions here