Difficulty upgrading firmware


I’ve just starting using a new 56V odrive (my second). I started by upgrading my odrivetool to the latest version. odrivetool wouldn’t connect until I used zadig to change odrive interface 0 and interface 2 to libusb ( (I had the same problem with my first odrive). After this I could connect in odrivetool. Then tried ‘odrivetool dfu’ to upgrade it to the latest firmware, and I get the following error:

(base) C:\Users\Luke Steele>odrivetool dfu
ODrive control utility v0.5.3
Waiting for ODrive...
Found ODrive 2069346C5748 (v3.6-56V) with firmware v0.5.1
Checking online for newest firmware... found v0.5.3
Downloading firmware v0.5.3...
Putting device 2069346C5748 into DFU mode...
IndexError                                Traceback (most recent call last)
C:\ProgramData\Anaconda3\Scripts\odrivetool in <module>
    141         print_version()
    142         import odrive.dfu
--> 143         odrive.dfu.launch_dfu(args, logger, app_shutdown_token)
    145     elif args.command == 'unlock':

C:\ProgramData\Anaconda3\lib\site-packages\odrive\dfu.py in launch_dfu(args, logger, cancellation_token)
    507     firmware = FirmwareFromFile(args.file) if args.file else None
--> 509     update_device(device, firmware, logger, cancellation_token)

C:\ProgramData\Anaconda3\lib\site-packages\odrive\dfu.py in update_device(device, firmware, logger, cancellation_token)
    390         dfudev = DfuDevice(stm_device)
--> 392     hw_version = get_hw_version_in_dfu_mode(dfudev)
    393     if hw_version is None:
    394         logger.error("Could not determine hardware version. Flashing precompiled "

C:\ProgramData\Anaconda3\lib\site-packages\odrive\dfu.py in get_hw_version_in_dfu_mode(dfudev)
    264     if otp_data[0] == 0:
    265         otp_data = otp_data[16:]
--> 266     if otp_data[0] == 0xfe:
    267         return (otp_data[3], otp_data[4], otp_data[5])
    268     else:

IndexError: array index out of range

How do I solve this?



I managed to solve this by forcing the board into dfu mode (dip switch toggled to dfu, gpio 6 connected to ground), then used the stm32cubeprogrammer and the instructions here under ‘Upgrading firmware with a different DFU tool’ to successfully upgrade the firmware.