# Can't locally compile Firmware for Electron \[SOLVED: different dfu address\]

**URL:** <https://community.particle.io/t/cant-locally-compile-firmware-for-electron-solved-different-dfu-address/22740>\
**Category:** Firmware\
**Created:** [May 7, 2016, 12:27pm UTC](https://community.particle.io/t/cant-locally-compile-firmware-for-electron-solved-different-dfu-address/22740 "2016-05-07T12:27:43Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![nrobinson2000](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/nrobinson2000/32/15624_2.png) [@nrobinson2000](https://community.particle.io/u/nrobinson2000)\
**Post date:** [May 7, 2016, 12:27pm UTC](https://community.particle.io/t/cant-locally-compile-firmware-for-electron-solved-different-dfu-address/22740/1 "2016-05-07T12:27:43Z")

</div>

Hi guys,

I am trying to compile firmware for Electron. My problem is that even though my code compiles successfully, and is flashed to my Electron with dfu-util successfully, it is not evident that the code has been updated.

Here is an example of how I am compiling my firmware. ([This happens inside of my script.](https://github.com/nrobinson2000/po-util)):

```auto
make all -s -C github/firmware APPDIR="$HOME/electron-project/firmware" TARGET_DIR="$HOME/electron-project/bin" PLATFORM="electron"

```

I then upload my code with dfu-util:

```auto
dfu-util -d 2b04:d006 -a 0 -i 0 -s 0x080A0000:leave -D "$CWD/bin/firmware.bin"

```

Code flashes successfully…  
Electron reboots…

But firmware on device has not changed.

Why is this happening? I have tried compiling on `latest` and `develop` and I get the same issue.

If I compile my firmware in the cloud and then flash with dfu-util it works fine.

```auto
particle compile electron firmware/

```

---

<div class="post-metadata">

**Author:** ![bko](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bko/32/20704_2.png) [@bko](https://community.particle.io/u/bko)\
**Post date:** [May 7, 2016, 3:45pm UTC](https://community.particle.io/t/cant-locally-compile-firmware-for-electron-solved-different-dfu-address/22740/2 "2016-05-07T15:45:21Z")

</div>

Hi @nrobinson2000

This can happen when the version of the system firmware (parts 1 & 2) does not agree with the version required by the app you are compiling for the user firmware.

If you put the device in listening mode and type “v” you can see the system version.

[https://docs.particle.io/support/troubleshooting/troubleshooting-tools/electron/#display-system-firmware-version](https://docs.particle.io/support/troubleshooting/troubleshooting-tools/electron/#display-system-firmware-version)

Once you are compiling locally, as you are, you can just build system parts 1 and 2 and flash them as well.

---

<div class="post-metadata">

**Author:** ![nrobinson2000](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/nrobinson2000/32/15624_2.png) [@nrobinson2000](https://community.particle.io/u/nrobinson2000)\
**Post date:** [May 7, 2016, 3:58pm UTC](https://community.particle.io/t/cant-locally-compile-firmware-for-electron-solved-different-dfu-address/22740/3 "2016-05-07T15:58:52Z")

</div>

Hi @bko  
I just tried that. Got

```auto
system firmware version: 0.5.0

```

Should I be using a branch other than `latest`?

---

<div class="post-metadata">

**Author:** ![nrobinson2000](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/nrobinson2000/32/15624_2.png) [@nrobinson2000](https://community.particle.io/u/nrobinson2000)\
**Post date:** [May 7, 2016, 4:10pm UTC](https://community.particle.io/t/cant-locally-compile-firmware-for-electron-solved-different-dfu-address/22740/4 "2016-05-07T16:10:08Z")

</div>

I just tried recompiling and flashing parts 1 and 2 on the `release/v0.5.0` branch, but I am still experiencing this issue.

---

<div class="post-metadata">

**Author:** ![bko](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bko/32/20704_2.png) [@bko](https://community.particle.io/u/bko)\
**Post date:** [May 7, 2016, 4:13pm UTC](https://community.particle.io/t/cant-locally-compile-firmware-for-electron-solved-different-dfu-address/22740/5 "2016-05-07T16:13:01Z")

</div>

No latest should correspond to 0.5.0 right now (but develop is ahead).

Are you sure you dfu-util address range is correct? That looks like the address for the Photon app area but I think Electron is different (and I see that doc section is blank for Electron!).

I don’t have an Electron handy to test right now but I would run the CLI command and pay attention to the exact dfu-util command to be sure.

---

<div class="post-metadata">

**Author:** ![nrobinson2000](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/nrobinson2000/32/15624_2.png) [@nrobinson2000](https://community.particle.io/u/nrobinson2000)\
**Post date:** [May 7, 2016, 4:19pm UTC](https://community.particle.io/t/cant-locally-compile-firmware-for-electron-solved-different-dfu-address/22740/6 "2016-05-07T16:19:32Z")

</div>

I just tried `particle flash --usb bin/firmware.bin`  
It turns out that it does use a different dfu address for an Electron.

```auto
spawning dfu-util -d 2b04:d00a -a 0 -i 0 -s 0x08080000:leave -D bin/firmware.bin

```

**2b04:d00a**

It works now.

UPDATE: [Updated my script with this fix](https://github.com/nrobinson2000/po-util/commit/8b0b25fae2aeb4cb4943cb531575b4766c968c3f)

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [May 7, 2016, 8:18pm UTC](https://community.particle.io/t/cant-locally-compile-firmware-for-electron-solved-different-dfu-address/22740/7 "2016-05-07T20:18:17Z")

</div>

BTW, if you build a develop branch you’d need to add `PARTICLE_DEVELOP=1`

---

<div class="post-metadata">

**Author:** ![nrobinson2000](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/nrobinson2000/32/15624_2.png) [@nrobinson2000](https://community.particle.io/u/nrobinson2000)\
**Post date:** [May 7, 2016, 9:18pm UTC](https://community.particle.io/t/cant-locally-compile-firmware-for-electron-solved-different-dfu-address/22740/8 "2016-05-07T21:18:16Z")

</div>

> [@ScruffR](#):
>
> BTW, if you build a develop branch you'd need to add PARTICLE\_DEVELOP=1

Yeah, I read this in the firmware documentation.

---

<div class="post-metadata">

**Author:** ![bko](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bko/32/20704_2.png) [@bko](https://community.particle.io/u/bko)\
**Post date:** [May 8, 2016, 2:18pm UTC](https://community.particle.io/t/cant-locally-compile-firmware-for-electron-solved-different-dfu-address/22740/9 "2016-05-08T14:18:55Z")

</div>

Hi @nrobinson2000

I wanted to point out that there is a make target `program-dfu` that does everything you want.

`make clean all program-dfu ...`

---

<div class="post-metadata">

**Author:** ![nrobinson2000](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/nrobinson2000/32/15624_2.png) [@nrobinson2000](https://community.particle.io/u/nrobinson2000)\
**Post date:** [May 8, 2016, 2:53pm UTC](https://community.particle.io/t/cant-locally-compile-firmware-for-electron-solved-different-dfu-address/22740/10 "2016-05-08T14:53:50Z")

</div>

Thanks. I read this in the documentation and I use it in my script for recompiling the system firmware. When compiling the user firmware I prefer using my own method.

---

<div class="post-metadata">

**Author:** ![rickkas7](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/rickkas7/32/8681_2.png) [@rickkas7](https://community.particle.io/u/rickkas7)\
**Post date:** [May 8, 2016, 3:29pm UTC](https://community.particle.io/t/cant-locally-compile-firmware-for-electron-solved-different-dfu-address/22740/11 "2016-05-08T15:29:36Z")

</div>

If you’re only rebuilding your own user app firmware, and you have previously built all, you can save a significant amount of build time by building from the firmware/main directory. You use the same make options as normal, and you can either flash the resulting binary or use the program-dfu make option.
