What firmware version does CLI compile use?

Hi

When building in the online IDE I can select the firmware version I would like to build with in the dropdown:

When I do a CLI compile like

particle compile photon my_project_folder --saveTo firmware.bin

Which firmware version is used?
Can I also somehow select the firmware version for the CLI compile?

Thanks

Currently CLI builds by default for the ā€œlatestā€ firmware (0.4.6 at the moment).

A way to target a specific firmware version is planned, but no ETA so far.

1 Like

@ScruffR Thank you for the clarifications.

1 Like

Good to know!

Would be useful to me now. I am experiencing (apparently) random resets of my Photon, seemingly associated with wifi connection loss (green flashing). I am wondering if compiling with 0.4.5 would resolve my issue, as other threads suggest. However none of my code is currently uploaded to the web IDE.

In this case you might like to hear that we should be seeing 0.4.7 today (if everything goes to plan ;-))
This should solve especially some connection issues.

Hi,

I see that 0.4.7 did indeed get released ;-)) - and looks like having some nice features.

I am using Devā€¦

Built a simple app and tried to download - the Photon went to ā€˜breathing magentaā€™. So - as I have no idea how long this would take, I went ahead and downloaded the 0.4.7 bin, then installed them :-

particle flash --usb system-part1-0.4.7-photon.bin
particle flash --usb system-part2-0.4.7-photon.bin

All seemed to go fine, and the box was again ā€˜breathing cyanā€™ā€¦

Rebuilt my code and downloaded again (using Dev), and it starts ā€˜breathing magentaā€™ all over again.

SO - reverted to 0.4.6
particle flash --usb system-part1-0.4.6-photon.bin
particle flash --usb system-part2-0.4.6-photon.bin

and repeated the exercise - and we get magenta again - which is to be expected if we just built with 0.4.7 (as there seems no way to specify a version in Dev - NB I even went to Build and changed to 0.4.6 there = no change.

So - repeat the process - load up 0.4.7
Rebuild code again and try to upload itā€¦and weā€™re ā€˜breathing magentaā€™ again :open_mouth:

So I am left not knowing what to do to get rid of this ā€˜breathing magentaā€™ - once againā€¦

Guess Iā€™ll leave it doing its thing and grab some lunch (yup I am on UK time ;-). Lets see what we get in half an hour or so :-O.

I had hoped that this version would eliminate these upgrade issues !!.

Can someone please enlighten me as to what I am doing wrong - or not doing ???.

BR
Graham

Breathing magenta can also mean that a binary was flashed thatā€™s for a different device or was somehow corrupted.

So, be sure that your device is recognized as a Photon and that itā€™s selected in Dev.

Hi,

Yup it was selected in Dev, I did load the photon code - and here we are 45+ minutes and still ā€˜breathing magentaā€™ :frowning:

Incidentally - Dev tells me its ā€˜breathing cyanā€™ but not sure I have ever seen magenta in Devā€¦

From CLI particle list
NSL2 [xxxxx] (Photon) is online

So - any guide as to how long I leave it breathing magenta ??? - as I have seen it do this for ages previously :-O. I usually give up and flash from the binā€¦

Sorry but this is too much of a black art - its doing something but I have no way of identifying what :(( - so all I have is guessworkā€¦

NB I am VERY worried about what my product will do ā€˜in the fieldā€™. I have one currently running in the US (5000 miles away), and I will NEED to update it soon - but I dare not as I canā€™t quite reach the OFF button (from the UK) :wink:

I do hope that someone can shed some light on this pleaseā€¦

Magenta for almost an hour now I have done typing thisā€¦

BR
Graham

OK so I just downloaded the bins again from GitHub and did a file compare (I use Notepad++) and they are identical, so maybe the bins are different between OTA and github ???.

G

Going forward, we will have the infrastructure to automatically update the device to the correct system firmware. Currently this process is only triggered from Build (WebIDE) - the new services will trigger this everywhere, plus provide more transparency and control.

OK that partially answers one question - BUTā€¦

If I locally flash my Photon - why then can I still not compile and upload my code to it ???.

Incidentally - I also tried a local USB flash of a bin built (I think) for 0.4.6, and it immediately breathes magenta.

I also then tried webIDE to build for 0.4.6 (your own Blink an LED app) and that wonā€™t even build when selecting 0.4.6 :open_mouth: - I get an error 500.

Soā€¦

What is the real recommended approach when a new firmware is released, OR an app has to be rebuilt ??? - cos I am totally confused nowā€¦

BR
Graham

OK so I assume then that your compile server is down ???.

Flashed my photon to 0.4.7

Went to web build ensured my device was still selected, AND that it would build against 0.4.7.

Opened up Blink an LED

There is no ā€˜compileā€™ option ??? - )its greyed out). BUT Flash is not - but gives the error 500 whenever I try it.

BR
Graham

Just a side note here.
AFAIK if you intend to downgrade to a previous version you'd need to do it in reverse order (first part2 then part 1).
The fact that you did it the other way round might contribute to the pickle you're in now.

Again AFAIK after flashing the upgrade parts 1 and 2, it's normal to breathe magenta till you actually also flash compatible application firmware, which I haven't read you doing in your initial post about 0.4.7.

And again AFAIK Particle Dev builds application firmware against the latest firmware (for the time being) but does not trigger an auto-update, hence your initial magenta (0.4.7 app FW trying to run on 0.4.6 system FW).

So despite you might well be sick of doing it over and over again try to flash Blinky (0.4.7) from Web IDE/Particle Build and check if you only get the fast flash magenta flash - indicating 0.4.7 already present - or if you see the three/four phase magenta-reboot-magenta (give it good 15min) and see if Blinky works.

BTW: When trying to build/flash Blinky from Web IDE you first need to press Fork this Example before you get the save/build buttons enabled.

Hi,

OK so that is now completely different ;-)) - AND has worked.

