DFU-UTIL Install on Mac OS X

I have recently faced issues with photon that have meant I needed to install and use DFU-UTIL on my mac running OSX El Capitan. The instructions on the Help Page are rather short on the details of how to do this and overcome the errors that will no doubt crop up for others. Attached here are the work arounds.

I had no problems installing brew.

However,

$ brew install dfu-util

kicked out this

Error: You must `brew link pkg-config libusb' before dfu-util can be installed

Doing as asked kicked out another

Linking /usr/local/Cellar/pkg-config/0.28... 
Error: Could not symlink .
/usr/local/opt is not writable.

After a bit of digging around the solution was on Stackoverflow
this sorts the not writable issue

$ sudo chown -R `whoami`:admin /usr/local

then link

$ brew link pig-config libusb

then install

$ brew install dfu-util
==> Downloading http://ftp.de.debian.org/debian/pool/main/d/dfu-util/dfu-util_0.8.orig.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/dfu-util/0.8
==> make install
🍺  /usr/local/Cellar/dfu-util/0.8: 10 files, 144K, built in 22 seconds

Hey Presto!

The next part of the vague instructions for updating the firmware…

Download of Firmware Part 1 and Part 2 is straightforward and you get these files in Downloads folder

system-part2-0.4.6-photon.bin
system-part1-0.4.6-photon.bin

The instructions are then to run on the console the following:

$ dfu-util -d 2b04:d006 -a 0 -s 0x8020000 -D system-part1-0.4.6-photon.bin

then

$ dfu-util -d 2b04:d006 -a 0 -s 0x8060000:leave -D system-part2-0.4.6-photon.bin

except the .bin files have to be unpacked and placed in a specific directory which is not mentioned!

dfu-util help

isn’t that helpful either!!

@armor - Did you eventually come right with this? I’m battling with the .bin files being in the apparent incorrect folder… or not being able to be found (but they are in my Downloads folder).

Any suggestions?

Have you changed into your download folder (cd /your/download/folder/path/) or are you providing the full path to the files to dfu-util?

Unpacked??? And they don’t need to be placed in a specific directory, dfu-util must just be able to locate them - as any other program would need to know where to find the files it should work with.
Some things should be considered logical.

1 Like

@ScruffR, @armor - All sorted thanks… happily breathing cyan down here so it’s alive and kicking.

1 Like

Hi @ScruffR

I never got this working from the terminal since I could not work out exactly where I was supposed to place the .bin files for the dfu-util to pick them up. Am I right in saying I should have just put the path in the dfu-util command such as:

$ dfu-util -d 2b04:d006 -a 0 -s 0x8020000 -D /Users/wjsteen/Downloads/system-part1-0.4.6-photon.bin

Unpacked meant unzipped.

To answer @neal_tommy - I have used CLI particle update with the photon serial connected and in dfu-util mode (flashing yellow) successfully to sort out unclaimable (with a straight-forward $particle setup) devices.

Thanks for the update :+1:

I gathered that, but I was just puzzled why they would be packed as the bin files are available unpacked in the intended download links anyhow.
https://github.com/spark/firmware/releases/ (Downloads section at the end of the blurb)

But obviously you just downloaded via the “minute” zip icon, which I wasn’t aware :wink:

No worries.