Firmware update error

Whenever I try to run a firmware upgrade, I get the following output. Any thoughts?
Initially the driver loaded is the STM Bootloader because of other projects. When asked I use the zadig utility to switch. Then I get this error. Rerunning the “odrivetool dfu” after causes the same.
???

ODrive control utility v0.4.6
Waiting for ODrive...
Found ODrive 367433693037 (v3.5-24V) with firmware v0.4.6-dev
Checking online for newest firmware... found v0.4.7
Downloading firmware v0.4.7...
Saving configuration
Configuration saved.
Putting device 367433693037 into DFU mode...
Still waiting for the device to reappear.
Use the Zadig utility to set the driver of 'STM32 BOOTLOADER' to libusb-win32.
Erasing... done
Flashing... (sector 0/6)
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
~\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':

~\Anaconda3\lib\site-packages\odrive\dfu.py in launch_dfu(args, logger, cancellation_token)
    452     firmware = FirmwareFromFile(args.file) if args.file else None
    453
--> 454     update_device(device, firmware, logger, cancellation_token)
    455
    456

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

~\Anaconda3\lib\site-packages\odrive\dfuse\DfuDevice.py in write_sector(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)

Please try one of the other firmware upgrade methods: https://docs.odriverobotics.com/odrivetool#upgrading-firmware-with-a-different-dfu-tool

1 Like

Sure, the other modes work. I use the odrivetool dfu command to bring the controller into dfu mode (or via the dip switches) and then the dfusedemo tool from STM.

Just wanted to report that this method (odrivetool dfu) of firmware upgrade does not work.
(And I do not like that you have to use zadig to swap the drivers. I have multiple microcontrollers that are upgraded via STM DFU hardware implementation and now I (would) have to swap the drivers constantly.)

1 Like

I have had the same issue. I am attempting to use the dfusedemo tool and it is not recognizing the Odrive. I have forced the it into DFU mode and set it back to its original drive per step 9.1 (https://docs.odriverobotics.com/odrivetool#device-firmware-update). I really do not know where to go with this…

I have been struggling with firmware updates as well for version 3.5. DFU tool doesnt work, so I went on to this site to try a different way.

[https://docs.odriverobotics.com/odrivetool#upgrading-firmware-with-a-different-dfu-tool ]

That had a link to install DfuFileMgr.exe.

https://www.st.com/en/development-tools/stsw-stm32080.html

That link does NOT have DfuFileMgr.exe. It does have DFUseDemo. Having never used either of these software before the instructions make no sense. I am assuming this method is also not possible because DfuFileMgr.exe is not available any more?

Stuck again, anyone else know what I can do? All of this goes back to my original problem. I cant run in sensorless mode because my firmware doesnt have:

odrv0.axis0.sensorless_estimator.config.pm_flux_linkage

Very stuck, been working on this for days… still my motors havent twitched yet.

Thanks!

Scott

You can use the DfuseDemo tool as well. Just bring the ODrive tool in DFU mode (using the onboard hardware switches), start the DFUseDemo tool, upload the .dfu file.
This video might help (one of many)

A bit of background:

  1. The STM32F4 has a USB bootloader onboard and in hardware. Hence this method is absolutely safe. You cannot break anything.
  2. In order to activate that boot loader mode, you have to connect the BOOTP pin of the MCU to high. If that pin is High when the controller is powered up, then the bootloader does start. In the ODrive there is a switch for that. It is called SW1 and has a label called DFU. https://github.com/madcowswe/ODriveHardware/blob/master/v3/v3.5docs/v3.5_top.PNG
  3. You can see that the bootloader is active when you run the DFUseDemo tool and in the top drop down box, the line “STM Device in DFU Mode” is shown. If it isn’t, then it is either not in DFU mode or the wrong driver is loaded. Fixing that needs a bit of explanation - so post again if you need help with that.
  4. The dfu file can be generated from a hex file - your link has a section describing that.
  5. Then upload it just as shown in the video. One thing I would do in addition is ticking the “verify after download” checkbox. It might happen that the upload failed and then you would not notice. Happens once in 100 cases. Simply retry if.

I appreciate the help. I should have been more clear. I cannot generate the dfu file from the hex file.

  1. Instructions say to download DfuFileMgr.exe from this web site.
    https://www.st.com/en/development-tools/stsw-stm32080.html
  2. The site does NOT have that application
  3. Web site has DFUseDemo instead of DfuFileMgr.exe
  4. I cannot load the DFU with either software because I cannot create it to begin with from the hex file

Sorry, should have read between the lines. It is also a while back, I installed all.
This downloaded zip file contains a setup program and once that is executed, you will find all files, including the file manager, in your install directory.
C:\Program Files (x86)\STMicroelectronics\Software\DfuSe v3.0.6\Sources\Binary\Release

The readme tells that as well

Package content
***************
       Binaries :([INSTALLATION PATH]\BIN\) and ([INSTALLATION PATH]\BIN\STM32L) Variant with extra time for Erase.
         - DfuFileMgr.exe             : DFU File Manager aplication,
         - DfuSeDemo.exe              : DfuSe Demo application,
         - DfuSeCommand.exe           : DfuSe Command line application,
         - STDFUTester.exe            : DfuSe Tester application ,
1 Like

Hello, I’m having an issue getting the DFUseDemo tool to recognize my odrive. I’ve gotten to this part:

  1. You can see that the bootloader is active when you run the DFUseDemo tool and in the top drop down box, the line “STM Device in DFU Mode” is shown. If it isn’t, then it is either not in DFU mode or the wrong driver is loaded. Fixing that needs a bit of explanation - so post again if you need help with that.

And STM Device in DFU Mode isn’t shown. How can I put the right driver on?

Thanks,
Richard

@nocnoon: We had the same problem you are describing, we coudn’t get the firmware on the Odrive board. We managed to solve the problem by reflashing on macOS.

Thanks for the suggestion, in my case I was just missing the STM Device in DFU Mode driver which could be installed from Windows update. After that it showed up in DfUseDemo and then I could flash it and now it’s fine.