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

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

Re: [avr-gcc-list] Using avr-gcc with AVRStudio's simulator


From: Paul Shaffer
Subject: Re: [avr-gcc-list] Using avr-gcc with AVRStudio's simulator
Date: Wed, 21 Jan 2004 16:43:01 -0800

Hi,

Thank you for your reply.  Yes, the code below demonstrates
the problem.  After further experimentation, I discovered
that volatile or not, the AVR Simulator watch view works fine
as long as the variables are in the global scope.

Locally scoped variables seem to always have the problem.

In fact, optimization was turned off and debugging was on
in my example.  FYI, here are the compile/link lines:

avr-gcc -g -Wall -mmcu=at90s2313    -c -o demo.o demo.c
avr-gcc -g -Wall -mmcu=at90s2313  -Wl,-Map,demo.map -o demo.elf demo.o

Any other ideas?  Anyone else able to duplicate this?
Maybe this is a bug in the elf-to-extended-coff conversion?

thanks


This code, when compiled with avr-gcc 3.3.1 (and using the
patched elf-to-extended coff converter), executes fine, but
the AVRStudio simulator version 4.08 reports an  "Invalid location"
for the variable "unit" in the watch view, stating that the location
is at 0xFFFFFFE0 [SRAM].  Of course, the value of the variable
can not be viewed.

void main(void)
{
    int unit;
    unit = 5;
}

Hello Paul and all,

Does the question really concern this simple program? If so, I suspect that
the compiler optimizes the variable "unit" out since it is not really used to anything. What happens if you define it volatile (or turn optimization off)?

_________________________________________________________________
Get a FREE online virus check for your PC here, from McAfee. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963



reply via email to

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