pycom-micropython-sigfox: From MacOS Catalina Unable to update Pytrack firmware | dfu-util: Cannot set alt interface zero

Host is MacBook Air running Catalina PyCom: GPY & Pytrack

Firmware from Repl: (sysname=‘GPy’, nodename=‘GPy’, release=‘1.18.1.r2’, version=‘v1.8.6-849-f652205 on 2018-10-18’, machine=‘GPy with ESP32’)

I ran the following command to check the boot state of the pytrack and then update the firmware: lsusb && dfu-util -D pytrack_0.0.8.dfu

I got the following output and the

Bus 020 Device 001: ID 04d8:f014 Microchip Technology, Inc. 
Bus 128 Device 004: ID 05ac:027a Apple, Inc. 
dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Match vendor ID from file: 04d8
Match product ID from file: f014
Opening DFU capable USB device...
ID 04d8:f014
Run-time device DFU version 0100
Claiming USB DFU Runtime Interface...
dfu-util: Cannot set alt interface zero

I’ve tried this with the GPY mounted. With it not mounted. Same result.

Others are reporting this in the forum as well with no response. If the steps are wrong on the site, happy to test new ones. tx!

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 2
  • Comments: 16 (2 by maintainers)

Most upvoted comments

The issue is not related to macOS Catalina.

The issue was pinpointed to a bug in libusb that has been present in libusb versions 1.0.23 and 1.024 in the macOS-specific code. A fix is available.

We now have to wait till the fix is merged into libusb, and hopefully a new release of libusb is made.

In te mean time: the workaround is to downgrade libusb to version 1.0.22, or use a different operating system.

(@catalinio, @gijsio: could you update the title of this bug accordingly?)

Hi @wang70880 - the bug you mostly likely encountered was chased and resolved in Januari 2021. dfu-util version 0.7 was published in 2012. Unfortunately, libusb 1.0.25 (which contains the fix) has not been released yet.

So as noted above, your options are:

  1. use dfu-util on a platform that never never affected by this bug (Linux of Windows)
  2. download and compile both libusb and dfu-util yourself. Follow the links for some guidance.
  3. download an older version (1.0.22) of libusb. See for example the homebrew script from gijsio above.

FYI, the fix was just merged to libusb. It will probably take a while before it trickles down in a new release of libusb and subsequently distirbutions of dfu-util. The fix is scheduled to be in libusb 1.0.25 release.

Thanks a lot Freek!

Hi @gijsio, @catalinio: you’re welcome, but the real credit should go to @tormodvolden, since he spend a lot of his time maintaining dfu-util, and helping me chase this bug. I have some benefit (I can further tinker with my PyTrack and PySense), while he is (and the libusb maintainers are) doing it voluntarily.

That said, I did encounter another issue with a DFU upgrade the pysense on Linux. Unfortunately, I decided not to pursue that issue. (But will tinker with the PyTrack, my original intention). Do you think there is a possibilty you can help @tormodvolden chase the questions he had? Either by running a test on his request, or providing him with an extension board, so he can test for himself?