[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [avr-gcc-list] help debugging resets

From: Bernard Fouché
Subject: RE: [avr-gcc-list] help debugging resets
Date: Wed, 3 Nov 2004 13:13:15 +0100

I ran into optimization problems recently. More exactly turning on the
optimizer showed a bug that was invisible without it. I was missing a
'volatile' for a variable, this variable being changed in a interrupt. Since
the optimizer tries to keep data loading at minimum, my variable was just
read once before entering a loop instead at each iteration. In fact each
time I suspected the optimizer to be strange, I discovered problems of my
own :-)


-----Message d'origine-----
De : address@hidden
[mailto:address@hidden la part de Phil WOLSTENCROFT
Envoyé : jeudi 28 octobre 2004 05:22
À : address@hidden
Cc : address@hidden
Objet : Re: [avr-gcc-list] help debugging resets

On Tue, Oct 26, 2004 at 01:21:10PM -0700, David Morrison wrote:
> Is there a way that I can have the reset handler print out the
> module/line number that the MCU was on when it resets?  I am having an
> issue where my board with a ATmega162 is resetting and I can not
> narrow down where it is due to the fact that print statements change
> the behavior.

Have you tried turning of all optimization and testing again?.

I have had a problem with the optimization and am still trying to track down
where the problem is.

My code keeps resetting and I cannot determine the what the reset source is.
it does not seem to be any
of the hardware or flag-able ones that you can check in the registers.
I turn optimization of and it runs ok.

Will let the group know when I find it, unless someone else has an answer.

Currently using WinAVR-20040720.

avr-gcc-list mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]