ODrive not being recognized by Windows

Hey all, how are you doing! I’m new to the ODrive community, and I seem to have run into a weird error.

It was all working great, and easily configured through the command prompt (I’m running Windows 10 btw). However, after running “odrivetool dfu”, I can no longer connect to the board through Windows. Any thoughts? If there is a hard reset for the board hat doesn’t require a USB connection, I would not turn that down. I know I was in run mode (per the switches on the ODrive) when I ran “odrivetool dfu”, so I don’t know if that causes any issues.

Looking forward to hearing from you all!


C:\Users\myano>odrivetool dfu
ODrive control utility v0.5.1.post0
Waiting for ODrive…

AttributeError Traceback (most recent call last)
~\AppData\Local\Programs\Python\Python39\Scripts\odrivetool in
141 print_version()
142 import odrive.dfu
→ 143 odrive.dfu.launch_dfu(args, logger, app_shutdown_token)
145 elif args.command == ‘liveplotter’:

c:\users\myano\appdata\local\programs\python\python39\lib\site-packages\odrive\dfu.py in launch_dfu(args, logger, cancellation_token)
463 firmware = FirmwareFromFile(args.file) if args.file else None
→ 465 update_device(device, firmware, logger, cancellation_token)

c:\users\myano\appdata\local\programs\python\python39\lib\site-packages\odrive\dfu.py in update_device(device, firmware, logger, cancellation_token)
274 # Read hardware version from one-time-programmable memory
275 otp_sector = [s for s in dfudev.sectors if s[‘name’] == ‘OTP Memory’ and s[‘addr’] == 0x1fff7800][0]
→ 276 otp_data = dfudev.read_sector(otp_sector)
277 if otp_data[0] == 0:
278 otp_data = otp_data[16:]

c:\users\myano\appdata\local\programs\python\python39\lib\site-packages\odrive\dfuse\DfuDevice.py in read_sector(self, sector)
209 self.set_address_safe(sector[‘addr’])
→ 211 transfer_size = fractions.gcd(sector[‘len’], MAX_TRANSFER_SIZE)
212 #blocknum_offset = int((sector[‘addr’] - sector[‘baseaddr’]) / transfer_size)

AttributeError: module ‘fractions’ has no attribute ‘gcd’

Odrive randomly connected. I tried flashing firware again, and was greeted with this. ZaDig is now only showing the Odrive as “STM32 Bootloader”, but even following the normal driver setup steps seems to cause no positive change. I’m certain this is an easy fix, but I would love some direction!

DFU flashing does seem to fail often, but I’ve never seen that error before - that looks like a regression in Python 3.9. It may work with Python 3.8 instead, but I’d recommend one of the alternative flashing methods listed here: ODrive Tool | ODrive

I prefer the method that uses STM32CubeProgrammer. Download the latest firmware hex file from here and choose the one that matches your board: Release fw-v0.5.1 · odriverobotics/ODrive · GitHub

Re-flashing by downloading the HEX did the trick! Thanks for the help ladies and gents! It looks like “odrivetool dfu” was the culprit