Dfu-util doesn't connect to core on Ubuntu [Solved]

I am having a lot of problems creating my dfu-util toolchain on a linux machine. I am currently running Ubuntu 14.04.

First I put my device in dfu mode so that it is blinking yellow

I run sudo apt-get install dfu-util openssl. When I try to run spark flash blink (a simple blinking program) I get this error:

FOUND DFU DEVICE 1d50:607f
checking file blink.cpp
spawning dfu-util -d 1d50:607f -a 0 -i 0 -s 0x08005000:leave -D blink.cpp
invalid dfuse address: 0x08005000:leave
Error writing firmware...

as a note: dfu-util -l gives

dfu-util 0.5

(C) 2005-2008 by Weston Schmidt, Harald Welte and OpenMoko Inc.
(C) 2010-2011 Tormod Volden (DfuSe support)
This program is Free Software and has ABSOLUTELY NO WARRANTY

dfu-util does currently only support DFU version 1.0

Found DFU: [1d50:607f] devnum=0, cfg=1, intf=0, alt=0, name="UNDEFINED"
Found DFU: [1d50:607f] devnum=0, cfg=1, intf=0, alt=1, name="UNDEFINED"

I read on other forum topics that you should install dfu-util version 0.7 or above. Obviously I am running 0.5, so this should be the issue. Ok...

sudo apt-get remove dfu-util
wget http://dfu-util.gnumonks.org/releases/dfu-util-0.7.tar.gz
tar -zxvf dfu-util-0.7.tar.gz dfu-util-0.7
cd dfu-util-0.7/
./autogen.sh
./configure
make
sudo make install

Now I execute dfu-util --version and it gives me nothing! So I add it directly to my /usr/bin folder

cd /usr/bin
sudo ln -s ~/Software/dfu-util-0.7/src/dfu-util 

dfu-util -l gives me

dfu-util 0.7

Copyright 2005-2008 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2012 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

Found DFU: [1d50:607f] devnum=0, cfg=1, intf=0, alt=0, name="UNDEFINED"
Found DFU: [1d50:607f] devnum=0, cfg=1, intf=0, alt=1, name="UNDEFINED"

but, back in my home directory spark flash --usb blink.cpp still gives me

user@user-Lenovo-B590:~/projects/beecode/src/blink$ spark flash --usb firmware_1410924769674.bin
FOUND DFU DEVICE 1d50:607f
checking file firmware_1410924769674.bin
spawning dfu-util -d 1d50:607f -a 0 -i 0 -s 0x08005000:leave -D firmware_1410924769674.bin
dfu-util 0.7

Copyright 2005-2008 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2012 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

Filter on vendor = 0x1d50 product = 0x607f
Cannot open device
Opening DFU capable USB device... Error writing firmware...

Any ideas? Please help! Many of the beehive developers use linux, and we depend on this toolchain for faster and more robust development.

Thanks

1 Like

Holy crap, all I needed was:

sudo spark flash --usb blink.cpp
4 Likes

Hi @CloudformDesign,

I'm glad you figured this out, I'm sorry the CLI didn't give you a more helpful error message!

I created an issue for this here: dfu-util operations should give a more helpful error message when sudo is needed · Issue #96 · particle-iot/spark-cli · GitHub

Thanks,
David

For anybody finding this thread in the future, if you want to avoid using sudo with particle flash use this udev rules file.

5 Likes