avr-libc-dev
[Top][All Lists]
Advanced

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

RE: [avr-libc-dev] Problem writing to flash - atmega644


From: Patrick Mahoney
Subject: RE: [avr-libc-dev] Problem writing to flash - atmega644
Date: Thu, 23 Aug 2007 18:11:22 -0400

Hi Markus,

Well I feel bad about saying this but the problem was that the legacy
framework I was using to build the .hex file was giving "-j .data -j
.text" option to avr-objcopy. Hence the .bootloader section was simply
not present in flash.

AVR Studio uses memory models during simulation/emulation, so I was kind
of blind. As you said, 0xFF instructions were getting executed until it
looped back to the reset vector.

One precision though... The Atmega644 _does_ support moving the whole
IVT in BLS... See table 10-2 page 58 of the reference manual
(2593L-AVR-02/07).

So my apologies and many thanks to everyone who gave it a thought... 


Pat 


-----Original Message-----
From: address@hidden
[mailto:address@hidden On
Behalf Of Markus Lampert
Sent: August 23, 2007 6:01 PM
To: address@hidden
Subject: Re: [avr-libc-dev] Problem writing to flash - atmega644

> And once again, if I leave this routine in the .text section, the
> unexpected resets suddenly disappear.

That would exactly be the behaviour if you have an interrupt enabled as
Joerg mentioned. The ATmega644 does not support moving the whole
interrupt vector table into the bootloader section. So any interrupt
(other than reset) would be serviced by whatever you have in the
application section. If you just downloaded your bootloader that would
be 0xFF. From experience I can tell you that is a noop (logically) and
the IP gets incremented as normal. So it runs through your whole code
section until it reaches something different than 0xFF which is the
bootloader reset vector (typically a rjmp). Looking from the outside at
the behaviour it would seem as if your processor gets reset, although no
reset source will be set (as you pointed out earlier).

Your best bet is going through your code and check if you enable any
interrupts, or if any of your library functions do so.

Markus





 
________________________________________________________________________
____________
Fussy? Opinionated? Impossible to please? Perfect.  Join Yahoo!'s user
panel and lay it on us.
http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 



_______________________________________________
AVR-libc-dev mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/avr-libc-dev




reply via email to

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