Upgrade Firmware Spark Core

Hi,

I still have an early version Spark Core, and I want to upgrade the firmware.

I started wth:

dfu-util -l

But I can’t see the device.

What debugging options are there?
(The LED is blinking Blue, and there is only 1 button to press I think)

Hi @poseid

You need to be in dfu mode in order to see the device, which is blinking yellow. Hold down the mode button and release when you see blinking yellow on a Core.

Thanks! That worked.

  pm:firmware pmu$ dfu-util -l
dfu-util 0.8

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

Deducing device DFU version from functional descriptor length
Found Runtime: [05ac:828f] ver=0079, devnum=2, cfg=1, intf=3, alt=0, name="UNKNOWN", serial="UNKNOWN"
Found DFU: [1d50:607f] ver=0200, devnum=19, cfg=1, intf=0, alt=1, name="@SPI Flash : SST25x/0x00000000/512*04Kg", serial="6D7D5F984852"
Found DFU: [1d50:607f] ver=0200, devnum=19, cfg=1, intf=0, alt=0, name="@Internal Flash  /0x08000000/20*001Ka,108*001Kg", serial="6D7D5F984852"
pm:firmware pmu$ dfu-util -d 1d50:607f -a 1 -s 0x00020000:0x00022000 -U backup_frfirmware.bin
dfu-util 0.8

Now, the command to flash is a bit unclear: make dfu-program results in target not found.

The output of make all is:

arm-none-eabi-size --format=berkeley ../build/target/main/platform-0-lto/main.elf
   text	   data	    bss	    dec	    hex	filename
  80628	   1096	   8828	  90552	  161b8	../build/target/main/platform-0-lto/main.elf

I tried with the dfu-util command, this is what I got:

pm:firmware pmu$ dfu-util -d 1d50:607f -a 0 -s 0x08005000:leave -D  build/target/main/platform-0-lto/main.bin
dfu-util 0.8

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

dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
Deducing device DFU version from functional descriptor length
Opening DFU capable USB device...
ID 1d50:607f
Run-time device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 1024
DfuSe interface name: "Internal Flash  "
Downloading to address = 0x08005000, size = 81728
Download	[=========================] 100%        81728 bytes
Download done.
File downloaded successfully
Transitioning to dfuMANIFEST state
pm:firmware pmu$ particle list
photon1 [2b0035001347343339383037] (Photon) is offline

Hi @poseid

You want to be in the build directory and make all program-dfu whereas you had the words in the other order. Your device needs to already be in DFU mode.

You second posting shows that the dfu download worked, but I don’t think you have the right bin file.

2 Likes

Hi @bko,

thanks for your help!

Still, in my folder structures something seems to be wrong with the program-dfu target:

arm-none-eabi-objcopy -O ihex ../build/target/main/platform-0-lto/main.elf ../build/target/main/platform-0-lto/main.hex
arm-none-eabi-size --format=berkeley ../build/target/main/platform-0-lto/main.elf
   text	   data	    bss	    dec	    hex	filename
  80628	   1096	   8828	  90552	  161b8	../build/target/main/platform-0-lto/main.elf
arm-none-eabi-objdump -h -S ../build/target/main/platform-0-lto/main.elf > ../build/target/main/platform-0-lto/main.lst
make: *** No rule to make target `program-dfu'.  Stop.
pm:firmware pmu$ cd build/
pm:build pmu$ make all program-dfu
make: *** No rule to make target `all'.  Stop.

The bin files in the project are:

pm:build pmu$ find . -name "*bin"
./bin
./target/bootloader/platform-0-lto/bootloader.bin
./target/main/platform-0-lto/main.bin

You have to be in the main folder and run make all program-dfu

1 Like

There is no program-dfu target:

/Applications/Xcode.app/Contents/Developer/usr/bin/make -C ../wiring_globals
make[2]: Nothing to be done for `all'.
arm-none-eabi-size --format=berkeley ../build/target/main/platform-0-lto/main.elf
   text	   data	    bss	    dec	    hex	filename
  80628	   1096	   8828	  90552	  161b8	../build/target/main/platform-0-lto/main.elf
make: *** No rule to make target `program-dfu'.  Stop.

Did you change folder from the root?

Yes, the command was invoked from the main folder:

$ pwd
 /Users/pmu/projects/embedded/firmware

But since the target was not found there.
In the ‘makefile’ there is no reference to module.mk which has the program-dfu target:

include $(COMMON_BUILD)/common-tools.mk
include $(COMMON_BUILD)/recurse.mk
include $(COMMON_BUILD)/verbose.mk

Not the ‘main’ folder as in 'the root of the folder that you downloaded, but ‘main’ as in “the folder that is actually called ‘main’”, which should be in the directory you downloaded.
Give that a try?

1 Like

Haha, thanks!
That was it :smile:

Ok, next question was why I can’t see the spark core:

pm:main pmu$ particle list
photon1 [2b0035001347343339383037] (Photon) is offline

Just to make sure the upgrade was working:

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
DfuSe interface name: "Internal Flash  "
Downloading to address = 0x08005000, size = 81728
Download	[=========================] 100%        81728 bytes
Download done.
File downloaded successfully
Transitioning to dfuMANIFEST state

Trying to setup the Spark core first, gives this:

> I have detected a Core connected via USB.
? Would you like to continue with this one? Yes
? Should I scan for nearby Wi-Fi networks? Yes
? Select the Wi-Fi network with which you wish to connect your device: WLAN-xxxxxx
? Should I try to auto-detect the wireless security type? Yes
> Detected WPA2(PSK/AES/AES) security
Assertion failed: (timeout != -1), function uv__io_poll, file ../deps/uv/src/unix/kqueue.c, line 159.
Abort trap: 6

Maybe this is another thread