# Local build of Photon firmware freezes

**URL:** <https://community.particle.io/t/local-build-of-photon-firmware-freezes/19822>\
**Category:** Troubleshooting\
**Created:** [February 6, 2016, 5:24pm UTC](https://community.particle.io/t/local-build-of-photon-firmware-freezes/19822 "2016-02-06T17:24:36Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![UMBrew](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UMBrew](https://community.particle.io/u/UMBrew)\
**Post date:** [February 6, 2016, 5:24pm UTC](https://community.particle.io/t/local-build-of-photon-firmware-freezes/19822/1 "2016-02-06T17:24:36Z")

</div>

I'm having issues getting the photon firmware to compile. It's worked in the past but it's been a few months since I last tried. Compiling from the module folder never finishes (I let it run all last night).

It seems to lock up the first time it runs the ARM GCC Archiver:

 ![](https://us1.discourse-cdn.com/flex026/uploads/particle/original/2X/d/d946d9810231bb5360ca8d2b32e5540f68fe46b7.JPG)

This morning I tried figuring out if anything in my tool chain had inadvertently changed.

Checked my toolchain (Tried reinstalling MinGW)

> [@\[Toolchain\] Windows](https://community.particle.io/t/toolchain-windows/11635):
>
> Tested on Windows XP Mingw [http://sourceforge.net/projects/mingw/](http://sourceforge.net/projects/mingw/) mark mingw32-base and mingw32-gcc-g++ and msys-make and mingw-developer-toolkit close the installer and they will prompt for installation [image] GNUmake [http://sourceforge.net/projects/gnuwin32](http://sourceforge.net/projects/gnuwin32) Be sure to add to path as well: gcc-arm-none-eabi [https://launchpad.net/gcc-arm-embedded/+download](https://launchpad.net/gcc-arm-embedded/+download) be sure to tick the Add to path Path setting Your PATH variable in Windows should look like: xxxxxxx;C:\Program File…

Checked my path (Highest first)

```
C:\utilities\GNU Tools ARM Embedded\4.9 2015q2\bin;C:\MinGW\bin;C:\utilities\GnuWin32\bin;C:\MinGW\msys\1.0\bin;

```

Started with a fresh repository and checkout of develop branch

```
git clone https://github.com/spark/firmware.git
cd firmware
git checkout develop

```

Then a build from the modules folder

```
cd modules
make clean all PLATFORM=photon program-dfu

```

Anyone ever seen this or have any suggestions on what to check?

---

<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:** [February 6, 2016, 5:55pm UTC](https://community.particle.io/t/local-build-of-photon-firmware-freezes/19822/2 "2016-02-06T17:55:54Z")

</div>

If you want to build the _develop_ branch you’d need to write this

```nohighlight
make clean all PLATFORM=photon PARTICLE_DEVELOP=1 program-dfu

```

The thing with _develop_ is that it’s not guarantied to fully work at any given time. By setting the above switch you acknowledge to be aware of this.  
Maybe you do another `git pull` and retry, or if you don’t need _develop_ try `git checkout latest` which is guarantied to work.

---

<div class="post-metadata">

**Author:** ![UMBrew](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UMBrew](https://community.particle.io/u/UMBrew)\
**Post date:** [February 6, 2016, 6:46pm UTC](https://community.particle.io/t/local-build-of-photon-firmware-freezes/19822/3 "2016-02-06T18:46:57Z")

</div>

@ScruffR, Thanks for the advice on using _latest_. It builds without a problem, didn’t even think about trying that. 😛

I also have _PARTICLE\_DEVELOP_ as an environment variable but tried running the full command just to make sure it was pulling it in. Develop branch still doesn’t build. Don’t know why it doesn’t throw an error and just hangs.

---

<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:** [February 6, 2016, 6:49pm UTC](https://community.particle.io/t/local-build-of-photon-firmware-freezes/19822/4 "2016-02-06T18:49:45Z")

</div>

I’ll have to have a try too - I pulled develop just yesterday and it built fine.

_Update:_  
For me it builds just fine (although I’ve left out `program-dfu` which makes no difference for the build anyway)

---

<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:** [February 6, 2016, 11:44pm UTC](https://community.particle.io/t/local-build-of-photon-firmware-freezes/19822/5 "2016-02-06T23:44:11Z")

</div>

Try compiling in the folder named `main`

---

<div class="post-metadata">

**Author:** ![UMBrew](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UMBrew](https://community.particle.io/u/UMBrew)\
**Post date:** [February 7, 2016, 2:17am UTC](https://community.particle.io/t/local-build-of-photon-firmware-freezes/19822/6 "2016-02-07T02:17:17Z")

</div>

@kennethlimcp, tried in `main` and still won’t compile. _latest_ compiles from main but _develop_ does not.

Gets stuck at:

```
Building target: ../build/target/user/platform-6-m/src/libuser.a
Invoking: ARM GCC Archiver
mkdir -p ../build/target/user/platform-6-m/src/
arm-none-eabi-gcc-ar -cr ../build/target/user/platform-6-m/src/libuser.a ../build/target/user/platform-6-m/src/src/application.o

```

Kinda strange. I’m good just working off _latest_ now but it would be nice to figure out what changed.

---

<div class="post-metadata">

**Author:** ![UMBrew](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UMBrew](https://community.particle.io/u/UMBrew)\
**Post date:** [February 7, 2016, 2:21am UTC](https://community.particle.io/t/local-build-of-photon-firmware-freezes/19822/7 "2016-02-07T02:21:03Z")

</div>

Started digging into it: Looks like build tools have changed in _develop_ vs _latest_

> **[particle-iot/device-os](https://github.com/particle-iot/device-os/compare/latest...develop)**
>
> Device OS (Firmware) for Particle Devices. Contribute to particle-iot/device-os development by creating an account on GitHub.

 ![](https://us1.discourse-cdn.com/flex026/uploads/particle/original/2X/b/b67f9ff33c3f784a5ab344e54eab91b6bfc795fc.JPG)

This may be changing what archiver it is pointing to. I’ll keep digging and update soon.

_ **UPDATE** _  
Compiles just fine if the only thing I change in the develop branch is from:

```
AR = $(GCC_ARM_PATH)$(GCC_PREFIX)gcc-ar

```

back to:

```
AR = $(GCC_ARM_PATH)$(GCC_PREFIX)ar

```

Assuming this changes from pointing from _arm-none-eabi-ar.exe_ to _arm-none-eabi-gcc-ar.exe_ but other than that I don’t know why it fixes it.

---

<div class="post-metadata">

**Author:** ![mdma](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mdma/32/1924_2.png) [@mdma](https://community.particle.io/u/mdma)\
**Post date:** [February 7, 2016, 3:15am UTC](https://community.particle.io/t/local-build-of-photon-firmware-freezes/19822/8 "2016-02-07T03:15:27Z")

</div>

You beat me to it! I was going to suggest that change - it’s there to support ARM GCC 5.2.1. I’ll double check with the developer to find out why the change was needed and if we can find an alternative solution that doesn’t use gcc-ar.
