avr-gcc-list
[Top][All Lists]
Advanced

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

RE: [avr-gcc-list] CPU restart and pgm_read_word( ) function


From: Loveny Design
Subject: RE: [avr-gcc-list] CPU restart and pgm_read_word( ) function
Date: Tue, 29 Jun 2004 10:05:50 +1000

Hi,

That sounds like the Atmel mega128 bug I remember reading about on
comp.arch.embedded? IIRC it only occurs when running at high speed like
16MHz, try reducing the clock to say 8MHz and see if you get the same
problem. You could also search the newsgroup or contact atmel/distributors
to get more info.

Regards,
Jon


> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden Behalf Of address@hidden
> Sent: Tuesday, 29 June 2004 12:39 AM
> To: avr-gcc-list
> Subject: [avr-gcc-list] CPU restart and pgm_read_word( ) function
>
>
> Hi to all,
>
> I'm developing an application using WinAVR20040404 and I'm using
> JTAG ICE with AVR-Insight to debug.
>
> The CPU is a ATmega128 with external ram clocked at 16 MHz.
>
> When I run the my application, sometimes ( not all the times) it
> restart to 0 (I put a breakpoint to address 0 ) but I'm not able
> to find the point where it happens; I have redefined the symbol
> void __bad_interrupt( void ), put in the main file and set a
> breakpoint on it, but this breakpoint does not occur.
>
> I have investigated the problem trying to find out why the CPU jump to 0.
>
> After a long debug I have discovered this:
> I have an array of pointer to function in flash and I access this
> table reading it with the library function pgm_read_word( ).
>
> I have seen that in some cases the pointer read from the flash is
> different from the value I see in the listing generated by
> avr-objdump and also present in the hex file I use to program the device.
>
> For example in the listing I have the value 0x42cc while from the
> flash I have 0x424c or
> 0x4372 instead of 0x43f2.
>
> The problem occurs only some times.
>
> Of corse the icall jump to a wrong point (normally in a middle
> point of a different function) and then the cpu restart from 0.
>
> In the source file I have included <avr/pgmspace.h>.
>
> I have verifyed the software in the flash also with AVR-ISP
> programmer and also with avarice with AVR-JTAG and the
> verification is OK.
>
> Any idea about this problem ?
>
> Thanks
>
> Patrizio Zelotti
>
>
>
> _______________________________________________
> avr-gcc-list mailing list
> address@hidden
> http://www.avr1.org/mailman/listinfo/avr-gcc-list
>



reply via email to

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