What does stack overflow look like on the blink visual interface?

Hey, new to Blinks and testing out the “limits” to program size. I think I’m running into a stack overflow condition but not sure. At the point where if I add one small section of code with a Timer, my sketch dies after upload/transfer with a short white flash, a fading dark blue to black and then nothing. If I click, I get the same visual sequence. Similar to the “shutdown” sequence. I assume this is caused by a stack overflow? I’m just wondering what the visual feedback is for this condition?

It is the additional Timer that does it every time and for ref, my blink had about 250 bytes left of local memory before the addition of the extra few lines.

In the mean time, I will optimize variable/data usage to see if that fixes the issue so I can squeeze in some more game logic.

Cheers, Dave

With a stack overflow you should see the error code of 4 red flashes. This thread shares some details around the error codes as well as the stack.

This behavior of the sleep animation being triggered is surprising to me. Let me know if you can provide steps to recreate it.

1 Like

Got it - thanks. I was searching in the wrong area of the forum, sorry to make you dig that up for me. :slight_smile:

The behavior I was seeing is odd and not always reproducible. I put that project on hold for a short bit - but will try to setup a concrete example that is reproducible so it will be helpful. I’m guessing it’s in my code.

Dave

Note that although the stack guard can catch stack overflows, it does that by checking for a specific 16-bit value and if you are unlucky enough that you overwrote it with exactly the same value, you might still be corrupting things but not getting the 4 red flashes.

1 Like