ok i think I got the linux dfu tool to work…?
after finally getting intelhex to install for python3:
sudo pip uninstall intelhex
download IntelHex from source:
uncompress archive and cd into intelhex directory
sudo python3 setup.py install
then I realize I was using the dfu tool wrong, because the custom firmware flashing instructions are buried under one of those drop down things in the docs.
the proper command is:
cd ~/ODrive/tools/
sudo ./odrivetool dfu path/to/firmware/file.hex
which in my case after running the “make” command to flash the firmware one must run:
sudo ./odrivetool dfu /home/thomas/ODrive/Firmware/build/ODriveFirmware.hex
but there was still an error thrown at the end, but I can connect to the drive… so assuming the firmware went through?
thomas@localhost:~/ODrive/tools$ sudo ./odrivetool dfu ~/ODrive/Firmware/build/ODriveFirmware.hex
[sudo] password for thomas:
ODrive control utility v0.4.0.dev
Waiting for ODrive…
Found ODrive 206A3396304B (v3.6-24V) with firmware [unknown version] in DFU mode
You are about to flash firmware [unknown version] which is the same version as the 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… done
Verifying… done
Waiting for the device to reappear…
Traceback (most recent call last):
File “./odrivetool”, line 142, in
File “/home/thomas/ODrive/tools/odrive/dfu.py”, line 454, in launch_dfu
update_device(device, firmware, logger, cancellation_token)
File “/home/thomas/ODrive/tools/odrive/dfu.py”, line 417, in update_device
if do_backup_config:
UnboundLocalError: local variable ‘do_backup_config’ referenced before assignment
Exception ignored in: <bound method Device.del of <DEVICE ID 0483:df11 on Bus 003 Address 018>>
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/usb/core.py”, line 1029, in del
self._ctx.dispose(self)
File “/usr/lib/python3/dist-packages/usb/core.py”, line 225, in dispose
self.release_all_interfaces(device)
File “/usr/lib/python3/dist-packages/usb/core.py”, line 222, in release_all_interfaces
self.managed_release_interface(device, i)
File “/usr/lib/python3/dist-packages/usb/core.py”, line 159, in managed_release_interface
self.backend.release_interface(self.handle, i)
File “/usr/lib/python3/dist-packages/usb/backend/libusb1.py”, line 751, in release_interface
_check(self.lib.libusb_release_interface(dev_handle.handle, intf))
File “/usr/lib/python3/dist-packages/usb/backend/libusb1.py”, line 552, in _check
raise USBError(_strerror(ret), ret, _libusb_errno[ret])
usb.core.USBError: [Errno 19] No such device (it may have been disconnected)
thomas@localhost:~/ODrive/tools$ ./odrivetool
ODrive control utility v0.4.0.dev
UPDATE:
ok YES it did flash the firmware, but NO it is the wrong branch!
I hadn’t downloaded the development tree properly! It’s github’s fault. When you click on the “clone or download” button on this page: https://github.com/Wetmelon/ODrive/tree/Endstops
and if you get the link to clone “https://github.com/Wetmelon/ODrive.git” it is not the right branch.
but if you download the ZIP file it is correct from this page it is correct.
arrg so frustrating. @Wetmelon FYI