Particle dev keeps recompiling the same code

I just started with the particle dev. as I modify my code and save it i realized that the same code is getting uploaded to my photon, none of the new changes are being registered even though I save after each modification. I am saving the file with “.ino” extension. am i missing something?

You’ve selected the device you want to use (bottom icon in the picture below, or Select Device from the menu) and are using the compile in cloud and upload code using cloud icon (top icon, or Compile In Cloud menu), right? Just saving saves the source code changes to a file on your computer; it doesn’t compile it and upload it to your device.

i did all of them, but i just used the “flash” icon for compiling and uploading, I just noticed that if I click the “cloud” icon first and then the “flash” icon it works but just clicking the “flash” icon does not!! isn’t the “flash” supposed to compile and upgrade together!!

Yes, the flash icon should do both. Strange!

Also, when i open another code I can’t run it. it keeps compiling and uploading the older coded (which is open in another tab). I know that I shouldn’t use folders withing the same project but this is a code form a different project. how do I make it compile this new code?

I believe you need to use the New Window menu option, not just another tab. Dev doesn’t build the tab you have open, it builds all of the files in the directory in the center column, which is typically the directory the file in the leftmost tab is contained in. It can be quite confusing.

1 Like

ah ok this one makes sense.
but i still have the other issue: I have to hit the cloud button first and then the flash button! the flash on its own just uploads the old binary!!!
i tried restarting my PC and made sure i have the latest version!

I could be mistaken, but that might be expected behavior. The compile button compiles the code, and the flash button flashes it. If the flash button would do both, what’s the point of having the compile button? Similarly, one compiled binary can be flashed to many devices. No need to recompile that every time.
So I’d say compiling and flashing would need to be done separately. But then again, we might as well ask @suda, since he built the thing…

i agree except for the tool-tip on both of them say “compile in the cloud”!! it is a little confusing!

For me it does build and flash in one go (Update: see below).
What version and OS are you using?
Do you see the swirling donut in the status bar at the bottom?
Do you get any messages after hitting flash?
Can you provide a screenshot before and after flash attempt (make sure all filenames are fully visible)?

I have the same issue with the Lighning icon. Tooltip says compile and flash but it only flashes. I think is good that there is 2 buttons separately compile and the compile + flash since you don’t want to flash when you try if your code just works since the flash operation takes longer than only compile…

My particle DEV version is 1.5.1

OK, I now see the problem too.
From the olden times of Dev I got used to removing the binaries from my project folder after flashing (to keep them “safe” somewhere else). So if there is no binary present already the flash button will build one, but if there is, it won’t.

So you could either manually delete the file or we could forward a request to @suda to add some way to have the option (possibility to tick/untick) to auto-delete on flash.

1 Like

There was some discussion about this behaviour in GitHub repo. Applying changes mentioned there and making labels more verbose (i.e. “Flash existing binary (compile new one if missing)”) should make it clearer.

i see, that makes sense now. thank you

In the Settings of Atom-Package “Spark Dev” you can select to "Delete Firmware after Flash"
Then the next press on Flash will compile and flash and then delete the File :wink:

so the next press will compile again.


1 Like

i checked and i already had this option selected! but the file does not get deleted after the flash!!

I found that if I put the photon into safe mode it always builds and flashes the code if changed. For me my natural inclination is to expect “make” like behavior - i.e. hitting flash does whatever is needed to put the latest into whatever target.

Before 1.5.1 it was working this way. Now flash button flashes only, if it finds an image already compiled, so I got the habit to press both buttons in sequence. Maybe flash button now has an erratic behavior, because there is already an option to flash only without compile: you can right click on the image file in left pane and it flashes on the fly.

1 Like