EmbeddedRelated.com
Forums

compile error: out of variable data space

Started by Matthew P. Kelton June 15, 2004
I've been developing an app for an RCM3200. Lately, I have been
compiling and running in RAM, but since I wanted to utilize the user
black, have gone to compile in Flash, run in RAM. Now, my program
gives an "out of variable space" error on compile.

Looking through the archives, it appears xmem is my solution. I gues
what I am looing for is suggestions for "good pracice" when using xmem
and not using it.

Is there a way to determine how much variable space my program is
using, or do I just have to count them up? Also, how much variable
space is available in flash, or is it not separated?

Thanks,
Matthew



The amount of variable you're using is found at the top of the .map
file.
I don't know about "good practice" for using xmem, but my experience
has been to put all code into xmem space by default. I get the least
amount of memoryproblems doing that. So, near the top of my main.c
file I put:

#memmap xmem

Using separate I&D is supposed to make more root variable space
available also, but I've never had much success with it so I don't
use it. Others on this board use it quite successfully. Perhaps they
will have some pointers for you.

Steve --- In rabbit-semi@rabb..., "Matthew P. Kelton"
<matthew.kelton@a...> wrote:
> I've been developing an app for an RCM3200. Lately, I have been
> compiling and running in RAM, but since I wanted to utilize the user
> black, have gone to compile in Flash, run in RAM. Now, my program
> gives an "out of variable space" error on compile.
>
> Looking through the archives, it appears xmem is my solution. I
gues
> what I am looing for is suggestions for "good pracice" when using
xmem
> and not using it.
>
> Is there a way to determine how much variable space my program is
> using, or do I just have to count them up? Also, how much variable
> space is available in flash, or is it not separated?
>
> Thanks,
> Matthew




--- In rabbit-semi@rabb..., "Steve" <seecwriter@y...> wrote:
> The amount of variable you're using is found at the top of the .map
> file.
> I don't know about "good practice" for using xmem, but my
experience
> has been to put all code into xmem space by default. I get the
least
> amount of memoryproblems doing that. So, near the top of my main.c
> file I put:
>
> #memmap xmem
>
> Using separate I&D is supposed to make more root variable space
> available also, but I've never had much success with it so I don't
> use it. Others on this board use it quite successfully. Perhaps
they
> will have some pointers for you.

All DC libraries are coded to work with or without SI&D.

I advise developing programs with separate I&D space enabled. If your
existing program doesn't run when you change it to use SI&D, the most
likely causes are that you need to change the way you set up
interrupt vectors if you are changing them at run-time, or you are
accessing DB'ed assembly tables as data and you need to add
the "const" keyword:

#asm const
myrootconstants::
db 0x40, 0x41, 0x42, ...etc.
#endasm

If your existing program doesn't compile because of an "Out of
constant data space" message, it should be fixable by increasing
DATAORG in the BIOS file.

See Technote 238 and the DC manual for more details.

If you are experiencing different problems those mentioned above
please let us know what they are.

> Steve > --- In rabbit-semi@rabb..., "Matthew P. Kelton"
> <matthew.kelton@a...> wrote:
> > I've been developing an app for an RCM3200. Lately, I have been
> > compiling and running in RAM, but since I wanted to utilize the
user
> > black, have gone to compile in Flash, run in RAM. Now, my program
> > gives an "out of variable space" error on compile.
> >
> > Looking through the archives, it appears xmem is my solution. I
> gues
> > what I am looing for is suggestions for "good pracice" when using
> xmem
> > and not using it.
> >
> > Is there a way to determine how much variable space my program is
> > using, or do I just have to count them up? Also, how much
variable
> > space is available in flash, or is it not separated?
> >
> > Thanks,
> > Matthew




If I use seperate I&D, the code will compile without error.

I already had the line #memmap xmem, but the code still will not
compile correctly. I get the variable space error in TCP.lib at the
following line:

tcp_Pending tcp_pendingpool[TCP_MAXPENDING];

Looking at the timestamps on my files, only my top level c code got
compiled before the DC libraries began to compile. My main library
file of supprot info did not get recompiled.

Here is the beginning of the map file for my top level code:

