V0.8.0-rc.9 Causing SOS with 7 red flashes

Hello All,

I have had connection issues running my application in SYSTEM_THREAD(ENABLED) on v0.6.2. My custom p1 board starts flashing cyan and looses connection after 24 hours.

I decided to update to v0.8.0-rc.9 to see if the networking fixes help with the issue. The firmware booted up with the SOS code. I managed to get it running again by turning off a derived class which communicates with an nrf51822 over SPI. This code works well in <=v0.7.0. Turning off the class seems to eliminate the issue but all the class does at instantiation is initialize the members and turn the SS high.

There is also another derived class from the same base class that uses Particle.function causing the same error. I cannot post all the code as the project is large and complex. Can anyone provide some insight?

There are breaking changes to the firmware between v0.6.2 to v0.8.0-rc.9. You should review the changelog. Specifically, there are changes to Particle.publish(). I don’t see anything about Particle.function() in the changelog. The SOS fault codes say that 7 blinks is an “Exit”. @bko wrote that post, maybe he has insight.

There are multiple discussion about Photons having intermittent connection especially after a period of time such as this, this and this. Some of the issues were lengthy delays in code.

Without seeing any code whatsoever, we can only speculate. I assume you are not using Web IDE so would it be possible to post to github?

I have been debugging this all morning and 2 changes seem to fix the sos issue

//set ss high
  pinMode(ss, OUTPUT);
  digitalWrite(ss, HIGH);
  pinMode(irq, INPUT_PULLDOWN);
  attachInterrupt(irq, &Nrf51822_BLE::handler, this, RISING);

The delay is one fix

Particle.function(FUNCTION_NAME, &WiFiCmdProc::handler, this);

The above line was in the constructor
I moved it to a begin function that runs in setup

That solved one issue. I will see how stable v0.8.0-rc.9 is with wifi over the next few days.

That was a questionable practice for any version.
Since the order of execution of constructors is non-deterministic you mustnot use any code that relies on the finished construction of one object in the constructor of any other object.
Since the Particle object may not already be instantiated by the time your other constructor is executed you will cause an exception.