electro-smith/DaisyWiki

Mac installation missing dfu-util step?

Closed this issue · 3 comments

Hi! I'm on a Mac running macOS Monterey, with an Intel Core i7 processor.

When I ran $ make program-dfu I got the following error:

dfu-util -a 0 -s 0x08000000:leave -D build/harmonic_osc.bin -d ,0483:df11
dyld[3956]: Library not loaded: '/usr/local/opt/libusb/lib/libusb-1.0.0.dylib'
  Referenced from: '/Library/DaisyToolchain/0.1.2/bin/dfu-util'
  Reason: tried: '/usr/local/opt/libusb/lib/libusb-1.0.0.dylib' (no such file), '/usr/local/lib/libusb
-1.0.0.dylib' (no such file), '/usr/lib/libusb-1.0.0.dylib' (no such file)
make: *** [program-dfu] Abort trap: 6

I was able to resolve it by re-installing and linking dfu-util:

$ brew install dfu-util
$ brew link --overwrite dfu-util

Happy to open a PR to add this to the Troubleshooting section if that would be helpful.

We would greatly appreciate it if you could open a PR and we'll have a closer look. Thank you.

Hello! Just ran into a similar issue during bring-up. Seems like dfu-util actually has some issues with being bundled improperly. If you check out this conversation here you can see that the dfu-util package seems to have been the problem. Here is the fix in the repo that this issue was brought up in. Looks like they just updated the bundled version in the toolchain. My best guess is that newer versions of Mac place the libusb library in a new location that dfu-util doesn't know to look for.

For anyone else reading this, workarounds for the issue involve updating your dfu-util to a newer version and making sure that the program-dfu make target is using it.

Steps to run on command line that worked for me:
which dfu-util
prints out the location of the dfu-util installed via the toolchain
sudo rm -rf /location/of/the/path/returned/from/which/dfu-util/
removes the offending dfu-util version. You don't have to do this, but I found it easier than trying to link to the new version
brew install dfu-util
Just installs the new version of dfu-util. At the time of this comment, I have successfully built and run dfu-util 0.11 with the Blink example code on Mac M1 Pro Ventura 13.4
dfu-util
Attempt to run the newly installed dfu-util. If it didn't work, you'll get the same error. If it did work the help command will print

That should be all you need. If the dfu-util command isn't showing up you might need to reload your terminal.

Hi everyone!

This issue should be resolved via the newer Mac OS installer for the toolchain, so there should be no more need to install dfu-util and etc via brew.

Also, please note that if you're up and running at this point, there's no need to reinstall anything. However, if you're still having issues, we suggest that you install via the Daisy Toolchain installer.

We'll close this issue as there should be no need to edit the wiki. We greatly appreciate both of your suggestions and documenting the solutions and workarounds. Thanks!