EmbeddedRelated.com
Forums
Memfault Beyond the Launch

Understanding #memmap

Started by funky February 4, 2007
Hello people,

I've got maybe a large code (~7000 lines) in a very memory limited
configuration (RCM2020 128KB ram/256KB flash), and usually when I try to use
_DEBUG or _VERBOSE macros, I get an error about no root space available. I'd
like to know what is happening when I write "#memmap xmem" at the beggining
of my code, which part (structs, global variables, local variables, static
and dinamic arrays etc..) is being stored in xmem if I dont specify any
(auto by default)? I this a good practice ? Any suggestion about it?
--
#memmap effects code placement only. You really always want #memmap xmem
unless you really are trying to make a small program.

All gobal variables, structs and arrays are always in root memory. The
only data in xmem RAM is allocated by xalloc() at run time.

Auto variables are in the stack area (4k of root memory)

Using #class auto will save root space. I believe #class auto is the
default after 8.x.

Look at changing the DATAORG in the bios. It controls the root
code/const and root data split.

--
------
| Scott G. Henion| s...@shdesigns.org |
| Consultant | Stone Mountain, GA |
| SHDesigns http://www.shdesigns.org |
------
Rabbit libs: http://www.shdesigns.org/rabbit/
today's fortune
BOFH Excuse #367:

Webmasters kidnapped by evil cult.

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.17.24/668 - Release Date: 2/4/2007 1:30 AM
Try changing DATAORG macro (Rabbitbios.c) to a value
greater than 0x3000. It can help on debugging process.
Also, if you have a lot of printfs on your code, try
to simplify it removing unecessary printfs.

Best regards

Memfault Beyond the Launch