Slow Firmware Updates and Threading

If I enable threading I experience very slow firmware updates using the Web IDE. Typically updates are loaded into the device rather quickly as indicated by the rapid flashing magenta indicator. Perhaps less than a second. However, I am seeing a slow flash and 10-15 second update times.

I could not find any reference to this issue specifically. Is this a known side effect of enabling threading?

@superpanda, if your app is putting a heavy load on the processor, it could slow things down. Do you have anything in your code blocking interrupts?

I actually just tried this with an empty project and just enabling the threading caused this. I have also reproduced on Photon and Duo.

@superpanda, which version of system firmware are your running?

0.6.3 on Photon and 0.3.1 on the Duo.

Here is a simple example below. Add some dummy const data so the firmware load is a bit longer so you can see the effect. I did not show that here so as to not clog the post up with lots of data:


const data[] = "Add lots of data here to exaggerate the slow load....";

void setup() {


void loop() {


@superpanda, are you compiling to the same firmware version on the IDE before flashing?

I suppose so. Not super familiar with how the Web IDE works, but it compiles then flashes. The firmware versions for each device indicated earlier are what is selected. I may not understand your question.

@superpanda, if you compile with a newer version of system firmware specified then the device will “auto heal” by downloading the newer version of system firmware along with your app. This will cause the device to take more time to update. However, this should only happen once.

As for setting the firmware version, look here:


Yes, I am compiling to the same firmware that is on the device. I do not believe this is because of a new system firmware being applied. I can see the volume of data in the debug data (using Log Handler) and it is not very much. And again…just disabling threading makes this slow load disappear.

I can make this happen out of the box. Can you not see this?

@superpanda, I have not specifically tested but I will later tonight. @rickkas7, any thoughts?

I had a similar issue previously. I’m not sure if it’s the same but it’s because delay in my loop was too short with threading enabled. Not sure if this Is the same for U.

What kind of delay did you add to loop? I tried 100ms up to 1 second and it did not seem to have an effect.