How does cloud compilation know which firmware version to target?

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?

1 Like

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

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

1 Like

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.

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 :cloud: 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

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.

2 Likes

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.

Yes, that’s the intent!

2 Likes