# Build firmware for Photon

**URL:** https://community.particle.io/t/build-firmware-for-photon/17497
**Category:** Firmware
**Created:** [November 16, 2015, 1:24pm UTC](https://community.particle.io/t/build-firmware-for-photon/17497 "2015-11-16T13:24:27Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![dhaval](https://avatars.discourse-cdn.com/v4/letter/d/85e7bf/32.png) [@dhaval](https://community.particle.io/u/dhaval)
#### Post date: [November 16, 2015, 1:24pm UTC](https://community.particle.io/t/build-firmware-for-photon/17497/1 "2015-11-16T13:24:27Z")

</div>

Hi,

I am trying to build the Firmware for Photon. For that I cloned core-firmware, core-communication-lib and core-common-lib repositories. I also downloaded and install/setup ‘make’ and GNU toolchain for Windows7 . Then I go to core-firmware/build directory and run make command. But it is giving me following error:

make: \*\*\* No targets specified and no makefile found. Stop.

This error seems obvious as there is not Makefile present in that directory. Please note, I got this direction from some document. Then I go to the core-firmware/main directory and run ‘make clean all PLATFORM=photon’, but I am getting following error:

make -C …/modules/photon/user-part clean  
make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x4227d3)  
make: \*\*\* [clean\_modules/photon/user-part] Error 255

Can someone please help me to resolve this?

Thanks,  
Dhaval

---

<div class="post-metadata">

### Author: ![Moors7](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/moors7/32/588_2.png) [@Moors7](https://community.particle.io/u/Moors7)
#### Post date: [November 16, 2015, 2:07pm UTC](https://community.particle.io/t/build-firmware-for-photon/17497/2 "2015-11-16T14:07:57Z")

</div>

Have you seen/used these instructions?

> <https://github.com/particle-iot/firmware/blob/develop/docs/gettingstarted.md>

---

<div class="post-metadata">

### Author: ![peekay123](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peekay123/32/810_2.png) [@peekay123](https://community.particle.io/u/peekay123)
#### Post date: [November 16, 2015, 2:15pm UTC](https://community.particle.io/t/build-firmware-for-photon/17497/3 "2015-11-16T14:15:15Z")

</div>

@dhaval, for the Photon, you need to clone the `develop` branch and make sure you have the entire toolchain installed. The Photon firmware is comprised of a system firmware part and a user firmware part. To compile the system firmware go to the `modules` directory and make from there. For example, to compile the latest develop firmware and flash it to a Photon via DFU:

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

```

This assumes you have a Photon connected via USB and in DFU mode (flashing yello).

To compile your app, you will find a `user\application` directory (under the main firmware directory). There you can create a directory and put all the files you want to compile (including libraries, etc) into that directory (no sub-directories). Then to make and flash your code to a Photon in DFU mode:

```auto
make clean all PARTICLE_DEVELOP=1 PLATFORM=photon program-dfu APP=appname

```

where `appname` is the name of the directory where you placed your files to compile.

😄

---

<div class="post-metadata">

### Author: ![dhaval](https://avatars.discourse-cdn.com/v4/letter/d/85e7bf/32.png) [@dhaval](https://community.particle.io/u/dhaval)
#### Post date: [November 17, 2015, 4:48am UTC](https://community.particle.io/t/build-firmware-for-photon/17497/4 "2015-11-17T04:48:57Z")

</div>

Hi @Moors7

Yes I followed from that getting started document. And I got those error after that only.

Thanks,  
Dhaval

---

<div class="post-metadata">

### Author: ![dhaval](https://avatars.discourse-cdn.com/v4/letter/d/85e7bf/32.png) [@dhaval](https://community.particle.io/u/dhaval)
#### Post date: [November 17, 2015, 4:51am UTC](https://community.particle.io/t/build-firmware-for-photon/17497/5 "2015-11-17T04:51:32Z")

</div>

Hi @peekay123

I have tried to build the firmware as you have mentioned:

git checkout develop  
make clean all PARTICLE\_DEVELOP=1 PLATFORM=photon

But still it is giving the same error:  
make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x4227d3)

Thanks,  
Dhaval

---

<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: [November 17, 2015, 8:52am UTC](https://community.particle.io/t/build-firmware-for-photon/17497/6 "2015-11-17T08:52:38Z")

</div>

> [@peekay123](#):
>
> To compile the system firmware go to the modules directory and make from there.  
> ...  
> To compile your app, you will find a user\application directory (under the main firmware directory)

I can't see this in your procedure

> [@dhaval](#):
>
> git checkout develop  
> make clean all PARTICLE\_DEVELOP=1 PLATFORM=photon

As Paul said, you'd need to `cd` into the required directory before calling `make`

And in the Photon develop branch there should not be a `core-firmware/main`.

---

<div class="post-metadata">

### Author: ![dhaval](https://avatars.discourse-cdn.com/v4/letter/d/85e7bf/32.png) [@dhaval](https://community.particle.io/u/dhaval)
#### Post date: [November 17, 2015, 9:03am UTC](https://community.particle.io/t/build-firmware-for-photon/17497/7 "2015-11-17T09:03:10Z")

</div>

@ScruffR Thanks for you quick reply!

I got it… I want to build the firmware for Photon hardware, not for the CORE. I download checkout the firmware from ‘[https://github.com/spark/core-firmware.git](https://github.com/spark/core-firmware.git)’. Is it correct?

I want to trace the function call for analogRead() in this firmware. Can you please help me on that?

Thanks,  
Dhaval

---

<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: [November 17, 2015, 9:15am UTC](https://community.particle.io/t/build-firmware-for-photon/17497/8 "2015-11-17T09:15:34Z")

</div>

I’d still go with the develop branch but build from `main` with e.g. `make clean all PARTICLE_DEVELOP=1 PLATFORM=core APP=tinker` (for Tinker).

---

<div class="post-metadata">

### Author: ![dhaval](https://avatars.discourse-cdn.com/v4/letter/d/85e7bf/32.png) [@dhaval](https://community.particle.io/u/dhaval)
#### Post date: [November 20, 2015, 8:22am UTC](https://community.particle.io/t/build-firmware-for-photon/17497/9 "2015-11-20T08:22:46Z")

</div>

Thanks for your support @Moors7, @peekay123, @ScruffR… I am able to build the firmware on Linux machine.

But still I am not able to build it on Windows system… Getting same error.

---

<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: [November 20, 2015, 8:34am UTC](https://community.particle.io/t/build-firmware-for-photon/17497/10 "2015-11-20T08:34:00Z")

</div>

Do you get any other error or like something about `stat.exe` failing?  
I had this once (or still have it, if I use a wrong CMD instance) and it was a problem with the PATH.

Have a look at your PATH if something looks fishy (e.g. double entries).  
You could also try [this installer](https://community.particle.io/t/toolchain-for-windows-installer/13217) (maybe after you removed any previous toolchain - including PATH entries)
