Code stopped working during test until reprogrammed?

Thread Starter

jjmalove

Joined Jul 6, 2016
51
Hey all,

For the second time in my career as a tech/junior engineer, I had a board today that randomly failed mid test. Checking multiple times and it was as if all the code just stopped. This particular example was audio related and the sound went all garbled for a few seconds then vanished. The microcontroller in this example is related to the audio.

We reprogrammed it and the code took and all of a sudden everythings working fine.

Anybody have any plausible explanation? The weird thing was the board wasn't even being handled when it broke. We were just sitting a few feet away talking and it died. The audio portion was running and hearing us talk so the code was being used when it died, its just I'm much more familiar with things breaking when you touch them than just randomly. Also nothing was even remotely hot, that was the first thing I checked almost immediately to try and catch before things would have cooled.
 

djsfantasi

Joined Apr 11, 2010
9,156
Did you have other boards that did not fail? Does the code run without error on another board?

My first reaction is that the code caused an overrun of variable space, eating itself up. Like would happen with recursive code without limit checking.
 

AlbertHall

Joined Jun 4, 2014
12,345
Resetting the uC didn't fix it? If not then then some persistent change occurred which means either the EEPROM or flash contents were changed. Do you use the EEPROM? Do you have code which writes to the flash?
 

Thread Starter

jjmalove

Joined Jul 6, 2016
51
Thanks for the advice everyone. I think we have decided it was related to a hardware problem found. Had a very small sliver of copper that was shorting VCC and GND, and coming and going from vibration. Must have just been coincidence that the bumping to program it un-shorted it. It re-shorted later and stopped working again until I found the problem.

Thanks all!
 
Top