Unable to flash firmware and ODrive not recognized by Windows in RUN mode

Recently I tried to flash the firmware on my ODrive although I have not had any luck doing so. I have tried running odrivetool dfu flipping the DIP switch from RUN to DFU as well as connecting the GPOI6 to GND, the STM32CubeProgrammer method, as well as the DfuSe app method. Currently when the DIP switch is on RUN mode the Odrive is not recognized (using a windows computer) but when it is flipped to DFU it is able to connect. Not sure what to do about this, if anyone has any suggestions on how to fix this it would be very much appreciated.

Does the ODrive show up at all in Zadig?

When the ODrive is in RUN mode nothing shows up, when it is in DFU mode with the switch flipped there is a device that shows up with the name “STM32 BOOTLOADER”

Excellent. You can flash it in that mode with odrivetool dfu

I have tried that previously although I continue to get the same error:

(base) C:\Users\vaish>odrivetool dfu
ODrive control utility v0.5.4
DFU is unreliable on Windows. If it fails, please use the DFU switch to force DFU mode. You can also try the developer preview of odrivetool with `python -m pip install odrive --upgrade --pre`.
Also see https://docs.odriverobotics.com/odrivetool#upgrading-firmware-with-a-different-dfu-tool for other options.
Waiting for ODrive...
IndexError                                Traceback (most recent call last)
~\anaconda3\Scripts\odrivetool in <module>
    147                         "Also see https://docs.odriverobotics.com/odrivetool#upgrading-firmware-with-a-different-dfu-tool for other options.")
    148         import odrive.dfu
--> 149         odrive.dfu.launch_dfu(args, logger, app_shutdown_token)
    151     elif args.command == 'unlock':

~\anaconda3\lib\site-packages\odrive\dfu.py in launch_dfu(args, logger, cancellation_token)
    510     firmware = FirmwareFromFile(args.file) if args.file else None
--> 512     update_device(device, firmware, logger, cancellation_token)

~\anaconda3\lib\site-packages\odrive\dfu.py in update_device(device, firmware, logger, cancellation_token)
    307             logger.debug("OTP:")
    308             dump_otp(dfudev)
--> 309         hw_version = get_hw_version_in_dfu_mode(dfudev) or (0, 0, 0)
    311     else:

~\anaconda3\lib\site-packages\odrive\dfu.py in get_hw_version_in_dfu_mode(dfudev)
    267     if otp_data[0] == 0:
    268         otp_data = otp_data[16:]
--> 269     if otp_data[0] == 0xfe:
    270         return (otp_data[3], otp_data[4], otp_data[5])
    271     else:

IndexError: array index out of range

That’s an old bug. I don’t even remember what the problem was anymore…

If you do pip install --upgrade odrive does it update?

Same issues here. I am unable to solve the same problem with my O Drive. When I bought it directly from O Drive site (O Drive v3.6 56V), tried to make an sensor feedback drive of BLDC 100kv motor (100kV with encoder feedback).
Installed libusb-win32 driver successfully with Zadig-2.5.exe app. I did programed the board to behave as it should.
Now I tried something different, to implement in sensor-less mode to run as fix velocity with enable signal via step-dir control from arduino… pretty straight forward yes. But then I realized that the firmware was 0.5.1 (reading thru forums, docs and community I understand that should have newest 0.5.4 firmware flashed on the board to be able to have this line in the tree: odrv0.axis0.config.enable_sensorless_mode = True (e.g. activate sensorless mode :slight_smile: )
Trying to instal new firmware encountered the same problems as vvanamala
now I can see the board in USB only while switch is in DFU but not in RUN. Noticed that the upgrade via Anaconda > odrivetool dfu first remove the old firmware from the board (successfully) and then tried to write the new on to the board (logically), but there was an error and the drive I suppose now hasn’t any firmware on it. How can now install the newest 0.5.4 Firmware now on the board? Can anybody help?
note. I am using just windows 10 64bit OS and good working cable, zadig app and also tried DfuSeDemo app > in which from the start before the problem I wasn’t able to see nothing in the dropdown manu named as Available DFU devices not in the Switch Run mode, DFU mode or GND to gpio6 forced DFU mode with switch set at DFU.

There’s a few ways to do it. STM32CubeProgrammer is a good choice, or use an STLinkV2, or simply using a Linux computer instead. See odrivetool — ODrive Documentation 0.0 documentation

I have been having the same issue with the ODrive not being recognized when the DIP switch is in RUN but when it is flipped to DFU is able to connect. Is there a way to get the ODrive running again?

I’ve had the same errors as vvanamala, the index array out or range.
This was after doing “pip install --update odrive” and seeing Odrive contol utility v0.5.4

It looks like we are still seeing issue#568. Using Windows

I did pip install odrive==0.5.2 and got a different error: Device Status: (0,2,0,0), but the firmware was changed at least.
Then I used STM32CubeProgrammer to update the firmware.

Yes it does, it shows me that the requirement is already satisfied!

I would try using either the STM32CubeProgrammer or buying an STLinkV2, odrivetool dfu still has some issues on Windows. You can find the full instructions here.

1 Like