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

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

Re: [avr-gcc-list] Data RAM Pointers


From: E. Weddington
Subject: Re: [avr-gcc-list] Data RAM Pointers
Date: Sat, 06 Nov 2004 07:08:32 -0700

On 5 Nov 2004 at 16:36, Theodore A. Roth wrote:

> On Fri, 5 Nov 2004, Keith Gudger wrote:
> 
> > I have a question about data pointers and gcc / gdb / simulavr.
> >
> > A real data pointer is 16 bits long.  In GCC land, data pointers are 24
> > bits long (there is an extra byte with "0x80" in it).  I have a structure
> > which has an element:
> >
> > uint32_t* ram_add;
> >
> > 16 bits get reserved for this pointer.  The value written into it is
> > 0x800108.  When later using this address, I realize that this is not a
> > problem for the "real" chip, but what happens in gdb / simulavr?
> 
> GDB always thinks about sram memory with the 0x800000 offset. It sends
> the memory read/write requests over the wire to the remote target with
> the address offset and it is up to the remote target
> (avarice/simulavrxx/simulavr) do decode it into the correct memory
> space. GDB can only "visualize" a single, linear memory space. We cheat
> by mapping the AVR's various memory spaces into various chunks of a
> 32-bit space, hoping that there will never be any overlaps.
> 
> Remember, what you have above is just a pointer to a 32-bit value.
> Pointers are _always_ 16-bits in the avr so the simulator should not be
> thinking about it in any other way.

Note to Keith:

We're aware that at some point the 16-bit pointer size will have to change when 
new, and 
bigger, AVR devices come online.

Eric


reply via email to

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