Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: [AVR-Chat] Cause a crash

2013-01-12 by Jim Wagner

The only "crash" of any significance is the endless loop. You look for an I2C peripheral thats not there? That is just an error and the code flows on. Same with virtually everything else. So why not a simple endless loop? 

You COULD call a function and purposefully corrupt the stack so that it does not return properly. Might crash or might not. Why not endless loop?

Jim Wagner
Oregon Research Electronics

On Jan 12, 2013, at 7:35 AM, englsprogeny1 wrote:

> Using an AtMega16, I am going to make use of the watchdog Timer.
> 
> I want to cause a crash to verify that the WDT brings us back to life.
> 
> Instead of going into an infinite loop "crash" I'd like to cause something more catastrophic. I tried a divide by zero scenario but we don't crash (even without the WDT implemented). It is as if the compiler 'optimized' this (divide by zero) line out.
> 
> How can I cause a good catastrophic crash (like divide by zero)?
> 
> Keep in mind that I don't want cause the catastrophic crash by using 300VDC for my source voltage, as this is very difficult to recover from.
> 
> :)
> 
> Thanks Guys!
> 
> 



[Non-text portions of this message have been removed]

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.