Re: AVR ATmega644 mysterious reset ?



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

.



Relevant Pages

  • Re: Oyster Card System Failure
    ... I've not yet come across r/w memory that can't be reset if theres ... some of the memory as read only - IIRC sector 0 (which contains the ... Initially the card is created with this address as 0. ...
    (uk.transport.london)
  • RiscPC video problems
    ... reset it by the reset button. ... My first thought was memory. ... 0 64 Mbytes ... always been fitted with a 2M VRAM Module. ...
    (comp.sys.acorn.hardware)
  • Re: off screen plain
    ... created a surface (soon to maybe be a memory stream) of 1024x14000. ... reset wouldn't let me lock the texture anymore. ... What if the device is lost for sometime. ...
    (microsoft.public.win32.programmer.directx.managed)
  • Re: PPC not being recognized - sort of!
    ... The memory should not be a problem either. ... very little installed - thanks to a Hard Reset three weeks ago. ... PPC and re-establish the connection. ... >>> Helio Diamant ...
    (microsoft.public.pocketpc)
  • Re: Help! Tungsten T Constantly Resets
    ... Resets are used in operating systems that leak ... I reset on occasions, but only when symptoms of weakness begin to arise. ... I agree that leaked memory is a main concern. ... Roy S. Schestowitz | Useless fact: 85% of plant life in in the oceans ...
    (comp.sys.palmtops.pilot)