Issue flashing Spark Core without Cloud / Web IDE [SOLVED]

I’m trying to flash my Spark Core without using the Web IDE / Cloud.

I’ve successfully downloaded and installed dependencies, downloaded and built the repositories, but I’m having an issue with the actual flashing.

I’ve been following the instructions here: https://github.com/spark/core-firmware/blob/master/README.md

I can successfully put the Core in DFU mode (holding down the MODE button on the Core and then tapping on the RESET button once = flashing yellow).

When I run the following command:

dfu-util -l

I get the following:

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"
Found Runtime: [0489:e00f] devnum=0, cfg=1, intf=3, alt=0, name="UNDEFINED"

Which is a little different from the instructions (i.e. things are “UNDEFINED”, rather than containing details).

When I navigate to the build folder in the core-firmware repository and use the following command to transfer the .bin file into the Core, I get the following error:

binaryfrost@linux:~/Spark/core-firmware/build$ dfu-util -d 1d50:607f -a 0 -s 0x08005000:leave -D core-firmware.bin 
invalid dfuse address: 0x08005000:leave

Any ideas where I am going wrong? I’m running Ubuntu 13.10.

Bad form replying to my own post… but I solved it.

The Ubuntu repo only contains dfu-util v0.5, so I downloaded, ./confugure’d, and make’d the latest release version (v0.7) from http://dfu-util.gnumonks.org/

This also required me to install libusb-dev too, before it would successfully ./configure. Easy on Ubuntu, with:

sudo apt-get install libusb-1.0-0-dev

I tried again, using the newer version of dfu-util, and had a different error:

binaryfrost@linux:~/Spark/core-firmware/build$ ~/Downloads/dfu-util-0.7/src/dfu-util -d 1d50:607f -a 0 -s 0x08005000:leave -D core-firmware.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... 

Seeing as this was a ‘cannot open’ kinda error, I tried it as root:

binaryfrost@linux:~/Spark/core-firmware/build$ sudo ~/Downloads/dfu-util-0.7/src/dfu-util -d 1d50:607f -a 0 -s 0x08005000:leave -D core-firmware.bin

And success:

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
Opening DFU capable USB device... ID 1d50:607f
Run-time device DFU version 011a
Found DFU: [1d50:607f] devnum=0, cfg=1, intf=0, alt=0, name="@Internal Flash  /0x08000000/20*001Ka,108*001Kg"
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuERROR, status = 10
dfuERROR, clearing status
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 1024
No valid DFU suffix signature
Warning: File has no DFU suffix
DfuSe interface name: "Internal Flash  "
Downloading to address = 0x08005000, size = 87592
......................................................................................
File downloaded successfully
Transitioning to dfuMANIFEST state
Error during download get_status

The “Error during download get_status” is a known error.

The Core successfully reset itself, with (in this particular instance) the Tinker sketch running.

I should probably turn this into a ‘How-to Spark for Linux’ shouldn’t I?

1 Like

Quick dfu-util install for those on linux with build essentials already installed:

opkg install libusb-1.0-dev
#or sudo apt-get install libusb-1.0-0-dev

wget http://dfu-util.gnumonks.org/releases/dfu-util-0.7.tar.gz
tar xvf dfu-util-0.7.tar.gz
cd dfu-util-0.7
./configure
make
make install

:smile:

i’ve made a couple of debian packages of 0.7 and also the unreleased 0.8 that’s in git

i’ve not changed the code, just imported the old 0.5 debian directory and rebuilt the packages for amd64. should work on ubuntu too. only tested on jessie.

download link

2 Likes

Awesome, thanks! :smile:

Thanks,
David

also chased up the debian bug that’s been sitting there since 2012 requesting a new package. looks like its been abandoned, which is a shame as the 4 lintian warnings can be fixed by changing one line in the control file and building with a newer environment.

i’ve also uploaded a raspberry pi armv6 package now (tested it on armv7 beaglebone black too) and checked that the debian7 amd64 package also works on ubuntu 12.04

1 Like