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

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

Re: [avr-gcc-list] Code Size Causes Crash?


From: Marek Michalkiewicz
Subject: Re: [avr-gcc-list] Code Size Causes Crash?
Date: Thu, 27 Jan 2005 23:30:08 +0100
User-agent: Mutt/1.5.6+20040907i

Hello,

On Wed, Jan 26, 2005 at 12:58:07PM -0600, Kevin Neff wrote:
> 
> I am writing code for the ATMEGA128.  After my program reached a certain
> size it crashes/resets in the middle of the program.  If I increase
> the size of the program further, even if that code won't be executed,
> the MCU crashes very early in the program and hangs.

> Here is the listing of the test program.
> 
>   #define __AVR_ATmega128__
>   #include <avr/io.h>

Why the #define for device type?  It is supposed to be defined
automagically, depending on the avr-gcc -mmcu=... option.
Or are you trying to use avr-gcc without -mmcu=atmega128
(compiling code for the default device - AT90S8515), and then
run the code on ATmega128 (which has no RJMP wrap-around, so
it will fail if the jump destination is more than +/-4K away) ?

>   #include "../../bit_patterns.h"  // B0 = 0x01, b0 = ~B0

See http://gcc.gnu.org/bugs.html for instructions how to write
good bug reports.  Especially: provide complete command line,
and complete preprocessed (*.i) source of the test case.

You have to use the correct -mmcu=... option consistently,
everywhere (when compiling all your source files, and when
linking them into the final ELF executable).

If you do everything correctly, and still see the problem -
by all means, please report it and it will be fixed soon.

Hope this helps,
Marek



reply via email to

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