// Compilers view of MMU. Note these values are determined by the
origin statements in the BIOS.
//Segment Origin Size
Root Code 00:0000 00478a
Root Data 00:5fac ffffa953
Xmem Code ff:e1ea 0144e2

I'm guessing root data maxes out at ffffffff?

I am not using any interrupts other than whatever the standard DC
RS232 and TCP/IP drivers use. I was trying to use serial interrupts,
but have abandoned them when I ran into all sort of problems, and many
on the list have said in the past not to use them.

If I am using xmem, is there a special way I am supposed to declare
variables? I apologize if these are stupid questions, but this is my
first DC program. I am using DC 7.32TSE, BTW.

For what it is worth, this is the beginning of my map file with I&D
turned on:

// Compilers view of MMU. Note these values are determined by the
origin statements in the BIOS.
//Segment Origin Size
Root Code 00:0000 0034f2
Root Data 00:bfff 0064c8
Xmem Code 0e:e000 012fb4 Thanks for the help,

Matthew

--- In rabbit-semi@rabb..., "bmurthazw" <bmurthazw@y...> wrote:
> --- In rabbit-semi@rabb..., "Steve" <seecwriter@y...> wrote:
> > The amount of variable you're using is found at the top of the .map
> > file.
> > I don't know about "good practice" for using xmem, but my
> experience
> > has been to put all code into xmem space by default. I get the
> least
> > amount of memoryproblems doing that. So, near the top of my main.c
> > file I put:
> >
> > #memmap xmem
> >
> > Using separate I&D is supposed to make more root variable space
> > available also, but I've never had much success with it so I don't
> > use it. Others on this board use it quite successfully. Perhaps
> they
> > will have some pointers for you.
>
> All DC libraries are coded to work with or without SI&D.
>
> I advise developing programs with separate I&D space enabled. If your
> existing program doesn't run when you change it to use SI&D, the most
> likely causes are that you need to change the way you set up
> interrupt vectors if you are changing them at run-time, or you are
> accessing DB'ed assembly tables as data and you need to add
> the "const" keyword:
>
> #asm const
> myrootconstants::
> db 0x40, 0x41, 0x42, ...etc.
> #endasm
>
> If your existing program doesn't compile because of an "Out of
> constant data space" message, it should be fixable by increasing
> DATAORG in the BIOS file.
>
> See Technote 238 and the DC manual for more details.
>
> If you are experiencing different problems those mentioned above
> please let us know what they are.
>
> > Steve
> >
> >
> > --- In rabbit-semi@rabb..., "Matthew P. Kelton"
> > <matthew.kelton@a...> wrote:
> > > I've been developing an app for an RCM3200. Lately, I have been
> > > compiling and running in RAM, but since I wanted to utilize the
> user
> > > black, have gone to compile in Flash, run in RAM. Now, my program
> > > gives an "out of variable space" error on compile.
> > >
> > > Looking through the archives, it appears xmem is my solution. I
> > gues
> > > what I am looing for is suggestions for "good pracice" when using
> > xmem
> > > and not using it.
> > >
> > > Is there a way to determine how much variable space my program is
> > > using, or do I just have to count them up? Also, how much
> variable
> > > space is available in flash, or is it not separated?
> > >
> > > Thanks,
> > > Matthew




HI Matthew and the others,
Where you able to use Xmem successfully to allocate more data
variables?.
If so, do you have any samples that you could post here?

Regards
Nil

--- In rabbit-semi@rabb..., "Matthew P. Kelton"
<matthew.kelton@a...> wrote:
> I've been developing an app for an RCM3200. Lately, I have been
> compiling and running in RAM, but since I wanted to utilize the
user
> black, have gone to compile in Flash, run in RAM. Now, my program
> gives an "out of variable space" error on compile.
>
> Looking through the archives, it appears xmem is my solution. I
gues
> what I am looing for is suggestions for "good pracice" when using
xmem
> and not using it.
>
> Is there a way to determine how much variable space my program is
> using, or do I just have to count them up? Also, how much variable
> space is available in flash, or is it not separated?
>
> Thanks,
> Matthew