# How does cloud compilation know which firmware version to target?

**URL:** <https://community.particle.io/t/how-does-cloud-compilation-know-which-firmware-version-to-target/13037>\
**Category:** Firmware\
**Created:** [July 7, 2015, 4:18am UTC](https://community.particle.io/t/how-does-cloud-compilation-know-which-firmware-version-to-target/13037 "2015-07-07T04:18:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![loopj](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/loopj/32/4955_2.png) [@loopj](https://community.particle.io/u/loopj)\
**Post date:** [July 7, 2015, 4:18am UTC](https://community.particle.io/t/how-does-cloud-compilation-know-which-firmware-version-to-target/13037/1 "2015-07-07T04:18:34Z")

</div>

Hey there,

As far as I understand, on the Photon you must build user apps using the same version as the base firmware. If I’ve flashed my Photon to firmware 0.4.2 does that mean that cloud compilation somehow knows it should build my app for version 0.4.2 too?

I was wondering if/how `particle compile` knows which firmware version to compile for?

---

<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:** [July 7, 2015, 4:46am UTC](https://community.particle.io/t/how-does-cloud-compilation-know-which-firmware-version-to-target/13037/2 "2015-07-07T04:46:19Z")

</div>

There are 4 modules i would say:

- bootloader
- system part 1
- system part 2
- user firmware

The system version is bumped when a new firmware version is tagged and used for the build farm.  
eg. [https://github.com/spark/firmware/commit/cea8421fbb5ebffe50c319d0702a7299a8146ec3](https://github.com/spark/firmware/commit/cea8421fbb5ebffe50c319d0702a7299a8146ec3)

Not 100% sure about how which system version depends on which but some information here:

> **[particle-iot/firmware](https://github.com/particle-iot/firmware/wiki/Module-descriptor-format)**
>
> firmware - Device OS (Firmware) for Particle Devices

---

<div class="post-metadata">

**Author:** ![loopj](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/loopj/32/4955_2.png) [@loopj](https://community.particle.io/u/loopj)\
**Post date:** [July 7, 2015, 10:22pm UTC](https://community.particle.io/t/how-does-cloud-compilation-know-which-firmware-version-to-target/13037/3 "2015-07-07T22:22:13Z")

</div>

Thanks @kennethlimcp this is helpful!

My main question is, how does “cloud compiled” user firmware (via `particle compile`) know which firmware version to target, and is this configurable.

---

<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:** [July 8, 2015, 12:09am UTC](https://community.particle.io/t/how-does-cloud-compilation-know-which-firmware-version-to-target/13037/5 "2015-07-08T00:09:43Z")

</div>

It is based on the latest tagged release. Eg. right now the core is on 0.3.4 and the Photon is on 0.4.1.

This is handled by the ☁ though there’s some params you can change but might not be working since it’s not an official feature - [https://github.com/spark/particle-cli/blob/master/lib/ApiClient.js#L476](https://github.com/spark/particle-cli/blob/master/lib/ApiClient.js#L476)

---

<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:** [July 11, 2015, 5:11am UTC](https://community.particle.io/t/how-does-cloud-compilation-know-which-firmware-version-to-target/13037/6 "2015-07-11T05:11:56Z")

</div>

System version updates are intended to be backwards compatible, so it’s fine (and expected) to update system firmware from (say) 0.4.0 to 0.4.2 while still compiling/running application firmware built from 0.4.0.

The application code is dynamically linked to the system code, which provides flexibility, allowing newer versions of the system firmware to be installed against an older application image.

---

<div class="post-metadata">

**Author:** ![loopj](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/loopj/32/4955_2.png) [@loopj](https://community.particle.io/u/loopj)\
**Post date:** [July 11, 2015, 11:39pm UTC](https://community.particle.io/t/how-does-cloud-compilation-know-which-firmware-version-to-target/13037/7 "2015-07-11T23:39:11Z")

</div>

Thanks @mdma, this is exactly the information I was looking for!

It sounds like if I update my firmware to 0.4.2, I should be able to run application firmware built on the particle cloud even if it is built for 0.4.0.

---

<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:** [July 12, 2015, 3:35pm UTC](https://community.particle.io/t/how-does-cloud-compilation-know-which-firmware-version-to-target/13037/8 "2015-07-12T15:35:47Z")

</div>

> [@loopj](#):
>
> It sounds like if I update my firmware to 0.4.2, I should be able to run application firmware built on the particle cloud even if it is built for 0.4.0.

Yes, that's the intent!