So - I guess that the server issues have been fixed then ;-)).

When I went back to the web IDE - the ā€˜Verifyā€™ button was now available (wasnā€™t earlier) and pressing Flash has a completely new feel :-O.

It now did indeed FLASH the leds (magenta) as opposed to ā€˜breatheā€™, so it became apparent that it was indeed being updated (or seemed to be) over the web :-)).

Blinky is now running, so I will go back to my Dev and see if I can now build from there.

Many thanks to those who got the server sorted ;-)).

BR
Graham

Thanks for brining these issues to our attention, and please understand that we are continually working to improve the experience, particularly with upgrading firmware.

Hi,

Oops just found this reply unsent :-O.

Whooopeee !!!. I can build again from Dev, AND get it to report 0.4.7 to the serial port ;-)).

Sorry but I DO need to point out an error in your doc though -

Serial.printlnf(ā€œVersion: %sā€, System.version());

Throws a compiler error - as you cannot pass a String into prinf !! - or sprintf or printlnf (all the same really).

Look forward to future features to make upgrades more seamless ;-)).

NB I use Dev as my primary compile interface, but then have to use CLI if I want to grab (and archive etc.) the bin files produced. Maybe Dev could include grabbing the bin - then archiving would be simpler and NOT need a further rebuild (ie call compile from CLI).

Keep up the great work though !!!

BR
Graham

AFAIK the bin file gets downloaded into your project folder anyhow.
Only when you build again the old bin gets deleted automatically.

This was noted already and will get corrected. To pass a String object to format string functions you'd use one of these

  Serial.printlnf("Version: %s", System.version().c_str());
  Serial.printlnf("Version: %s", (const char*)System.version());

Hi there,

Are there any updates concerning compiling using the cloud?

@mdma, is there already a way to tell CLI to compile with certain firmware? Iā€™m programming my electron with Particle Dev and using CAN functionality. However, in the current standard firmware (0.4.8) CAN isnā€™t enabled yet. Can I instruct CLI to use the latest firmware?

Thanks a lot!

You can add a --target parameter, e.g.

particle compile electron . --target 0.5.0-rc.1
1 Like