Debugging a locked up Boron

So, after weeks of debugging with Dave we think that the issue is not serial1 but probably calling a Log.trace() in the RGB.onChange() handler. :pensive: . When debugging I intentionally left in all print statements in an attempt to see where the Boron device would freeze on, I guess its counter intuitive that removing a print statement would actually fix the issue. Hence I never found the problem.

The reason why RGB.onChange() was used is as a work around for RGB.mirrorTo() not working in OS 0.9.0 as mentioned in RGB mirror not working on Argon - #4 by slacker89 . This also explains why my electron did not freeze since I was using RGB.mirrorTo(). This should be fixed in the next up coming OS.

Dave also pointed out that this is mentioned on their document which I missed out on: https://docs.particle.io/reference/device-os/firmware/boron/#rgb

The onChange handler is called 1000 times per second so you should be careful to not do any lengthy computations or functions that take a long time to execute. Do not call functions like Log.info, Serial.print, or Particle.publish from the onChange handler. Instead, save the values from onChange in global variables and handle lengthy operations from loop if you need to do lengthy operations.

Note: We tried a few suggestions like adding an application watchdog to reboot the device but when the Boron locks up, it really locks up. I guess this is an issue Particle should fix anyway since nothing should ever lock the device up this badly.

Long and painful journey but at least its solved.

3 Likes