User thread and os timer freeze,Photon System Firmware 0.5.4

issue:
1.keep 6 devices run,two of them has freeze issue,it is random(about 50min,several hours,several days)
2.When device freeze,external I/O interruption can work
3.I run all functions at high frequency in main loop one by one,EEPROM.put() or Serial.printf() sometimes will cause freeze,when freeze RGB led stop blink.
4.I have setup one device to do test,if main loop and OS software timer run well two led will blink,When device freeze both two led stop blink,the RGB led is in the device I can not see it

possible cause:
1.high priority thread block
2.scheduler stop
3.hardware fault
4.OS crashed

But I can not find OS source code and Hard fault callback hook from system firmware.
I need some help to continue my debug.

1.It is not hard fault,after hard fault RGB led blink red,then Photon will reset
2.Flash not stall,because external I/O interruption can work

So It is OS crash or high priority thread block.
And I find Watch dog not work even System Thread enable it,I can call Soft AP API to crash Soft AP and then Photon not reset.
Really need some help,Pleas guys!

@ming You could try updating the system firmware to the latest version.

1 Like

No,I can not.I try the latest,but after days my device can not connect to cloud,then I read out the device key,device key is not the same as my backup.

The device key is independent of device OS version.
Currently the most reliable official version for Photons is 0.6.3 - I’d definetly get rid of 0.5.4.
If you have any issues with 0.6.3 compared with 0.5.4 it would be good to clearly state them in order to get them addressed in future releases.

1 Like

We really had some issues with 0.7.0. So better go with 0.6.3 like @ScruffR said.

@ScruffR @Rahul_G I take one board out from device to do test,when it is freeze RGB led stop blink too.

If device can not connect to cloud I can not update the firmware later,I can not take this risk,I will not upgrade to 0.6.3.Do you have any idea why it freeze?Or how to continue my debug?

I’d guess your code is causing this, but since we don’t see it we wouldn’t know.

If updating would be part of the cure but you refures that cure, you are at a lost position IMO.

Is there a method to debug ?

Yes, plenty when you have the code and the knowledge how to do it. If you are missing one of these you’ll have a hard time.

How can I get some crash information?

You can add boatloads of Serial.print() statements to your code on strategically important places which give you feedback about strategically valuable variable values and states of your program.
If you need more you can even use hardware debugging which is explained in threads like these
https://community.particle.io/t/programmer-shield-installing-openocd-mac/15308
5 steps to setup and use a debugger with the Particle Photon

And there are tons of resources to be found online

Serial.print() will case freeze too

Thanks for your advise.I can try debug tools.
But I want find out if FreeRTOS crash first.
I can not find the source code of FreeRTOS.

FreeRTOS part is not open source?

I get a better idea.
I will disable watchdog in system thread and run an empty main loop.
If device not freeze,then I can add my code line by line to find out why it freeze.

2 Likes