Re: AVR ATmega644 mysterious reset ?
- From: Robert Adsett <sub2@xxxxxxxxxxxxxxxxxxxxx>
- Date: 25 May 2007 08:42:52 -0700
On May 25, 10:11 am, "Morten M Jørgensen" <n...@xxxxxxxxxxxxx> wrote:
I verified that the application not by accident jumps to the undefined part
of the program memory and just runs until it returns to 0x0000 (Reset
Vector). Further more all volatile memory is cleared when the problem
occurs - stating that my problem is a reset for sure!
Nope, that just means that you have probably run a major portion of
your startup again. If you started from your 2nd, 3rd, or 4th
instruction of your startup would the observable results be any
different than a full reset? Startup usually contains code for other
basic setup (such as stack position) before memory clearing. Since
much of that is already done you wouldn't notice if it had bee
skipped.
A possibility could be a stack overflow caused by the recursivity - but that
should not generate a uC reset?
No but it could still jump to your start location. All that has to
happen is the return address on the stack gets overwritten with the
address of the start vector and then on return you do something
similar to a reset missing only the HW side effects.
Any ideas on how I'll be getting closer to solve this anoying bug? Or anyone
have an idea why I see this problem?
Limit the number of tags you'll process. Sneak up on the number that
starts causing a problem. It may be easier to diagnose with a minimal
case. do NOT ignore odd behaviour at quantities below that required to
cause the failure, they may be early signs of the root cause and since
you may still have a partially operating system they might be easier
to diagnose. And take a good look at what ever memory usage you have
on a per tag basis. If you are using dynamic memory allocation
particularly something from the *alloc family there is a good chance
the heap and stack are colliding, and if you are then you probably
should switch to something more robust.
Robert
.
- References:
- AVR ATmega644 mysterious reset ?
- From: Morten M Jørgensen
- AVR ATmega644 mysterious reset ?
- Prev by Date: Re: AVR ATmega644 mysterious reset ?
- Next by Date: Re: PIC24HJ64GP206, ICD2 -> ICD0083: Debug: Unable to enter debug mode.
- Previous by thread: Re: AVR ATmega644 mysterious reset ?
- Next by thread: Re: AVR ATmega644 mysterious reset ?
- Index(es):
Relevant Pages
|