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

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

Re: [avr-gcc-list] stumped: minor refactoring of simple program causes i


From: David Kelly
Subject: Re: [avr-gcc-list] stumped: minor refactoring of simple program causes it to fail
Date: Thu, 3 Jan 2008 09:34:16 -0600
User-agent: Mutt/1.4.2.3i

On Thu, Jan 03, 2008 at 08:02:14AM -0700, address@hidden wrote:
> OK, once again I am an idiot.  I stared right at this for hours and
> somehow didn't see it.  My makefile had the -mmcu flag set to
> atmega168, but this chip is an ATmega48.
> 
> This apparently can cause all sorts of weird behavior, like some code
> working fine while other, very similar code, locks up.
> 
> After correcting the mmcu, things appear to work much better!

I threw your code at avr-gcc last night and it looked reasonable to me
but decided I was too sleepy to judge, and too sleepy to form a proper
reply.

I'm a big advocate of adding this rule to your Makefile:

#
#  This is a fun conversion, creates an assembly dump
#  including C source lines interspersed as comments.
#
.elf.list:
        avr-objdump -DS $< > $@

Then in your all: target do something like this:

all:    object.elf object.list

It was the .list file I was looking at last night that looked
reasonable.

-- 
David Kelly N4HHE, address@hidden
========================================================================
Whom computers would destroy, they must first drive mad.




reply via email to

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