SOS flashing red led - hard fault

I just tried flashing my core via dfu-util and I’m getting the SOS panic 3 short 3 long red LED flashes plus 1 extra flash which indicates a hard fault.

I’ve gone through my code and can’t figure it out, plus I have no idea how to troubleshoot a hard-fault on a spark core. Checked in my latest source here

Any help would be greatly appreciated!!!

Hi @ubergeek82

There is too much code to find the problem quickly just by reading it, so you will have to help us out a bit.

You have a nice set of serial debug messages–what comes up right before the crash? That would give us a better idea where to look.

1 Like

Quick guess would be the pointer reference in your spark.variable string reference. A string is already a pointer so you shouldn’t need the & sign.



I wish I knew, trouble is I can’t get any serial output from the core at all. My guess is the code to initialize the serial out never gets executed. Is there another way to see what’s going on within the core while it’s loading the firmware? I’m hoping there’s an error message somewhere to give me a clue

I wonder if I should get a JTAG adapter to debug this…sorry I’m a total Arduino noob so apologies if I’m a bit lost

Hey @ubergeek82!

I’d recommend a JTag shield and debugger - very useful for these kind of problems, or for tracing down why code doesn’t behave as expected.

My guess for why you get a SOS is the syncTime() call, which uses the spark_protocol instance, but since you’re in MANUAL mode, the protocol isn’t initialized. (This bug is fixed in development version of the firmware, but not in production yet.)

So, remove the syncTime() call and see if that helps.


1 Like


THANK YOU! I figured it was something to do with MANUAL mode when I read this last night. I changed back to AUTOMATIC mode and sure enough my core was breathing cyan again.

I love this active community! you are guys what makes Spark the best IoT prototyping platform out there!