# Tutorial: Upgrading Factory Reset Firmware

**URL:** <https://community.particle.io/t/tutorial-upgrading-factory-reset-firmware/3430>\
**Category:** Tutorials\
**Created:** [March 15, 2014, 12:31am UTC](https://community.particle.io/t/tutorial-upgrading-factory-reset-firmware/3430 "2014-03-15T00:31:04Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [March 15, 2014, 12:31am UTC](https://community.particle.io/t/tutorial-upgrading-factory-reset-firmware/3430/1 "2014-03-15T00:31:04Z")

</div>

This is for :spark: core owners who would like to upgrade their factory firmware from V01 to the V02 that is on the new core manufactured!

**Continue only if you understand the possible risk of ending up with a non-functioning core (which still can be revived) which you have to troubleshoot**

1. The way to tell which FR-firmware now is to enter Listening Mode (Press Mode button for 5s)

2. Using a Terminal, enter 'w' to send Wifi Credentials

3. If your core prompts you for `'Security type'`, you are on **V02** and you don't need to upgrade 😃

4. If you are only asked for SSID and Password, then you are on **V01**

**\*Allow me to say that this is not the best way to determine the FF-firmware in future versions (V03, V04, V05) but right now that's the key difference between V01 & V02**

This tutorial will be updated in future should there by a way to determine the Core FF-firmware Version, maybe just a simple 'V' command over usb for example

* * *

## Pre-check!

* * *

Make sure you have already done installed the DFU-driver for Spark Core in order to continue.

If you have not or have no idea what I just mentioned.....you probably need to do it 😄

Instructions here: \> [Tutorial: Installing DFU-Driver on Windows [24 Feb 2015] - #2 by kennethlimcp - Tutorials - Particle](https://community.spark.io/t/tutorial-installing-dfu-driver-on-windows/3518/2)

* * *

## How to put your core in DFU-mode

* * *

1. Press on BOTH buttons
2. Release only the Reset button
3. Release the Mode button once the core start blinking yellow
4. This will be the dfu-mode smile

* * *

## Alright time to upgrade!

* * *

1. Go to [Release spark\_2 · particle-iot/device-os · GitHub](https://github.com/spark/core-firmware/releases/tag/spark_2) and download the file

2. Put your :spark: core in DFU mode

3. On your terminal, enter the following command:

- Check if the core is detected

- Download the original fr-firmware just to be safe (128KB)

- Upload the latest fr-firmware (V02)

You will be able to find the V02 firmware named as `'core-firmware.bin'` in the zip/tar.gz file you downloaded in the folder `'build'`

* * *

Once that is completed, your core will reset!

Perform a Factory Reset ([Particle Welcome to the Particle docs](http://docs.spark.io/#/connect/appendix-factory-reset)) & make sure that the core functions as per normal 😄

Updated on: 19 March 2014

---

<div class="post-metadata">

**Author:** ![Dave](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/dave/32/181_2.png) [@Dave](https://community.particle.io/u/Dave)\
**Post date:** [March 15, 2014, 5:19am UTC](https://community.particle.io/t/tutorial-upgrading-factory-reset-firmware/3430/2 "2014-03-15T05:19:43Z")

</div>

Hey @kennethlimcp,

I think you mean `0x00020000`, no ?

Thanks,  
David

---

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [March 15, 2014, 5:35am UTC](https://community.particle.io/t/tutorial-upgrading-factory-reset-firmware/3430/3 "2014-03-15T05:35:08Z")

</div>

Thanks @dave!

I wonder what was I thinking… haha!

---

<div class="post-metadata">

**Author:** ![david\_s5](https://avatars.discourse-cdn.com/v4/letter/d/53a042/32.png) [@david\_s5](https://community.particle.io/u/david_s5)\
**Post date:** [March 15, 2014, 12:46pm UTC](https://community.particle.io/t/tutorial-upgrading-factory-reset-firmware/3430/4 "2014-03-15T12:46:59Z")

</div>

Time for the v command.

---

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [March 15, 2014, 1:06pm UTC](https://community.particle.io/t/tutorial-upgrading-factory-reset-firmware/3430/5 "2014-03-15T13:06:06Z")

</div>

TOTALLY 😃

That’s isn’t hard at all if we just add another ‘v’ to be read during factory reset and hardcode the version for now.

@david_s5 are you gonna do it or shall i attempt to do it? 😄

---

<div class="post-metadata">

**Author:** ![david\_s5](https://avatars.discourse-cdn.com/v4/letter/d/53a042/32.png) [@david\_s5](https://community.particle.io/u/david_s5)\
**Post date:** [March 15, 2014, 1:35pm UTC](https://community.particle.io/t/tutorial-upgrading-factory-reset-firmware/3430/6 "2014-03-15T13:35:53Z")

</div>

The command is the easy part, it is the build, minor number creation, weather the working directory is modifies, and not rebuilding that file each time part of it that requires the work.

---

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [March 15, 2014, 1:41pm UTC](https://community.particle.io/t/tutorial-upgrading-factory-reset-firmware/3430/7 "2014-03-15T13:41:35Z")

</div>

But the factory-firmware isn’t changed that often…

---

<div class="post-metadata">

**Author:** ![Dave](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/dave/32/181_2.png) [@Dave](https://community.particle.io/u/Dave)\
**Post date:** [March 15, 2014, 2:05pm UTC](https://community.particle.io/t/tutorial-upgrading-factory-reset-firmware/3430/8 "2014-03-15T14:05:52Z")

</div>

I think for the golden versions we’re using an environment var to set a define in the code, so the ‘v’ command could just spit that define out, yeah?

---

<div class="post-metadata">

**Author:** ![david\_s5](https://avatars.discourse-cdn.com/v4/letter/d/53a042/32.png) [@david\_s5](https://community.particle.io/u/david_s5)\
**Post date:** [March 15, 2014, 2:40pm UTC](https://community.particle.io/t/tutorial-upgrading-factory-reset-firmware/3430/9 "2014-03-15T14:40:04Z")

</div>

Yes and no. Look at it from a user POV.

What do we present

> Major.Minor.Rev.build \*\*\* good info \*\*\*

Or

> Major.Minor.Rev.build Built: Thu, 21 Dec 2000 16:01:07 +0200 _ **ah Mo' betta** _

Major, Minor and Rev can come from the const in the MakeFile?

_ **build** _ come from the version control system. (the trick is making one number from three repos (the knot) and not making it a human dependent task.

the _ **timestamp** _ would reflect the time of the build.

Like I said above and in the last message to get the _ **build** _ is tricky but it can be done with make. The _ **timestamp** _ is worse.

I see the total revision number solution best solved with an makefile , script an API for reading and embedded ID and, some linker magic.

But yes you can do all but the _ **timestamp** _ statically, but guarens at some point, late one night, after a marathon sprint, someone will forget to "bump the rev"

Aloha,

---

<div class="post-metadata">

**Author:** ![Dave](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/dave/32/181_2.png) [@Dave](https://community.particle.io/u/Dave)\
**Post date:** [March 15, 2014, 3:06pm UTC](https://community.particle.io/t/tutorial-upgrading-factory-reset-firmware/3430/10 "2014-03-15T15:06:57Z")

</div>

Hmm, we could increment a version integer in the build IDE after each save, and/or a date/time stamp (code time vs. build time), and then also have a compile/flash stamp from the makefile with something like `NOW := $(shell date +"%c" | tr ' :' '__')` in the makefile ( from here: [http://stackoverflow.com/questions/12463770/insert-time-stamp-into-executable-name-using-makefile](http://stackoverflow.com/questions/12463770/insert-time-stamp-into-executable-name-using-makefile) )

---

<div class="post-metadata">

**Author:** ![david\_s5](https://avatars.discourse-cdn.com/v4/letter/d/53a042/32.png) [@david\_s5](https://community.particle.io/u/david_s5)\
**Post date:** [March 15, 2014, 9:10pm UTC](https://community.particle.io/t/tutorial-upgrading-factory-reset-firmware/3430/11 "2014-03-15T21:10:59Z")

</div>

Since the RTC lib need to format them…I would use the unix epoch time stamp stored in the FW as a uint32\_t

typedef struct {  
uint8|16\_t major;  
uint8|16\_t minor;  
uint16\_t rev;  
uint16\_t build;  
uint32\_t timestamp;  
} fw\_version\_t;

80 - 96 bits total.

---

<div class="post-metadata">

**Author:** ![peetersm](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peetersm/32/856_2.png) [@peetersm](https://community.particle.io/u/peetersm)\
**Post date:** [March 18, 2014, 1:18am UTC](https://community.particle.io/t/tutorial-upgrading-factory-reset-firmware/3430/12 "2014-03-18T01:18:14Z")

</div>

thanks for the tutorial, I really want to update my sparkcore since I am on V1 and having some troubles that V2 promises to help.  
I am not able to reproduce your steps, what am i doing this wrong? besides using a win7 machine most of the links are all about linux. ☹ sorry, probably should get a linux box for this i know.  
but after I was able to get the dfu drivers installed:  
[http://sourceforge.net/projects/libwdi/files/zadig/](http://sourceforge.net/projects/libwdi/files/zadig/)

and the windows DFU loaded.

[http://dfu-util.gnumonks.org/releases/dfu-util-0.6-win32.zip](http://dfu-util.gnumonks.org/releases/dfu-util-0.6-win32.zip)

now the list command sees two “devices”

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”

so I think (cool it’s working) but back up command was not working, mostly I get:

Filter on vendor = 0x1d50 product = 0x607f  
Opening DFU capable USB device… Cannot open device

so I figure what the heck and tried the load command and got this response:

Error: Invalid dfuse address: 0x00020000:leave

hopefully this is a simple noob mistake ,I am trying to follow your directions but not doing so hot. any advice , or link to reading material is appreciated.

---

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [March 18, 2014, 2:33am UTC](https://community.particle.io/t/tutorial-upgrading-factory-reset-firmware/3430/13 "2014-03-18T02:33:41Z")

</div>

Ah… I made the steps as simple as possible to follow. Maybe I should clarify further in the tutorial.

Did you happen to change the driver for spark core to become dfu driver?

You don’t need a linux box for sure. I’m working in windows and will be able to help 🙂

I just did some factory firmware changed for testing last night so shouldn’t be a problem with the tutorial commands

---

<div class="post-metadata">

**Author:** ![Dave](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/dave/32/181_2.png) [@Dave](https://community.particle.io/u/Dave)\
**Post date:** [March 18, 2014, 4:00am UTC](https://community.particle.io/t/tutorial-upgrading-factory-reset-firmware/3430/14 "2014-03-18T04:00:06Z")

</div>

> [@peetersm](#):
>
> [http://dfu-util.gnumonks.org/releases/](http://dfu-util.gnumonks.org/releases/)

Awesome, so close! Grab the 0.7 windows binary here: [http://dfu-util.gnumonks.org/releases/dfu-util-0.7-binaries.7z](http://dfu-util.gnumonks.org/releases/dfu-util-0.7-binaries.7z)

The older versions don't understand the `:leave` syntax on the address.

Thanks!  
David

---

<div class="post-metadata">

**Author:** ![peetersm](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peetersm/32/856_2.png) [@peetersm](https://community.particle.io/u/peetersm)\
**Post date:** [March 18, 2014, 10:05am UTC](https://community.particle.io/t/tutorial-upgrading-factory-reset-firmware/3430/15 "2014-03-18T10:05:31Z")

</div>

@kennethlimcp you know what they say “it’s hard to make things idiot proof since idiots figure out new ways to break things every day.” 🙂  
Since this is my 1st micro controller I did not have any of the prerequisites installed on my machine, this picture might help explicitly point out what a noob should look for. (I think…OR it will help you see something else I have set up wrong)  
 ![](https://sea2.discourse-cdn.com/flex026/uploads/particle/953/8150571677b9468c.jpg)

@Dave, thanks for the link to the utility, now I am getting new results.  
the back up command get farther but as they say “close but no cigar”.

_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=1, name=“UNDEFINED”  
Claiming USB DFU Interface…  
Cannot claim interface_

so who needs a backup anyway…the load command says the same thing.

_T:\SPARK-core\dfu07\>dfu-util -d 1d50:607f -a 1 -s 0x00020000: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](mailto: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=1, name=“UNDEFINED”  
Claiming USB DFU Interface…  
Cannot claim interface  
T:\SPARK-core\dfu07\>_

Should I be getting the 2 devices when I do the list command? does this look right to you?

_T:\SPARK-core\dfu07\>dfu-util -l  
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](mailto: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”_

---

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [March 18, 2014, 10:23am UTC](https://community.particle.io/t/tutorial-upgrading-factory-reset-firmware/3430/16 "2014-03-18T10:23:31Z")

</div>

It’s technically the core but 2 parts:

Internal flash and external flash.

Make sure the .bin files are at the directory where dfu-util.exe is.

`T:\SPARK-core\dfu07` for your case and try again 🙂

---

<div class="post-metadata">

**Author:** ![Dave](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/dave/32/181_2.png) [@Dave](https://community.particle.io/u/Dave)\
**Post date:** [March 18, 2014, 11:43am UTC](https://community.particle.io/t/tutorial-upgrading-factory-reset-firmware/3430/17 "2014-03-18T11:43:05Z")

</div>

Hi @peetersm,

I’m guessing you hit another gotcha on Windows, some operating systems require elevated access to write to devices using something like dfu-util. Try running that process in an Administrator Command Prompt, and maybe that’ll fix it? 😄

Thanks,  
David

---

<div class="post-metadata">

**Author:** ![peetersm](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peetersm/32/856_2.png) [@peetersm](https://community.particle.io/u/peetersm)\
**Post date:** [March 19, 2014, 12:30am UTC](https://community.particle.io/t/tutorial-upgrading-factory-reset-firmware/3430/18 "2014-03-19T00:30:41Z")

</div>

thanks for the continued help. I do have the files in the same directory (thanks for checking), and even when running CMD as admin I am getting the “can not claim interface”.  
I am trying to do some reading seems like this error means dfu might be seeing more than one interface. But not sure since dfu only reports is a single interface:

_T:\SPARK-core\dfu07\>dfu-util.exe -l  
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](mailto: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"  
T:\SPARK-core\dfu07\>_

---

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [March 19, 2014, 12:32am UTC](https://community.particle.io/t/tutorial-upgrading-factory-reset-firmware/3430/19 "2014-03-19T00:32:59Z")

</div>

@peetersm,

It’s right to show up ‘2 devices’ . You can see the `alt=` there’s 0 and 1. Same device (spark core) but 2 alternatives 😄

0 for Internal flash and 1 for External flash.

Got some free time? We can try to fix this over chat and post the solution here 😉

---

<div class="post-metadata">

**Author:** ![peetersm](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peetersm/32/856_2.png) [@peetersm](https://community.particle.io/u/peetersm)\
**Post date:** [March 19, 2014, 1:18am UTC](https://community.particle.io/t/tutorial-upgrading-factory-reset-firmware/3430/20 "2014-03-19T01:18:22Z")

</div>

I am all set up, had the wrong DFU driver. thanks to @kennethlimcp I am now on V2.  
once I got the right version to reinstall the DFU driver for windows  
[http://zadig.akeo.ie/](http://zadig.akeo.ie/)

It was like night and day. thanks again!!!

[Next page](https://community.particle.io/t/tutorial-upgrading-factory-reset-firmware/3430.md?page=2)
