String functions overcooking the Spark

So I was building some stuff and doing okay but then ran against the 4 exported functions limit so I thought I’d use the string functions to create a single function that does more.

First time I ran the code nothing seemed to happen. I sent the command a few more times then the main LED went out! Nothing would bring it back. In the end I tried the reload to factory stuff and that worked. I made some mods to the code but could not see anything wrong so I uploaded and ran again. Once more nothing happened after a short while I checked the connections and touched the top of the Spark and it was red hot! I pulled the plug, smartish.

After a while I plugged it in again and all stayed cool. Worked fine on the other functions, but when I tried my new one once it started heating up good and proper again. Is this just processor loading causing this and it is safe? Or am I doing something bad here somehow.

Trevor

Could you post your code for the problem function? It would be interesting to try to reproduce the problem. Pity the die on the core isn't a bit bigger, I could cook some eggs at the same time! :slight_smile:

Just in case it's useful, there's an internal temp sensor on the core's cpu - here's a post that reads it.

Anyone know if the cpu has built in overheat protection? If not, would it be worth adding to the firmware - say, an interrupt that fires regularly, and if temperature sensor indicates overheating a little, the interrupt stalls the cpu to help it cool down, and if overheating a lot, sleeps until the cpu cools to a safer temperature?

Been thinking of the exact same thing!! A generic - add-able/build-able function and just add the IF Foo=='newfunction' bla bla bla

@MisterNetwork Now that is what I went looking for initially but then started to build my own.

@mdma The temprature stuff is useful to know. Maybe it also explains why if felt for 10 mins like it was bricked but then started working again too? That could be some form of overheat protection.

I think I may have sussed it though. I called my function “Control” and I suspect that there is an internal function or something called the same. I figured it out when I put a line to light up the onboard LED as soon as the function was called however it never lit up and the Spark still locked up. Changed the name and now all seems to work and no more overheating.